GlideRecord or GlideAjax?

Ravish Shetty
Tera Guru

In my previous organization where I started with ServiceNow we were advised to use GlideAjax in async mode on client side scripts instead of GlideRecord. GlideRecords too can work in async mode. So was this advise incorrect?

1 ACCEPTED SOLUTION

Depends what you are trying to achieve really.



aysnc client side gliderecord is is identical as far as I can tell as an async glideajax call (performance wise aswell ) as they both send the request and await the response with a callback function.



HOwever be careful with your queries, client side glide records adhere to ACLs whereas server side ACLs do not. So if the information is secure away from the user via an ACL, you'll need to use a glideajax call.


View solution in original post

17 REPLIES 17

Jim Coyne
Kilo Patron

To my knowledge, GlideRecords themselves do not work in async mode, but Business Rules incorporating the use of GlideRecords can run in async mode.



Using GlideAjax instead of GlideRecords directly in client side scripts is still the better way to go - Client Script Best Practices - ServiceNow Wiki


Hi Jim,



I think that ravio is talking about the newer client side GlideRecord.     It provides a wrapper that calls out to the server, executes a query and returns the result to the client asynchronously.



Trey Carroll


Right, the client-side GlideRecord is a limited version of the server-side one.   But it's not really new, and it actually performs the queries "synchronously".   That's why GlideRecords on the client side are frowned upon.


Hi Jim,



This maybe new i guess but as Trey suggested, GlideRecord on client side can be used to perform asynchronous query.



Regards,


Ravish



(Image courtesy: snc-blog.com)


cs-3-nggid03298-ngg0dyn-0x0x100-00f0w011c010r110f110r010t010.png