- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2020 06:43 AM
g_form.setReadOnly() method not working when I run it through Client Script, but it works when I run the same on the JavaScript Executor(Ctrl + Alt + Shift + J), is there a way to debug and know what is stopping my Client Script code to not work on setting the field read only.
The Client Script is:
Solved! Go to Solution.
- Labels:
-
Script Debugger
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2020 07:59 AM
Are there any UI policies that are conflicting with your client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2020 06:44 AM
Can you share your client script so we have a better idea of what your running looks like?
Also when is your client script running?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2020 06:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2020 06:58 AM
I would test all your scratchpad variables and make sure they're holding all the correct/expected data. If they are try this loop in place of fieldsArray.forEach
for (x in fieldsArray){
g_form.setReadOnly(x, true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2020 07:07 AM
Yes, I have double checked that all of the scratchpad variables are holding the correct values. The for... in loop is unsuitable and not suggested to loop over an array as it is best used to enumerate over object properties, when you use for...in it returns the array index(number).