In NetSuite, have a Restlet script that calls a deployed map/reduce script but the map stage shows as Failed when looking at details of status page (the getInputData stage does run and shows as Complete).
However, if I do a "Save and Execute" from the deployment of the map/reduce script, it works fine (Map stage does run).
Note that:
- There is no error on execution log of either the restlet or the map/reduce scripts.
- Have 'N/task' in define section of restlet as well as task in function parameters.
- The map/reduce script has the Map checkbox checked. The map/reduce script deployment is not scheduled and has default values for other fields.
- Using NetSuite help "See the quick brown fox jump" sample map/reduce script
- Using Sandbox account
- Using a custom role to post to restlet
Below is call to create.task code snippet from my Restlet. Don't know what is wrong, any help is appreciated.
var mrTask = task.create({
taskType: task.TaskType.MAP_REDUCE,
scriptId: 'customscript_test',
deploymentId: 'customdeploy_test'
});
var mrTaskId = mrTask.submit();
var taskStatus = task.checkStatus(mrTaskId);
log.debug('taskStatus', taskStatus);