Hi, I am trying to run mass update script on one o...
# suitescript
h
Hi, I am trying to run mass update script on one of our custom records as below /** *@NApiVersion 2.x *@NScriptType MassUpdateScript */ define(['N/record', ‘N/format'], function (record) { function each(params) { // Need to LOAD each record and SAVE it for changes to take effect // LOAD the SubItem var ItemLoad = record.load({ type: params.type, id: params.id }); var newDate="01/12/2022"; var parseDate = format.format({ value: newDate, type: format.Type.DATE }); ItemLoad.setValue('custrecordzab_si_start_date',parseDate); ItemLoad.save() } return { each: each }; }); I receive an error for running this on one of the records as following: org.mozilla.javascript.EcmaError: ReferenceError: "format" is not defined when I debug the code, I found that it failes on format.format. I am not sure what am I missing, or what else I have to add for this in order to run. I tried to swap the modules in the define section and it couldn’t find the record module when I run the script thanks for any help in advance.
j
after your
define
you don't include
format
in your main function block. It would have to be
function (record, format) {
👍 2
h
Thank you very much, this is my first script and I am in the learning phase, do you recommend any learning materials?
s
https://www.youtube.com/channel/UCXciP6DplQzzLIbreiBAsmg Stoic Software is where a lot of us learned foundational stuff
h
Thank you I will watch these videos