```function sublistChanged(scriptContext) { va...
# suitescript
s
Copy code
function 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)
}