updateMultiple & setWorkflow

Community Alums
Not applicable

 

Hi ServiceNow community,

Does setWorkflow(false) have any impact when using updateMultiple()?

Based on a situation that happened to me yesterday, it seems that the business rules still run even when I used the following code:

var gr = new GlideRecord('sys_user');
gr.addNotNullQuery('<specific field>');
gr.query();
gr.setValue('<specific field>', '');
gr.autoSysFields(false);
gr.setWorkflow(false);
gr.updateMultiple();

 

Thanks!

5 REPLIES 5

Dawid K1
Tera Contributor

To whoever finds this. One of the exceptions mentioned by Mark is reclassification of the record, or in technical terms, updating sys_class_name field. In the background, there is actually new Insert happening, and that's probably handled separately. You can observe it closer if Rollback Context captured when reclassifying the record.

Anyway, in this case .setWorkflow(flase) would not work even for normal .update(), and I was not able to find a solution for this.