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
Table 2. Returns
Type Description
/ update the state of all active incidents to 4 - "Awaiting User Info"
var gr = new GlideRecord('incident')
gr.addQuery('active', true);
gr.setValue('state',  4);