MODULE_DOES_NOT_EXIST SuiteScript

问题描述 投票:4回答:3

我在尝试编辑NetSuite中的CUSTOMER记录时遇到了以下问题。我创建的脚本非常简单。

如果用这么简单的代码,我怎么可能做错呢?

{"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;
});
netsuite suitescript
3个回答
13
投票

将.js添加到脚本文件名的末尾


0
投票

请改用:

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


0
投票

Nathan Sutherland的回答对我有用,而且它绝对没问题但是我正在写这个答案,所以新用户可以更快地获得,而不是与其他名字混淆。您需要在蓝色箭头指向的位置添加.js

在创建脚本时启动。 here

如果你忘了那么在这里编辑

© www.soinside.com 2019 - 2024. All rights reserved.