GlideRecord - isNewRecord()

Determines whether the current record has been inserted into the database. This method returns true only if the newRecord() method has been called. This method is useful for scripted ACL, and in the condition of UI actions, but should not be used in background scripts.

Note: This method returns true for any new record during a business rule, or if the newRecord() method is used to initialize a record with default values and a unique ID (sys_id). In all other cases, it returns false.
Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
Boolean True if the current record is new (has not been inserted into the database.)

Scoped equivalent

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

answer = gs.hasRole("filter_admin") || current.isNewRecord()