Discussions
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Join us
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}