Debugging Script Include Client Side
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2019 12:42 PM
I want to walk through a script include and see how's its working to fix an issue.
So using a debugger statement in your client-side javascript code you can set breakpoints and using your browser's developer tools walk through and troubleshoot your code. For server-side scripts, you can set breakpoints and use the script utility tool in servicenow (as long as you have the necessary role) to again walk through your code and troubleshoot. Now if I have , for instance, I have UI page that makes an ajax call to a script include, which therefore would need the client caller enabled/checked on the script include. The SN scripting tool doesn't work here it appears. The developer tools in the browser don't work against this client callable code on the script include. So is there no way to set checkpoints and walk through the client callable code in the script included with either of these two tools or am I missing something?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2019 04:17 AM
I had the same issue. I wanted to debug a script include that was initiated via an ajax call. Debugger does not work for this. My only option was to put lots of gs.info messages into the script and debug using those.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2020 09:29 AM
Check this below link will help you
https://docs.servicenow.com/bundle/orlando-application-development/page/script/debugging/concept/script-debugger.html
https://docs.servicenow.com/bundle/madrid-application-development/page/script/debugging/concept/script-debugger.html