Background script debugging
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2025 06:59 PM
How to enable the script execution history in scripts - background to print stuff like the sql statements from the execution? Or have I just dreamed that this functionality exists?
e.g.
var query = new GlideRecord('incident')
query.query()would print something like this, maybe even more details like command counts etc.
[SELECT ... FROM ... WHERE ...]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2025 07:10 PM - edited 08-25-2025 07:16 PM
Check if you are looking for below information,
If this helped to answer your query, please mark it helpful & accept the solution.
Thanks,
Bhuvan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2025 07:16 PM
Hello @lauri457
This is not possible in background script.
Hope this helps!
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2025 08:59 PM
No you cannot.
To check what sql statements were executed you can try to check in transactions table
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago - last edited Wednesday
This is the log I was looking for but not sure what triggers it. However it does not provide the information I was looking for
Edit: you can print out the queries by setting gs.trace(true) for your session
