Tyler
06/01/2020, 3:11 PMvar newSublist = context.newRecord.getSublist('item');
log.debug('newSublist', newSublist);
When I add a new line to the Item sublist on a Sales Order and save, I expected to see the isChanged property on the newSublist variable set to true, but it still shows as false. Am I missing something here?stalbert
06/01/2020, 3:24 PMisChanged
only applies to client scripts?Tyler
06/01/2020, 3:26 PMstalbert
06/01/2020, 3:57 PMconst newSO = new SalesOrder(ctx.newRecord)
const oldSO = new SalesOrder(ctx.oldrecord)
const isChanged = _.isEqual(oldSO.item, newSO.item)
Tyler
06/01/2020, 3:58 PMstalbert
06/01/2020, 4:00 PMstalbert
06/01/2020, 4:01 PMTyler
06/01/2020, 4:01 PMstalbert
06/01/2020, 4:06 PMTyler
06/01/2020, 4:07 PMMTNathan
06/01/2020, 4:09 PMitem
sublist changed and then checking that box in a client script's sublistChanged
function using CurrentRecord.getSublist('item').isChanged
(the client script is actually a hold-over 1.0 version using nlapiIsLineItemChanged() but I can't imagine the 2.0 equivalent won't work identically). It might be overkill depending on your needs, but then you've got a simple checkbox available with that flag in any other script deployed to the same record in case that's helpful at all.Tyler
06/01/2020, 4:10 PMMTNathan
06/01/2020, 4:29 PM