Script
let processTask = task.create({
taskType:task.TaskType.MAP_REDUCE,
scriptId:'customscript_hms_fix_hospice',
deploymentId:'customdeploy_hms_fix_hospice',
params:{custscript_hms_data_to_be_processed:queRecId}
})
try{
let processId = processTask.submit()
}catch(err)
{
if(err.name != "NO_DEPLOYMENTS_AVAILABLE")
{ // If error except no deployments availble
log.error("error",err);
throw err;
}
}
getInputData works fine.
Map reduce work while clicking on save & Execute
Issue: The integration record should have following permissions to access the Map/Reduce script.
Documents and Files -View
SuiteScript - View
SuiteScript Scheduling
Solution: Add Documents and Files -View for the integration role.