Getting error "script error encountered when changing this field in servicenow" for some users with specific role(readOnly)

Chinmayee1
Giga Contributor

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

8 REPLIES 8

Kieran Anson
Kilo Patron

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?

Unfortunately cannot share the code. However This is how it it Function onChange(parameters){ if(isLoading || newValue="") // added || (g_user.hasRoleExactly(table_am_hw_read)==false))// { // body } } }

Hi,

please check the updated script

You missed the quotes for the roles

g_user.hasRoleExactly('table_am_hw_read') == false)

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

same issue.