【问题标题】:Netsuite - Add Button to Custom RecordNetsuite - 将按钮添加到自定义记录
【发布时间】:2017-09-07 17:32:40
【问题描述】:

我正在尝试向 netsuite 中的记录添加一个按钮。这是一个“测试”记录。当用户按下按钮时,我希望创建一个新的测试记录,它将成为现有记录的子记录。

在我的用户事件脚本中,我已将以下代码添加到我的 beforeLoad 函数中

form.addButton({
    id           : 'custpage_add_retest_btn', 
    label        : 'Add Re-Test', 
    clientScriptFileId : 1245,
    functionName : 'createReTestRecord'
    });

该按钮显示在记录上,但是当我按下它时,它说 createReTestRecord 不存在。在我的客户端脚本中,我有一个函数

function createReTestRecord() {
    alert("Hi! from New Test Button!");
}

谁能告诉我怎么回事?

【问题讨论】:

    标签: netsuite suitescript2.0


    【解决方案1】:

    addButton 没有名为clientScriptFileId 的属性。您需要使用 clientScriptModulePath 将客户端脚本附加到表单。

    应该是这样的:

    form.clientScriptModulePath = './YOUR_SCRIPT_FILE';
    
    form.addButton({
        id           : 'custpage_add_retest_btn', 
        label        : 'Add Re-Test', 
        functionName : 'createReTestRecord'
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-29
      • 1970-01-01
      • 1970-01-01
      • 2011-02-25
      • 2015-12-19
      相关资源
      最近更新 更多