I'm currently working on incorporating a new menu option into the "Actions" menu within a custom transaction form in NetSuite. While I can successfully see my selection in the Actions Menu on the form, I'm running into an issue with triggering the beforeLoad function in my UserEvent Script to call a clientScript when the Action is chosen.
Upon running the code as it stands, I receive a message stating that "beforeLoad" is not defined, despite returning the function at the end of my script. Additionally, I'm finding it challenging to include an action in the 'Standard Actions Tab', even though other actions seem to reside there.
Any assistance you can provide would be greatly appreciated! :)
https://i.sstatic.net/WIGSr.png
* @NApiVersion 2.x
* @NScriptType UserEventScript
*/
define([],
function () {
function beforeLoad(context) {
if(context.type == 'edit'){
context.form.clientScriptModulePath = 'folder/clientscriptpath.js';
}
}
return {
beforeLoad: beforeLoad
};
}
);