Query for a Single Record

  • get(Object name, Object value)
  • Used to query for a single record
  • Returns - True if a record is found - False if a record not found
if(!current.parent_incident.nil()) {
var myObj = new GlideRecord('incident');
myObj.get(current.parent_incident);
myObj.u_rca = true;
myObj.update();
}

Defines a GlideRecord based on the specified expression of name=value. If value is not spicified, then the expression used is sys_id=name.

This method performs a next() operation returning.

TIP FROM THE FIELD
If you are not 100% sure the get() method will return a record, consider using an if() condition to first check if you retrieved a GlideRecord. If not, script logic can be written to handle that scenario.

results matching ""

    No results matching ""