sys_script_client does not seem to be executing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 06:40 PM
Hello, I have 3 client scripts (sys_script_client) with type as 'onLoad' for cmdb_ci-service_now table.
Out of these 3, 1 is not getting executed intermittently meaning sometimes it executes but sometimes it does not.
When I checked console (from Developer Tools in browser), it was evident that 1 client script was NOT getting executed.
Has anyone faced this earlier ? Please let me know in case if there is any resolution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 06:50 PM
Did you try putting in alerts explicitly to validate if onload is working on not.
If still it fails, validate the order has been put correctly, its active or not.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 06:55 PM
Any specific reason to have 3 On-Load client scripts ? Mostly, a single On-Load script serves the purpose.
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 07:08 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 07:17 PM
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.