Netsuite 对suitelet 2.0中form.addButton的操作
我试图在suitelet 2.0中添加一个自定义按钮,我希望在单击该按钮时执行一个操作 我也试过这样做Netsuite 对suitelet 2.0中form.addButton的操作,netsuite,suitescript,Netsuite,Suitescript,我试图在suitelet 2.0中添加一个自定义按钮,我希望在单击该按钮时执行一个操作 我也试过这样做 form.addButton({ id : 'reset', label : 'Reset', functionName: 'setButton' }); 但它不执行任何操作。您需要在clientscript文件中包含该函数,然后使用以下内容将clientscrip
form.addButton({
id : 'reset',
label : 'Reset',
functionName: 'setButton'
});
但它不执行任何操作。您需要在clientscript文件中包含该函数,然后使用以下内容将clientscript附加到表单:
form.clientScriptFileId=32;
您需要在clientscript文件中包含该函数,然后使用以下内容将clientscript附加到表单:
form.clientScriptFileId=32;
如果您确实在寻找重置按钮,请尝试内置按钮:
form.addResetButton({
label : 'Reset'
});
否则,如果您需要定制
form.addButton({
id : 'reset',
label : 'Reset',
functionName: 'setButton'
});
form.clientScriptModulePath = 'SuiteScripts/setButton-clientscript.js';
使用包含函数定义的setButton clientscript.js
:
define(['N/currentRecord'],
function(currentRecord) {
function setButton() {
//your code here
//example: location.reload();
}
return {
setButton: setButton
};
});
如果您确实在寻找重置按钮,请尝试内置按钮:
form.addResetButton({
label : 'Reset'
});
否则,如果您需要定制
form.addButton({
id : 'reset',
label : 'Reset',
functionName: 'setButton'
});
form.clientScriptModulePath = 'SuiteScripts/setButton-clientscript.js';
使用包含函数定义的setButton clientscript.js
:
define(['N/currentRecord'],
function(currentRecord) {
function setButton() {
//your code here
//example: location.reload();
}
return {
setButton: setButton
};
});