0
votes

Has anyone wrote any code to modify a script deployment through suitescript ? I am trying to load and set the start date and start time for a map reduce script but its not working

var record2= nlapiLoadRecord('scriptdeployment', id, {recordmode: 'dynamic'});
record2.setFieldValue('status' , 'SCHEDULED');
record2.setFieldValue('startdate' , new Date());
record2.setFieldValue('starttime' , 1100);
nlapiSubmitRecord(record2,true);
3
What do you mean by "not working"? Please be more specific. - GalaxyCat105
meaning it wont allow me to set the start date and start time values of a map reduce script - Mezo Uchiha
since you can't do that direclty what are you tying to achieve by doing this in a map /reduce? Can't you just extend the reduce script to achieve whatever you wanted to do in the scheduled script? - bknights

3 Answers

0
votes

The deployment records are not scriptable.

0
votes

You want to use the N/task module, to start a Map/Reduce script progammatically.

As for scheduling it you could just do that from the deployment record, or call the N/task module to start it from some other trigger.

0
votes

Have you tried setting the start date field with a text value rather than Date object?

Usually a date object works for a date/time field. Maybe you need to source the DATEFORMAT preference, and set the date value accordingly.

The same would apply for the time field, it should be in the same time string format as you see in the UI.