ServiceNow Scripting | difference between GlideRecord vs GlideRecordSecure | Scripting Extras

Поділитися
Вставка
  • Опубліковано 15 вер 2024
  • Let’s explore the differences between GlideRecord and GlideRecordSecure in ServiceNow:
    GlideRecord:
    Purpose: GlideRecord is a class used to interact with your ServiceNow instance’s database from within a script.
    Functionality: It provides helpful API methods to retrieve, update, create, or delete records stored in your ServiceNow instance.
    Usage:
    On the server side (e.g., in a Business Rule), you can use GlideRecord from scripts within global or scoped applications.
    On the client side (e.g., in a Client Script), you can use GlideRecord from scripts within global applications.
    Important Note: While you can technically use GlideRecord in a client-side script, it generates a slow Ajax request in the browser. Use it wisely and sparingly.
    Access Control: If you want to ensure proper access control (ACLs) when querying data using GlideRecord, you must manually perform all access checks in your scripts using functions like canRead(), canWrite(), canDelete(), and canCreate().
    GlideRecordSecure:
    Purpose: GlideRecordSecure is like a not-so-evil twin to GlideRecord but with added functionality.
    Enforcing ACLs: GlideRecordSecure performs the same functions as GlideRecord but enforces ACLs (Access Control Lists).
    When to Use:
    If you need to enforce ACLs when querying data in your ServiceNow scripts, use GlideRecordSecure.
    If you must execute a query in a script without respect for ACLs, you can use GlideRecord.
    If you’re unsure, stick with using GlideRecordSecure.
    Remember that understanding application and table/data access controls is crucial. If you’re new to ServiceNow development, consider learning more about this concept. Happy scripting! 😊 #servicenow #servicenowtraining #itsm #servicenowadmin #servicenowcommunity #servicenowdeveloper #servicenowplatform #trending #viral #cloudcomputing

КОМЕНТАРІ • 5