NS Expert
04/11/2022, 6:26 PMvar scriptTask = task.create({
  taskType: task.TaskType.SCHEDULED_SCRIPT,
  scriptId: 'customscript_xxx',
  deploymentId: 'customdeploy_xxx',
  params: {...}
});
var scriptTaskId = scriptTask.submit();
And it shows this error message:
{
  "type": "error.SuiteScriptError",
  "name": "INSUFFICIENT_PERMISSION",
  "message": "You do not have permission to perform this operation.",
  "stack": [
    "submit(N/task)",
    "afterSubmit(/SuiteScripts/UE_Soft_Credit.js:75)"
  ],
  "cause": {
    "type": "internal error",
    "code": "INSUFFICIENT_PERMISSION",
    "details": "You do not have permission to perform this operation.",
    "userEvent": "aftersubmit",
    "stackTrace": [
      "submit(N/task)",
      "afterSubmit(/SuiteScripts/UE_Soft_Credit.js:75)"
    ],
    "notifyOff": false
  },
  "id": "",
  "notifyOff": false,
  "userFacing": false
}
What is the reason? Does it need administrator permission to submit task inside SuiteScript?battk
04/11/2022, 6:33 PMNS Expert
04/11/2022, 6:40 PMtech_ph2019
04/11/2022, 7:06 PMNS Expert
04/11/2022, 7:13 PM