Synx
09/16/2020, 5:40 PMfunction sublistChanged(scriptContext) {
var timesheet = scriptContext.currentRecord;
var customerID = timesheet.getCurrentSublistValue({
sublistId: 'timeitem',
fieldId: 'customer'
});
log.debug (customerID);
var projectRecord = record.load({
type: record.Type.JOB,
id: customerID,
isDynamic: true,
});
log.debug(projectRecord);
var location = projectRecord.getValue('custentity4_2');
log.debug(location);
timesheet.setCurrentSublistValue({
sublistId: 'timeitem',
fieldId: 'location',
value: location,
// ignoreFieldChange: false
});
log.debug(timesheet)
}