- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2024 05:16 AM
Hi Expert,
I know we can use GlideRecord we can use in client side but i want to know what the harm is using it in client side.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2024 05:23 AM - edited ‎12-17-2024 05:23 AM
Hi @MK-p ,
ServiceNow allow to do but it is not recommended with below reason.
- performance risks, security concerns, and bad design practices.
- GlideRecord on the server-side enforces security rules (ACLs), but on the client side, it will be bypassed.
- Client-side GlideRecord ultimately make synchronous or asynchronous calls to the server side, which can cause performance issue.
- Its poor designing process, we have alternative for this using GlideAjax.
- GlideRecord on the client side can make multiple queries to the database directly, which:
- Puts extra load on the server.
- Slows down performance as the number of users increases.
- GlideAjax is the best choice when ever you wanna perform any CRUD operations.
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2024 05:23 AM - edited ‎12-17-2024 05:23 AM
Hi @MK-p ,
ServiceNow allow to do but it is not recommended with below reason.
- performance risks, security concerns, and bad design practices.
- GlideRecord on the server-side enforces security rules (ACLs), but on the client side, it will be bypassed.
- Client-side GlideRecord ultimately make synchronous or asynchronous calls to the server side, which can cause performance issue.
- Its poor designing process, we have alternative for this using GlideAjax.
- GlideRecord on the client side can make multiple queries to the database directly, which:
- Puts extra load on the server.
- Slows down performance as the number of users increases.
- GlideAjax is the best choice when ever you wanna perform any CRUD operations.
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2024 05:23 AM - edited ‎12-17-2024 05:24 AM
Use my GALACTIC SCALE metaphor.
Your user is sitting on a computer on earth. The ServiceNow Server is 2 lightyears away across the galaxy. So whatever they need something done on the server, its a 4 YEAR wait. 2 years to travel to the server and 2 years for results to come back. During that 4 year time span the user can do NOTHING, because the client is waiting for the server.
Our reality is only different in scale, but still noticeable. If the client script must ask the server for something you have to send AND wait. During that wait NOTHING else can happen. So its not just the vague idea of performance issues... but your customer is stuck there. "Why is this thing loading for so long?"
This is why people use things like GlideAjax, because its asynchronous.
In layman's terms that means "I don't care when the server responds" and eliminates our "4 year wait".
Don't use gliderecord (or any other server side script) in your client side logic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago - last edited 2 weeks ago
This is a common myth. Client side GlideRecord can be used asynchronously, and uses GlideAjax to communicate with the server. You can also control which columns to return to limit the payload sizes. Client side GlideRecord also honors ACLs, so there are a lot of false information being banded about in this thread. The main issue is that the GlideRecord implementation in the Core UI is completely different to the implementation in the Service Portal UI. But this is also the case for GlideAjax, so tomayto-tomarto.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2024 05:29 AM
Hello @MK-p ,
Using GlideRecord in a client script is not recommended as it impacts performance and leads to a poor user experience.
GlideRecord is a server-side API. If you need to retrieve or validate data from the server, use the GlideAjax API instead.
Please mark this as "correct" and "helpful" if you feel this answer helped you in anyway.
Thanks and Regards,
Ashish
