- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2020 11:10 PM
I am calling script include from UI action what will happen if i doesn't pass current object?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2020 11:40 PM
Hi Nick,
it's not necessary to pass the current object since it is the same calling scope.
But it is recommended to pass the current object from the UI action to the script include function considering how objects are treated in javascript.
Refer below link for more explanation
https://snprotips.com/blog/2019/12/18/can-script-includes-use-the-current-variable
Just tested for Form button and it worked well without sending the current object in script include function and was able to print the incident number
Screenshots below
UI Action:
Script Include:
Output: Printing the current inc number
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
‎07-14-2020 01:13 AM
Thanks Ankur
Very well explained
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2020 01:28 AM
You are welcome.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader