Scoped GlideRecord - isNewRecord()

Checks if the current record is a new record that has not yet been inserted into the database.

Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
Boolean True if the record is new and has not been inserted into the database.
var gr = new GlideRecord("x_app_table"); 
gr.newRecord(); // create a new record and populate it with default values
gs.info(gr.isNewRecord());

Output: