Luis
11/23/2023, 5:48 AMLuis
11/23/2023, 5:48 AM/**
* @NApiVersion 2.x
* @NScriptType UserEventScript
* @NModuleScope SameAccount
*/
define(['N/record', 'N/log'],
function(record, log) {
function beforeLoad(context) {
try {
if (context.type === context.UserEventType.CREATE) {
var newVendorBill = context.newRecord;
var headerFinLoc = newVendorBill.getValue({
fieldId: 'cseg1'
});
log.debug('headerFinLoc: ', headerFinLoc);
var vendorBillLinesCount = newVendorBill.getLineCount({
sublistId: 'item'
});
log.debug('vendorBillLinesCount: ', vendorBillLinesCount);
for (var i = 0; i < vendorBillLinesCount; i++) {
newVendorBill.setSublistValue({
sublistId: 'item',
fieldId: 'cseg1',
line: i,
value: headerFinLoc
});
}
}
} catch (e) {
log.error({
title: 'Error',
details: e
});
}
}
return {
beforeLoad: beforeLoad
};
});
Watz
11/23/2023, 6:56 AMLuis
11/23/2023, 7:50 AMMotaz Mohamed
11/23/2023, 5:42 PMAnthony OConnor
11/23/2023, 6:35 PMWatz
11/23/2023, 6:35 PMAnthony OConnor
11/23/2023, 6:36 PMAnthony OConnor
11/23/2023, 6:36 PMWatz
11/23/2023, 6:37 PMWatz
11/23/2023, 6:38 PMAnthony OConnor
11/23/2023, 6:38 PMWatz
11/23/2023, 6:39 PMAnthony OConnor
11/23/2023, 6:40 PMAnthony OConnor
11/23/2023, 6:42 PMbattk
11/23/2023, 7:26 PMbattk
11/23/2023, 7:26 PMbattk
11/23/2023, 7:27 PMLuis
11/23/2023, 9:45 PM