- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2017 04:15 AM
Hi,
I am writing a Mid Server Script Include class, and I am trying to access a class from Script Include (System Definitions => Script Include) from it, but is is giving me an error. Similarly I cannot access the Glide System variable in the Mid Server Script Include. I can access Glide Record,Glide Aggregate classes in there, but is there any way to access these classes in the Mid server script Include?
Thank you.
--
Regards,
Milind Wakale.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2017 04:56 AM
Hi Milind,
When you are calling this mid server script include send a parameter and get that value in mid server script include.
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
‎05-23-2017 04:26 AM
Hi Milind,
Mid Server Script Include doesn't support ServiceNow classes such as GlideRecord etc. It runs native javascript functions and java code.
If you want to send any value from ServiceNow to mid server script include you can send those in parameters.
Following links should be helpful to you:
JavascriptProbe and MID Server Script Includes | John Andersen
http://wiki.servicenow.com/index.php?title=MID_Server_Script_Includes_Reference#gsc.tab=0
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
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
‎05-23-2017 04:53 AM
Hi Ankur,
Thanks for quick response. Indeed I referred John Anderson's blog for writing this script include. In my script, I am able to access Glide Record class. I have need to access the session id of current user in order to execute some scripts, which is I am not able to access by writing gs.getSessionId() function. Is there any way so that I can access the session id of currently logged in user.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2017 04:56 AM
Hi Milind,
When you are calling this mid server script include send a parameter and get that value in mid server script include.
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
‎03-19-2018 05:31 AM
Hello ankur,
How can we send any value from mid server script include to ServiceNow. Please suggest.
Regards
Shaishav