If we use clientScriptModulePath in beforeLoad eve...
# suitescript
b
If we use clientScriptModulePath in beforeLoad event in UE script, does that script works in Edit mode?
e
Yes, so long as your UE sets
clientScriptModulePath
during an EDIT event. Regular Client Scripts always run in EDIT mode as well
b
Strange. I added a button in beforeLoad event and that button works. But normal client script entry points like pageInit, fieldChanged didn't work
e
Hard to help further without seeing the code, but AFAIK, all the Client Script events should still fire when attaching via this method.
b
Actually that's what I know but somehow it doesn't work. Thank you
e
Only suggestion is to double check the module's
return
statement and make sure the entry point handlers are all mapped.
b
Thank you
n
Other entry points won't work. You will need a deployed client script for those entry points to work.
b
the clientScriptModulePath doesnt actually act as a client script in user event scripts, you dont get access to the entry points of client scripts
its supposed to be used for button functions
or if you just want to run arbitrary code after the script is loaded
clientScriptModulePath works as a normal client script with entry points in a suitelet
e
What an important piece of documentation they're missing
b
In SL, I have added a button in inline html field but that does not trigger function in client script. How can I trigger it? It shows me function is not defined.
n
You don't need to add the button in inline html field. Use the form.addButton()