Any ideas on how to troubleshoot my client script?...
# suitescript
m
Any ideas on how to troubleshoot my client script? It appears it’s not running at all since it doesn’t even hit a console.log on pageInit. This is what I’ve checked: • Deployed to all roles in Audience • Status is Released • it is the 10th deployed script on the record type
e
Could you share your script? You can/should remove any sensitive information- but it's easier to help if you share it
m
m
Verify your script is being sent to the browser using the Chrome dev tools. On the Sources tab, look under app > common/scripting (for 2.x scripts) to see if your script is shown there.
s
Maybe you have 10 on the record but also one on the form? Not sure if makes your 10th record level one obsolete
e
Unlikely the issue, but can you confirm you're editing or creating a record? Client Scripts don't run on VIEW, so if you're just viewing a record, this script won't be triggered
m
Yep, this is on record create
e
Did you create a script record for your client script?
m
yes, deployed to the vendor bill
@Mike Robbins, it looks like the script is not being sent to the browser
I do see 10 other scripts being loaded though
undeploying a client script from the record type did it. Thanks all!
e
Wait- can someone confirm that this means NetSuite actually limits the number of Client Scripts that run on a record?
s
Yes, the helpa pages indicate 10 is the limit
e
Good to know- I thought they always said "try to keep it to 10 or less", I didn't know it was a hard cutoff
That actually makes me hate that our Credit Card processor has 4 clients scripts running on our Sales Orders......
s
SDN strongly frowns upon that so I am surprised they got approval with that
m
Yeah, it’s weird I only saw 9 client scripts deployed to the record type, but when I checked dev console I saw some helpers being sent to the browser
So I assume that if it’s referencing helper JS files those count toward your 10 limit
m
Not sure if helper scripts count towards that. And I wasn't aware that the limit was 10. I was working with a client in the past and ran into the same problem and made the assumption that there was a hard limit. So what I ended up doing was creating a script loader for the record type and loading other scripts as modules.