Script Includes: provide use case to understand !!

ZebaT
Giga Contributor

Hi all,

I'm trying to understand difference between script include and client ajax. Script include is for server side calling of same script and glideajax is similiar to script include but used to call this script on client scripts. Is my understanding correct?

Can you provide one or two use real  case for each which can help clear my confusion.

RThanks

2 REPLIES 2

Hemanth M1
Giga Sage
Giga Sage

Hi @ZebaT ,

 

Simply put : GlideAjax is a client side API that allows client scripts (running in the browser) to make calls to server side Script Includes(piece of the logic which run on the Service side)

 

You can refer below threads for some practical use cases,

 

https://intelibliss.com/servicenow-client-script-and-glideajax/ 

 

https://www.servicenow.com/docs/bundle/yokohama-application-development/page/script/server-

 

scripting/concept/c_ScriptIncludes.html 

 

https://www.servicenow.com/community/developer-forum/what-is-glide-ajax-syntax/m-p/2009485 

 

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

Mohammed8
Giga Sage

Hi @ZebaT 

I don't have real use case / live project use case to cite but i can share use case for Glide Ajax which I tried out in PDI.

 

Use Case: Incident Count of Selected Configuration Item with Info Message and Link to its Related Incident. Displays a message showing the count of open incidents associated with a selected Configuration Item (CI) whenever the Configuration Item field changes on the Incident form. Glide Ajax used as it calls the script from client side when interacting with incident form.

 

  • Helps quickly identify whether the selected CI has existing incident by fetching and displaying active incident counts (excluding Resolved, Closed, and Canceled states).

  • Shows an info message with a clickable link that opens a filtered list of related incidents for that CI

  • If more than five incidents are linked, a warning message appears suggesting Problem investigation for frequent or repeated CI issues.

  • Uses an onChange Client Script on the Configuration Item field and a GlideAjax Script Include called from the client script to fetch the incident count

Mohammed8_4-1766682718951.png

 

Mohammed8_5-1766682737850.png

 

Similarly a Script Includes is reusable server-side code which the server side and can be called by Business Rules , job schedules etc..

 

Here is link for blog for your better understanding:

https://www.servicenow.com/community/developer-advocate-blog/client-callable-and-server-callable-scr...

If you find this useful please mark it as helpful/solution accepted

 

Thanks and Regards,

Mohammed Zakir