- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2022 05:20 AM
Hello, ServiceNow Gurus,
Say I have a Business Rule, and that Business Rule calls into a Script Include, and that Script Include writes a message to the System Log...
Is it possible for the script include to figure out, at runtime, its own sys_id? And include that in the log statement?
I know that I can manually log the sys_id by writing my own log function and passing in the "hard-coded" sys_id, but that's not what I want. I want for the script itself to magically determine the sys_id of the container it lives in. Is that possible? And if so, how please?
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2022 05:25 AM
Hi,
no you cannot get the sysId of the BR automatically and log it.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2022 05:25 AM
Hi,
no you cannot get the sysId of the BR automatically and log it.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2022 06:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2022 06:46 AM
Hi,
Because ServiceNow doesn't provide any OOB object which can access the current BR sysId during it's execution.
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2022 05:06 AM
I believe you, but I wonder how you know this.