hey all, in a user event, does this ```context.for...
# suitescript
m
hey all, in a user event, does this
Copy code
context.form.clientScriptModulePath = 'xxxxx'
replaces other scripts?
m
It appears so. We ran into this last week when trying to convert some 1.0 UE scripts that attached multiple client scripts, to 2.0. Only the last defined client script was available.
m
shoot, so need to be careful about that. possible solution consolidate all functions into front facing script i suppose?
m
Yeah. We're going to be consolidating client-side scripts.
m
u can still import and export them, just have a main one, just so that main one isn't a huge one
💯 1
thanks Mike for the response
m
Do you mean this line stops other scripts from running?
m
Essentially. When you use
context.form.clientScriptModulePath
, or the
id
version, you assigning a value to the `clientScriptModulePath`property. If you use that code again to add an additional client script in the same user event script, you're overwriting the previous value assigned to that property with the new value. Essentially, only the last script mentioned gets loaded in the browser. That's what we found out while migrating scripts from 1.0 to 2.1 last week.
m
Got it, thanks for explaining 🙏