ServiceNow Get All Fields in a GlideRecord
var grAccount=new GlideRecord('x_cls_clear_skye_i_account');
if (grAccount.get('sys_id', '833aeabc1bfbbd10f4b15421604bcb8b')){
var aFields=grAccount.getFields();
for (var i = 0; i < aFields.size(); i++) {
var glideElement = aFields.get(i);
if (glideElement.hasValue()) {
gs.print(' ' + glideElement.getName() + '\t' + glideElement);
}
}
}
Comments
Post a Comment