What happens when you exceed the 10 client scripts...
# suitescript
e
What happens when you exceed the 10 client scripts in a given record/transaction?
n
I think only the first 10 are executed. After that the others don’t run
☝🏻 1
☝️ 3
e
So the entry point is not taken into account? Let's say if a client script only has
pageInit
but is the 15th script And another script only has
saveRecord
but is the 1st script Even then, the 15th is not expected to run?
n
That sounds right. Because a client script is loaded in its entirety when the form loads. So its almost more like a limit to the number of client scripts that can be attached to a form. tbh i'm not 100% sure though.
s
more than 10 scripts could lead to total protonic reversal
😂 3
a
you can somewhat work around this limit by using form specific client scripts - you get I think 10 at the form level and 10 at the record level?
👀 1
the real workaround is merging the scripts but .. .ugh
a
NS explodes
m
I ran into this on a client that had gone through many developers. My solutions was to create a unified script loader that was the client script that's loaded to a single record type. Then I modified several of the client scripts to become custom modules that were loaded based on the entry points they used.The best solution would have been to do a full review and consolidate code, but the client didn't want to pay for it.
a
Recommendation: • Create a client script with all entry points. • Write a console log on each entry point. • Deploy it to a transaction. • Edit the transaction. • Open the Dev Tools. • Do any operation on the transaction. • See how many things happen in your console. Goal/Objective: • Hate Client Scripts and start avoiding them as the plague…
n
I'm 100% in that camp, "Hate Client Scripts and start avoiding them as the plague…" Anytime I can avoid writing a client script I do so, complete pain in the proverbial 🤣 "Are you sure you want it real-time? I can do this more efficiently in a UE script..." (sublist operations, I'm good thanks chief)
🫡 1