Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2025 02:59 AM
Hi,
I wrote this code, but updates increased. Kindly help.
var gr = new GlideRecord('incident');
gr.addQuery('number', 'INC0007001');
gr.query();
if(gr.next()){
gr.category = 'network';
gr.autoSysFields(true);
gr.update();
}
gs.addInfoMessage('the total number of updates are ' + gr.sys_mod_count);
Solved! Go to Solution.
2 ACCEPTED SOLUTIONS
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2025 03:09 AM
Use:
gr.autoSysFields(false);
gr.setWorkflow(false); // additional to ensures no business rules, flows, or scripts are triggered
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2025 04:17 AM
This is the corrected script
var gr = new GlideRecord('incident');
gr.addQuery('number', 'INC0007001');
gr.query();
if(gr.next()){
gr.category = 'network';
gr.autoSysFields(false);
gr.setWorkflow(false);
gr.update();
}
gs.addInfoMessage('the total number of updates are ' + gr.sys_mod_count);
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2025 04:17 AM
This is the corrected script
var gr = new GlideRecord('incident');
gr.addQuery('number', 'INC0007001');
gr.query();
if(gr.next()){
gr.category = 'network';
gr.autoSysFields(false);
gr.setWorkflow(false);
gr.update();
}
gs.addInfoMessage('the total number of updates are ' + gr.sys_mod_count);