This example access the oldrecord and selects a line on the address sublist. It retrieves a value from the sublist line that is not part of the subrecord. It also retrieves the address subrecord and reads one of the subrecord’s fields.
const oldRec = scriptContext.oldRecord;
let subrecold = oldRec.getSublistSubrecord({
sublistId : ‘addressbook’,
fieldId : ‘addressbookaddress’,
line : 0
});
let oldAddress = subrecold.getValue({
fieldId : ‘addrtext’
});