Can I use `context.form.clientScriptModulePath` in...
# suitescript
b
Can I use
context.form.clientScriptModulePath
in a user event script beforeLoad to add a client script to a record that can use client script entry points like fieldChanged? I'd prefer not to have to create a new client script record and deployments if I don't have to. I'd like to only apply the client script based on logic in my user event.
c
if you set this value, it will use any of the entry points automagically...its like a stealth client script
easy to test too just add an event handler and log something out
b
Well, I did try it, but fieldChanged did not trigger, so I’m wondering if either I’m doing it wrong or it’s not a feature.
b
no
thats for suitelets
clientScriptModulePath
is normally used with buttons for user event scripts
b
Great, thanks for confirming
c
ah yeah suitelet not user event thats my bad
reading is hard
b
No worries
c
Its not exactly what you want, but you may be able to do form level client scripts and switch the form
t
You can use it on both I think?
message has been deleted
Yeah I use it in both
b
@The Usual Suspect I think you may be misunderstanding what I was asking
t
probably
I do have the client script in that UE running entry point functions as well like lineinit
b
How?
t
let me make sure I don't have it defined as a script first
yeah okay I'm wrong. I have it as a client script
You could attach client scripts on the form level if you want some conditional script logic but idk, not really a good solution I don't think