Scoped GlideRecord - updateMultiple()

Updates each GlideRecord in the list with any changes that have been made.

When changing field values, use setValue() instead of directly setting the field (field = something). When using updateMultiple(), directly setting the field (gr. state = 4) results in all records in the table being updated instead of just the records returned by the query.

Do not use this method with the chooseWindow() or setLimit() methods when working with large tables.

Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
void
/ update the state of all active incidents to 4 - "Awaiting User Info"
var gr = new GlideRecord('incident')
gr.addQuery('active', true);
gr.query();
gr.setValue('state',  4);
gr.updateMultiple();

Output: