logo

NJP

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

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

View original source

https://dhruvsn.wordpress.com/2020/08/24/sys_meta-property-for-gliderecord/