GlideSystem - nil(Object obj)

Queries an object and returns true if the object is null or contains an empty string.

Table 1. Parameters
Name Type Description
obj Object The object to be checked.
Table 2. Returns
Type Description
Boolean True if null or empty string; otherwise, false.

Scoped equivalent

To use the nil() method in a scoped application, use the corresponding scoped method: Scoped GlideSystem - nil(Object o).

if ((!current.u_date1.nil()) && (!current.u_date2.nil())) {
  var start = current.u_date1.getGlideObject().getNumericValue();
  var end = current.u_date2.getGlideObject().getNumericValue();
  if (start > end) {
    gs.addInfoMessage('start must be before end');
    current.u_date1.setError('start must be before end');
    current.setAbortAction(true);
  }
}