MODULE_DOES_NOT_EXIST SuiteScript
2017-03-22
13738
我在尝试编辑 NetSuite 中的客户记录时遇到了以下问题。我创建的脚本非常简单。
这么简单的一段代码我可能做错了什么?
{"type":"error.SuiteScriptModuleLoaderError","name":"MODULE_DOES_NOT_EXIST","message":"Module does not exist: /SuiteScripts/BillingInfoUpdated.js","stack":[]}
脚本:
define(['N/log'], function (log) {
/**
* User Event 2.0 example showing usage of the Submit events
*
* @NApiVersion 2.x
* @NModuleScope SameAccount
* @NScriptType UserEventScript
* @appliedtorecord customer
*/
var exports = {};
function afterSubmit(scriptContext) {
log.debug({
"title": "After Submit",
"details": "action=" + scriptContext.type
});
}
exports.afterSubmit = afterSubmit;
return exports;
});
3个回答
在脚本文件名末尾添加 .js
Nathan Sutherland
2017-03-23
改用此代码:
var LOGMODULE; //Log module is preloaded, so this is optional
/**
*@NApiVersion 2.x
*@NModuleScope Public
*@NScriptType UserEventScript
*/
define(['N/log'], runUserEvent);
function runUserEvent(log) {
LOGMODULE = log;
var returnObj = {};
returnObj.afterSubmit = afterSubmit;
return returnObj;
}
function afterSubmit(context) {
log.debug('After Submit', "action=" + context.type);
//LOGMODULE.debug('After Submit', "action=" + context.type); //Alternatively
//context.newRecord; //Just showing how to access the records
//context.oldRecord;
//context.type;
return;
}
更多 2.0 快速入门示例: ursuscode.com
Adolfo Garza
2017-03-22