Netsuite - 将按钮添加到自定义记录
Netsuite - Add Button to Custom Record
我正在尝试向 netsuite 中的记录添加按钮。这是一条 "Testing" 记录。当用户按下按钮时,我希望创建一个新的测试记录,该记录将成为现有记录的子项。
在我的用户事件脚本中,我已将以下代码添加到我的 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!");
}
谁能告诉我哪里出了问题?
addButton 没有名为 clientScriptFileId 的 属性。您需要使用 clientScriptModulePath 将客户端脚本附加到表单。
它应该是这样的:
form.clientScriptModulePath = './YOUR_SCRIPT_FILE';
form.addButton({
id : 'custpage_add_retest_btn',
label : 'Add Re-Test',
functionName : 'createReTestRecord'
});
我正在尝试向 netsuite 中的记录添加按钮。这是一条 "Testing" 记录。当用户按下按钮时,我希望创建一个新的测试记录,该记录将成为现有记录的子项。
在我的用户事件脚本中,我已将以下代码添加到我的 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!");
}
谁能告诉我哪里出了问题?
addButton 没有名为 clientScriptFileId 的 属性。您需要使用 clientScriptModulePath 将客户端脚本附加到表单。
它应该是这样的:
form.clientScriptModulePath = './YOUR_SCRIPT_FILE';
form.addButton({
id : 'custpage_add_retest_btn',
label : 'Add Re-Test',
functionName : 'createReTestRecord'
});