How to debug with breakpoints using script include debugger

Lan
ServiceNow Employee
ServiceNow Employee

Hello everyone,

I'm trying to use the built-in debugger for script include. I'm invoking the script include API outside of the platform. The API gets invoked, but the program just went through and never stopped at any breakpoint. Is this the right way to use the debugger, or it only works when invoking from within the platform, for example, via script background or business rules etc?

Thanks!

4 REPLIES 4

Mark Roethof
Tera Patron
Tera Patron

Hi there,

The JavaScript Debugger is the primary strategy for debugging Business Rules and other synchronous server-side scripts that runs in an interactive transaction.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Pranesh072
Mega Sage
Mega Sage

The Script Debugger can pause any server-side script that runs in an interactive transaction such as business rules, script includes, script actions, or UI actions that require a response to proceed. If the GlideSystem method isInteractive() returns True when running the script in context, then the Script Debugger can pause it.

Note: Some script objects, such as script includes, can be called from multiple contexts. For example:
  • when a business rule runs a script include on a form submit that is an interactive transaction waiting on the form data to change before continuing.
  • when a scheduled job runs the same script include that is a non-interactive background transaction that can also run other scripts simultaneously.

Maybe this will help you

https://docs.servicenow.com/bundle/paris-application-development/page/script/debugging/concept/scrip...

Lan
ServiceNow Employee
ServiceNow Employee

Any suggestion on the tools to debug/trace script include invoked in non-interactive mode?

you can always use gs.log or gs.info to debug server scripts