Not applicable

Hi @kedar_sirshikar ,

 

Put the alert or addInfoMessage to see which is not executed. 

Do your scripts run on cmdb_ci table, if yes then please tick Inherited checkbox to apply to extended tables.

Maddysunil
Kilo Sage

@kedar_sirshikar 

Few things to check:

 

1. Confirm the execution order of your client scripts. In some cases, the order in which client scripts are executed might impact their behavior. Ensure that the desired script is not being overridden or skipped due to the execution order.

 

2. Review the logic in the client script that is not consistently executing. Ensure there are no conditions or errors that might cause it to skip execution.

 

3. Clear the browser cache and try again. Cached scripts might not be updated, leading to inconsistent behavior.

 

4. If your client script relies on script includes, ensure that the script includes are being loaded correctly and are available at the time of execution.

 

5. Review the ServiceNow instance logs for any errors or warnings related to client script execution. This can be found in the "System Logs" module.

 

Kindly mark helpful/accepted if it helps you.

Clear the browser cache is helping most of the times.

kedar_sirshikar
ServiceNow Employee

Thank you all for helpful comments/suggestions.

 

As there were hints related to 'order', I found that none of the sys_script_clients is given any order. Can that cause this issue ? Is it a standard practice to specify the 'order' to avoid such anomalies ?

 

I am inclined that this may be a problem with 'order' because my minimum expectation is 'onLoad sys_script_client' should at least be seen in console log of Developer Tools. "sys_script_client not working as expected because of any error" is a second part but at first I believe it should be executed onLoad of the page.

 

Also, there were few suggestions to add alert/log but unfortunately this issue is seen only in production so I am restricted from adding alert/log. Existing logs are also limited prohibiting root cause analysis.

 

@kedar_sirshikar 

You order is important to avoid anomalies. Please specify the order in the client scripts.

Kindly mark helpful/accepted if it helps you.

Thanks