Damree Ilyaad
11/19/2019, 7:16 AM/**
*@NApiVersion 2.x
*@NScriptType UserEventScript
*/
define([],
function() {
function _beforeLoad(context){
if(context.type === context.UserEventType.VIEW){
var form = context.form;
form.clientScriptFileId = 2514; //line responsible for error
form.addButton({
id: 'custpage_modifyStatus',
label: 'Identify',
functionName: 'customFunc'
});
}
}
return {
beforeLoad :_beforeLoad
};
});
ClientScript:
/**
* @NApiVersion 2.x
* @NScriptType ClientScript
*/
define([],
function() {
function pageInit(context) {}
function customFunc(){
alert("hey hey");
}
return {
pageInit: pageInit,
customFunc: customFunc
};
});
Error:
_,"cause":{"message":"missing ; before statement","fileName":"","lineNumber":1,"name":"InternalError","stack":"\tat /SuiteScripts/BW_userEvent_AddStatusButton.js:15 (_beforeLoad)\n\tat INVOCATION_WRAPPER$sys:26\n\tat INVOCATION_WRAPPER$sys:17\n\tat INVOCATION_WRAPPER$sys:34\n\tat INVOCATION_WRAPPER$sys:1\n","rhinoException":"org.mozilla.javascript.EvaluatorException: missing ; before statement"},"notifyOff":false,"userFacing":true}_
What am i doing wrong ? help please !Alex Hirota
11/19/2019, 7:25 AMform.clientScriptModulePath = "RELATIVE_PATH_TO_CLIENT_SCRIPT"; instead of client script file id.Damree Ilyaad
11/19/2019, 7:29 AMAlex Hirota
11/19/2019, 7:29 AM