GlideRecord - changes()

Determines whether any of the fields in the record have changed.

Table 1. Parameters
Name Type Description
Table 2. Returns
Type Description
Boolean True if any of the fields in the record have changed, false otherwise.

Scoped equivalent

To implement this functionality in a scoped application, add code similar to the following:

var gr = new GlideRecord("incident");
   gr.short_description = "test";
   var elements = gr.getElements();
   var hasChanged = false;
   for(var i=0; i < elements.length;i++){
     var element = elements[i];
     hasChanged = hasChanged || element.changes(); + ":" + element.changes());