Debugging Script Includes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2023 06:22 AM
I am trying to debug a script includes being called by an artifact configuration.
I have inserted a "gs.log" statement at the very beginning of the script includes.
I have inserted a second "gs.log" statement at the very beginning of the first function in the script includes.
The first log statement is running, but the second log statement is not.
What would cause a script includes to run but the first function NOT to run?
How do I troubleshoot such a situation?
Thanks for your assistance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2023 07:16 AM
are you sure you can call script include from that place?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2023 07:17 AM
Like I said, the script includes is running, because the first log statement is being generated. So, the artifact configuration is calling the script includes. That part works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2023 08:27 AM
Hi @machiavvelli, I believe you are missing "new" keyword while calling the script include.
Try calling like as below, it should work. It did print both logs for me.
new LF_PortalProcessor().getTranslatableContent(params);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2023 09:27 AM - edited ‎05-24-2023 09:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2023 08:59 AM
Word documents are not helpful. use the "</>" icon here to paste text.