ServiceNow GlideRecord Mark Read-Only | ServiceNow GlideRecord Tips and Tricks | ServiceNow
TechnoMonk
ServiceNow GlideRecord Mark Read-Only | ServiceNow GlideRecord Tips and Tricks
Hi All, Hope you are doing fine. As a ServiceNow developer, the thing which you will encounter daily is GlideRecord API. Whenever we have to retrieve any information from the database the GlideRecord is the primary API. Let's first try to understand what is GlideRecord in ServiceNow. As per ServiceNow docs, the ServiceNow GlideRecord class is the way to interact with the ServiceNow database from a script. See the GlideRecord API reference for a complete list of methods. GlideRecord interactions start with a database query. The generalized strategy is:
- Create a GlideRecord object for the table of interest.
- Build the query condition(s).
- Execute the query.
- Apply script logic to the records returned in the GlideRecord object.
In my project, I have faced a scenario where we have created a function that returns a GlideRecord object as an output, and our intention is just to provide read access to the object via GlideRecord. But in most cases, people will start modifying that object by updating a specific attribute on that record which in return changes the base values for the record. We were looking at the feasibility to make this GlideRecord restricted from the update that's where I encountered this hidden concept. In this tutorial, we will be looking at the way to make GlideRecord Read-only so that no one can update the returned GlideRecord. Isn't it amazing?
Agenda:
- What is GlideRecord
- Problem statement for the exposure of GlideRecord Object
- How we can mark the gLideRecord to ReadOnly
- Function to check if the GlideRecord is ReadOnly
- Demo
Hope you like this video. Please like and subscribe to my channel Technomonk to get such videos in the future.
Regards, Amit Gujarathi (Technomonk)
ServiceNow glide record,ServiceNow,ServiceNow glide record tutorial,glide record in ServiceNow,glide record,ServiceNow glide record get sys_id,glide record in ServiceNow examples,glide record query example ServiceNow,glide record in client script ServiceNow,ServiceNow scripting,what is glide record in ServiceNow,ServiceNow developer,glide system servicenow,gliderecord not null query,glidedialogwindow servicenow,servicenow interview questions,servicenow community ... https://www.youtube.com/watch?v=okAJPNl4QEA
21495719 Bytes