「標準の編集ボタン」ではなく、カスタムボタンをクリックしてレコードの編集ページを表示したい
私のコード:
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
前もって感謝します