Sys_meta property for GlideRecord
dhruvsn
·
Aug 24, 2020
·
article
Hi all,
In this article we will talk about **sys\_meta** property that comes with every field returned in a GlideRecord and it contains all the dictionary values.
**Session Video: [Video](https://community.servicenow.com/community?id=community%5Fvideo&sys%5Fid=bb19f663dbe1dc505129a851ca961938)**
**Codes Used:**
* **Printing sys\_meta mandatory attribute for caller\_id**
var gr = new GlideRecord('incident');
gr.initialize();
gs.addInfoMessage(gr.caller_id.sys_meta.mandatory);
* **Printing all available options or attributes under sys\_meta property for caller\_id**
for(attr in gr.caller_id.sys_meta){
gs.addInfoMessage("KEY: "+attr+ " Value: "+gr.caller_id.sys_meta[attr]);
}
* **Printing fields that are mandatory**
gs.addInfoMessage("Mandatory Fields");
for(field in gr){
if(gr[field].sys_meta.mandatory=="true"){
gs.addInfoMessage(field);
}
}
Youtube Channe Link: [Youtube](https://www.youtube.com/channel/UCv4FOEe0MZkANapsqhDVRBw)
https://dhruvsn.wordpress.com/2020/08/24/sys_meta-property-for-gliderecord/
Dhruv Gupta