Accessing Script Include and Glide System Variables in Mid Server Script Include

Milind
Kilo Contributor

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.

1 ACCEPTED SOLUTION

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


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

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


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

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.


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


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hello ankur,

 

How can we send any value from mid server script include to ServiceNow. Please suggest.

Regards

Shaishav