Is it okay to use GlideRecord at client side

MK-p
Tera Contributor

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.

1 ACCEPTED SOLUTION

Runjay Patel
Giga Sage

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

-------------------------------------------------------------------------

View solution in original post

5 REPLIES 5

PrashantLearnIT
Tera Sage

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.