0

'setForceUpdate' is used to update records without having to change a value on that record to get the update to execute.

var gr = new GlideRecord('sys_user');
gr.query();
while (gr.next()) {
gr.setWorkflow(false); //Do not run business rules
gr.autoSysFields(false); //Do not update system fields
gr.setForceUpdate(true); //Force the update
gr.update();
}

Use of 'setForceUpdate' in ServiceNow
Working Code Asked question August 26, 2024