GlideElement - getRefRecord()

Gets a GlideRecord object for a given reference element.

Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
GlideRecord A GlideRecord object

Scoped equivalent

To use the getRefRecord() method in a scoped application, use the corresponding scoped method: Scoped GlideElement - getRefRecord().

var grINC = new GlideRecord('incident');
grINC.notNullQuery('caller_id');
grINC.query();
if (grINC.next()) {
 
  // Get a GlideRecord object for the referenced sys_user record
  var grUSER = grINC.caller_id.getRefRecord();
  gs.print( grUSER.getValue('name') );
 
}