Yvonne
12/15/2022, 2:41 AM/**
* @NApiVersion 2.x
* @NScriptType UserEventScript
* @appliedtorecord salesorder
*/
define([], function() {
function beforeLoad(context) {
log.debug({
title: 'Context Type',
details: context.type
});
var button = context.form.addButton({
id: 'someButtonID',
label: 'A Button',
functionName: 'onButtonClick'
});
context.form.clientScriptModulePath = 'SuiteScripts/someJsFile.js';
button.isHidden = context.type != context.UserEventType.VIEW;
button.isDisabled = context.type != context.UserEventType.VIEW;
log.debug({
title: 'Button',
details: button
});
}
return {
beforeLoad: beforeLoad
};
});
ehcanadian
12/15/2022, 3:08 AMcontext.type != context.UserEventType.VIEW
if(context.type != context.UserEventType.VIEW) return;
Yvonne
12/15/2022, 3:35 AMYvonne
12/15/2022, 3:41 AMif(context.type != context.UserEventType.VIEW) return;
Yvonne
12/15/2022, 3:43 AMYvonne
12/15/2022, 3:47 AMYvonne
12/15/2022, 3:50 AMYvonne
12/15/2022, 3:56 AMehcanadian
12/15/2022, 3:59 AMcustpage
and be all lover case as well. Is what you posted the full script?Yvonne
12/15/2022, 4:01 AMehcanadian
12/15/2022, 4:06 AMYvonne
12/15/2022, 4:11 AMYvonne
12/15/2022, 4:43 AMNElliott
12/15/2022, 12:52 PM