ReferenceError
netsuite returns this error: org.mozilla.javascript.EcmaError: ReferenceError: “format” is not defined. (/SuiteScripts/altera_data_ue.js#55)
What is wrong?
Line 55, in this case, is this: var newAcceptableDate = format.format
var d = new Date(transDueDate);
var newDueDate = d.setDate(d.getDate() + transTerms);
var newAcceptableDate = format.format({
value: newDueDate,
type: format.Type.DATE
})
curRec.setValue({
fieldId: 'duedate',
value: newAcceptableDate,
ignoreFieldChange: true
});
define the format in the script like define(“N/format”) like that. It should work.
I already included this module, but it doesn’t work. Talking to another dev, he said I should set a date in my code since I didn’t. The logic was just to take the date of a field, and manipulate it. Thanks, amigo 😀



