DEBUGGER IN SERVICE NOW

naresh1019
Mega Expert

Hello Guys,

Do we have proper debugging Methods to test ClientSide/Server Side SCripts.

Basically I am from JAVA background, there we have a good IDE where we can get all the information, So I would like to know do

we have any such feature for debugging scripts in service Now.

5 REPLIES 5

Rajesh Mushke
Mega Sage
Mega Sage

Hello



Script debugger


The Script Debugger allows application developers to debug server-side JavaScript.


The Script Debugger allows each application developer to:
  • Have a dedicated debug transaction, which only applies to the current session.
  • Set and remove breakpoints.
  • Pause the current session at a breakpoint.
  • Step through code line-by-line.
  • Step into and out of function and method calls.
  • View the value of local and global variables.
  • View the value of private variables from function closures.
  • View the call stack.
  • View the transaction the system is processing.
  • Turn off the script debugger to resume running paused scripts.
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 in order to proceed. If the GlideSystem method isInteractive() would return 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. When a business rule runs a script include on 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.


To debug client-side script, you can use browser-based developers tools.

Note: For information about using Chrome to debug client-side scripts, see the blog post Using Chrome to Debug Client Side Errors by a ServiceNow Technical Support Engineer in the ServiceNow Community.


Only users with the script_debugger role can access the Script Debugger.A debugger transaction remains open as long as the user session is valid. If a user session logs out or times out, the system closes the debugger transaction.


Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke

Inactive_Us1474
Giga Guru

Rajesh Mushke
Mega Sage
Mega Sage

Hello Naresh,



If my understanding is correct, you are looking for how to debug ACLs, Business Rules, Script include And Client Scripts so please Refer below Urls might be helpful......



for ACLs Debugging Procedure :


https://docs.servicenow.com/bundle/jakarta-servicenow-platform/page/administer/contextual-security/c...



for Business Rules Debugging Procedure :


Debugging Business Rules



for Client Scripts debugging Procedure :


JavaScript Debug Window - ServiceNow Wiki


https://docs.servicenow.com/bundle/istanbul-servicenow-platform/page/script/debugging/concept/c_Java...


Debugging Tools Best Practices - ServiceNow Wiki



for Script Include debugging Procedure :


JavaScript Debugger - ServiceNow Wiki


Debugging Tools Best Practices - ServiceNow Wiki




Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke

vab_13
ServiceNow Employee
ServiceNow Employee

A really nice article, might help in your case:

 

Using Chrome to Debug Client Side Errors