Scruffy
06/28/2021, 2:59 PM;
after my for loop initializer but i dont see it. Im using VS Code and it doesnt see any syntax errors
define(['N/record','N/log'], function (record, log) {
function beforeSubmit(context){
var objRecord = context.newRecord; //Create object
var estBodyShipDate = objRecord.getText('custbody_estimated_ship_date');//get text of date
var 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 PMlet
stalbert
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