- 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
‎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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2024 05:38 AM
Hi @MK-p
No, using GlideRecord on the client side in ServiceNow is not recommended. Here’s why:
1. Security Risks:
- Using GlideRecord on the client side exposes database structure and data to the end user, which can lead to serious security vulnerabilities.
- A user with malicious intent could manipulate the script to access unauthorized data or perform unwanted actions.
2. Performance Concerns:
- Client-side GlideRecord can lead to multiple database calls from the client browser, significantly impacting system performance, especially in high-traffic scenarios.
3. Best Practices:
- ServiceNow recommends using GlideRecord only on the server side.
- For client-side interactions, ServiceNow provides Client Scripts.
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.
********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect
Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************