- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2016 08:06 PM
Hi Team,
Can anyone explain the difference between glide ajax call and getReference() call in client script, can you give some examples when should we use. Which is the best to use from performance view.
thanks ctomasiITSM: GeneralIT Service ManagementDeveloper CommunityServiceNow Community
Solved! Go to Solution.
- Labels:
-
Service Mapping

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2016 10:40 PM
GlideAjax - returns only the data you specify, does not block the browser when using .getXML()
getReference - returns all fields on the record, does not block the browser when using callback function.
GlideAjax will always give the best performance, but is significantly more complex to code.
You should use GlideAjax if your code is intended for production.
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2016 08:22 PM
Hi Abhai,
GlideAjax: The GlideAjax allows you to trigger server-side code from the client side. the main benefit of GlideAjax that you can easily calls pass parameters to the script includes and using naming conventions, allows the use of these parameters.
getRefference: The getReference() method of g_form supports a callback function as well, and the usage is almost the same! The only difference is that getReference accepts two arguments (the first being the field name as a string, and the second being a reference to your callback function)
For more info check this link :SN Pro Tips — GlideRecord & GlideAjax: Client-Side Vs. Server-Side
Thanks,
Farukh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2016 09:00 PM
Hi Abhay,
GlideAjax() is server side call and getReference() is client side call.
Below thread may help you to understand more.
Replace g_form.getReference with GlideAjax?
Thanks
Pradeep D J
PS - Please mark Helpful, Like, or Correct Answer if applicable.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2016 09:08 PM
Hi Abhay,
Please check the below thread.
GlideAjax: GlideAJAX API
getReference(): it's glideform (g_form) class method. this function will only run on client side.
g_form.getReference() are also available for retrieving server information. no longer recommended due to their performance impact.
If you have requirement to retrieve some information from server then always use glideAjax.
Please find the below example link.
Thanks,
Harshvardhan
PS: Hit like, Helpful or Correct depending on the impact of the response

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2016 10:40 PM
GlideAjax - returns only the data you specify, does not block the browser when using .getXML()
getReference - returns all fields on the record, does not block the browser when using callback function.
GlideAjax will always give the best performance, but is significantly more complex to code.
You should use GlideAjax if your code is intended for production.
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022