Scruffy
06/28/2021, 2:59 PM;define(['N/record','N/log'], function (record, log) {function beforeSubmit(context){var objRecord = context.newRecord; //Create objectvar estBodyShipDate = objRecord.getText('custbody_estimated_ship_date');//get text of datevar numLineItems = objRecord.getLineCount({sublistId: 'item'});for (let index = 0; index < numLineItems; index++){updateLine(objRecord, index, estBodyShipDate);log.debug({"title": "For Loop Debug","details": "Line " + index + " updated."});}}function updateLine(objRecord, index, estBodyShipDate){objRecord.selectLine({sublistId: "item",line: index});objRecord.setCurrentSublistValue({sublistId: "item",fieldID: "expectedshipdate",value: estBodyShipDate});objRecord.commitLine({sublistId: "item"});}return {beforeSubmit : beforeSubmit}});Watz
06/28/2021, 3:06 PMScruffy
06/28/2021, 3:08 PMScruffy
06/28/2021, 3:09 PMletstalbert
06/28/2021, 3:47 PMScruffy
06/28/2021, 3:50 PMstalbert
06/28/2021, 3:51 PMstalbert
06/28/2021, 3:53 PMScruffy
06/28/2021, 3:53 PMstalbert
06/28/2021, 4:46 PMScruffy
06/28/2021, 5:45 PM