updateMultiple & setWorkflow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2020 07:32 AM
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!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 10:30 AM
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.