GlideRecord - changes()

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

Table 1. Parameters
Name Type Description
None
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.get("965c9e5347c12200e0ef563dbb9a7156");
   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();
     gs.info(element.getName() + ":" + element.changes());
   }
   gs.info(hasChanged);