USER EVENT SCRIPT 2.0 TO LOAD A RECORD, READ IT'S VALUE AND SET A FIELD VALUE
Below code loads a sales order, reads it's sublist values and sets value of a custom field. /** *@NApiVersion 2.x *@NScriptType UserEventScript */ define(['N/record','N/log'], // modules used function(record,log) { function afterSubmit(context) { if (context.type !== context.UserEventType.DELETE) { var rec_id = context.newRecord.id; // get record id log.debug({ title: 'rec_id', details: rec_id ...