schedule a map reduce script progrmatically

962 views Asked by At

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

There are 3 answers

1
Steve Reeder On BEST ANSWER

The deployment records are not scriptable.

0
w3bguy On

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.

1
Steve Reeder On

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.