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:
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);
答案 0 :(得分:1)
MapReduceScriptTask.submit()的帮助没有提到这个,但ScheduledScriptTask.submit()的帮助确实如此:
只有管理员才能运行预定脚本。如果用户事件脚本调用ScheduledScriptTask.submit(),则必须使用管理员权限部署用户事件脚本。
我测试了使用管理员角色凭据发布到我的restlet,它可以正常工作,而不是使用我的其他自定义角色。也许就像ScheduledScriptTask一样,MapReduceScriptTask只能由管理员角色调用?我的自定义角色确实具有SuiteScript - View和SuiteScript Scheduling - 完全权限。以为这样可以解决问题,但显然不是。
有人对此有任何进一步的了解吗?
答案 1 :(得分:0)
您还需要Documents and Files -View权限以及SuiteScript-View和SuiteScript计划-完整权限才能访问Map / Reduce脚本。