Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
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}