RE: 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

      fieldId: 'duedate',
      value: newAcceptableDate,
      ignoreFieldChange: true
NiceGuy240 Rookie Asked on August 4, 2021 in SuiteScript.
Add Comment
1 Answers

define the format in the script like define(“N/format”) like that. It should work.

Rookie Answered on August 6, 2021.

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 😀

on August 6, 2021.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.