我想通过单击自定义按钮而不是“标准编辑按钮”来显示记录的编辑页面
我的代码:
Script Version: Suite Script 2.0
User Event Script:
function beforeLoad(context) {
log.debug('Test', 'Before Load Event Initiated');
var frm = context.form;
frm.clientScriptFileId = 2250;
//Values from System/ScriptContext
var record = context.newRecord;
if (context.type == context.UserEventType.VIEW) {
frm.addButton({
id: 'custpage_cust_edit_btn',
label: 'Deactivate Record',
functionName: 'customRecordEditMode(' + record.id + ')'
});
}
}
Client Script:
function customRecordEditMode(recordID) {
debugger;
try {
window.location.href = "https://system.sandbox.netsuite.com/app/common/custom/custrecordentry.nl?rectype=194&id=" + recordID + "&e=T";
} catch (exception) {
alert("Error:", exception.message);
}
}
错误信息:
我收到以下错误消息:
但记录的 url 与我们单击标准的“编辑”按钮时相同。(i,e) rectype=194&id=237&e=T
提前致谢