Getting error "script error encountered when changing this field in servicenow" for some users with specific role(readOnly)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2020 12:28 AM
Hi ,
We have created a new role for alm_hardware table as 'table_alm_hw_read' and added that role to some users.
When users with that role , opens any record from that table , It shows below error for install_status field. In the table we "Script error encountered when changing this field in servicenow.Please contact your system Administrator"
Few more info :
1) there is no onload script as Active true
2) there is only 1 onChange script where we have added the role validation : No luck (Its not even relevant in this case).
3)We don't have any display BR
4) Global on the client script is marked to 'True'.
5)There is nothing in self service for this table.
What might be the possible cause and how to fix this issue ? Please advise.
Thanks & Regards,
Chinmayee Mishra

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2020 01:33 AM
Hi,
This is indicative of a client script running that is throwing a script error. Are any of your client scripts on alm_hardware or alm_asset running against this field? If so, can you share the code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2020 01:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2020 02:11 AM
Hi,
please check the updated script
You missed the quotes for the roles
g_user.hasRoleExactly('table_am_hw_read') == false)
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2020 02:40 AM
same issue.