Scoped GlideRecord - update(String reason)

Updates the GlideRecord with any changes that have been made. If the record does not already exist, it is inserted.

Table 1. Parameters
Name Type Description
reason (Optional) String The reason for the update. The reason is displayed in the audit record.
Table 2. Returns
Type Description
String Unique ID of the new or updated record. Returns null if the update fails.
var gr = new GlideRecord('incident')
gr.get('99ebb4156fa831005be8883e6b3ee4b9');
gr.short_description='Update the short description';
gr.update();
gs.info(gr.getElement('short_description'));

Output: