JSUtil - getBooleanValue(GlideRecord gr, String field)

Returns the value in a boolean GlideRecord field.

Table 1. Parameters
Name Type Description
gr GlideRecord A GlideRecord
field String The field from which to retrieve the boolean value.
Table 2. Returns
Type Description
Boolean Returns the value in a boolean GlideRecord field, returns true if value of field is true, "true", 1, or "1".

var inc = new GlideRecord("incident");
//get an active incident
inc.addActiveQuery();
inc.setLimit(1);
inc.query();
inc.next();
 
gs.print(JSUtil.getBooleanValue(inc, "active"));

Output: true