Discussions
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
Why is there an error on creating task type record in an unerevent script(aftersubmit).
const newTask = record.create({
type: record.Type.TASK,
defaultValues: {
title: taskName,//String
company: entityId, //entity's internal id
transaction: salesOrderId, //transaction's internal id
},
});
newTask.save();
I got the following error but why this is happening?
{"type":"error.SuiteScriptError","name":"INVALID_RCRD_INITIALIZE","message":"You have entered an invalid default value for this record initialize operation.","stack":["Error\n at suitescript/resources/javascript/record/recordImpl.js:40:12\n at Function.createRecord_raw (suitescript/resources/javascript/record/recordImpl.js:38:24)\n at suitescript/resources/javascript/record/recordImpl.js:26:29\n at Object.createRecord (suitescript/resources/javascript/record/recordImpl.js:24:24)\n at /SuiteScripts/tamura/auto_task_creation.js:52:32\n at Array.forEach (native)\n at Object.afterSubmit (/SuiteScripts/tamura/auto_task_creation.js:40:24)"],"cause":{"type":"internal error","code":"INVALID_RCRD_INITIALIZE","details":"You have entered an invalid default value for this record initialize operation.","userEvent":null,"stackTrace":["Error\n at suitescript/resources/javascript/record/recordImpl.js:40:12\n at Function.createRecord_raw (suitescript/resources/javascript/record/recordImpl.js:38:24)\n at suitescript/resources/javascript/record/recordImpl.js:26:29\n at Object.createRecord (suitescript/resources/javascript/record/recordImpl.js:24:24)\n at /SuiteScripts/tamura/auto_task_creation.js:52:32\n at Array.forEach (native)\n at Object.afterSubmit (/SuiteScripts/tamura/auto_task_creation.js:40:24)"],"notifyOff":false},"id":"","notifyOff":false,"userFacing":true}