Scruffy
11/17/2022, 8:25 PMScruffy
11/17/2022, 8:28 PMdefine(['N/record', 'N/log', 'N/ui/dialog'], function (record, log, dialog) {
function Sublist(lines, quantities = [], names = []) {//contructor
this.lines = lines;
this.quantities = quantities;
this.names = names;
}
var initialSublist = new Sublist();//create object
var afterSublist = new Sublist();//create object
function beforeLoad(context) {
if (context.type !== context.UserEventType.EDIT) return;
var objRecord = context.newRecord;
//get initial values
return true;
}
function beforeSubmit(context) {
if (context.type !== context.UserEventType.EDIT) return;
var objRecord = context.newRecord;
//get after values
//compare initialSublist with afterSublist
}
return {
beforeLoad: beforeLoad,
beforeSubmit: beforeSubmit
}
});
Scruffy
11/17/2022, 8:29 PMreptar
11/17/2022, 8:40 PMcontext.oldRecord
/ context.newRecord
within an entry point function. I think that's what you're trying to do...Scruffy
11/17/2022, 8:40 PMbattk
11/17/2022, 10:39 PMbattk
11/17/2022, 10:41 PMbattk
11/17/2022, 10:42 PMbattk
11/17/2022, 10:43 PM