Я создаю Scheduled SuiteScript в Netsuite, который использует версию 2.0 API.
Я хочу создать запись, но произошли некоторые ошибки.
Сценарий:
/**
*@NApiVersion 2.x
*@NScriptType ScheduledScript
*@author Sheldor Qu
*@description 此脚本用于每天定时更新采购价格税率维护表
*@version V1.0.0
*/
define(['N/record'], function (record) {
function execute(context) {
try {
var customTaskRecord = record.create({
type: 'customrecord_tp_dev_task',
isDynamic: true,
});
log.debug('new customTaskRecord', customTaskRecord);
} catch (error) {
log.debug('error', error);
}
}
return {
execute: execute
}
});
Сообщение об ошибке:
{
"type": "error.SuiteScriptError",
"name": "SSS_MISSING_REQD_ARGUMENT",
"message": "task.checkStatus: Missing a required argument: options.taskId",
"stack": [
"createError(N/error)",
"execute(/SuiteScripts/Scheduled Script/TP_SS_PurchasePriceUpdDaily.js:12)"
],
"cause": {
"type": "internal error",
"code": "SSS_MISSING_REQD_ARGUMENT",
"details": "task.checkStatus: Missing a required argument: options.taskId",
"userEvent": null,
"stackTrace": [
"createError(N/error)",
"execute(/SuiteScripts/Scheduled Script/TP_SS_PurchasePriceUpdDaily.js:12)"
],
"notifyOff": false
},
"id": "",
"notifyOff": false,
"userFacing": false
}
Не знаю почему, пожалуйста, помогите мне.