
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2019 03:09 AM
How is autoSysField(false) supposed to work?
I'm trying to use it in a background script to retroactively update request record that are closed but still in the active state and I don't want the sys_updated_by and sys_updated_on to be changed. With the following script, sys_updated_by still shows my name and sys_updated_on is the current time
var gr = new GlideRecord('sc_request');
gr.addQuery('active','true');
gr.addQuery('state', 7);
gr.query();
while (gr.next()) {
gr.setWorkflow(false);
gr.autoSysField(false);
gr.setValue ('active', 'false');
gr.update();
}
What do I need to change in my script to be able to update those records without altering the sys_updates?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- 15,682 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2019 03:18 AM
I guess it should be gr.autoSysFields(false); not gr.autoSysField(false);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2019 03:18 AM
I guess it should be gr.autoSysFields(false); not gr.autoSysField(false);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2019 03:22 AM
One little spelling error :'D
and now it works as expected
Thank you so much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2019 03:30 AM
Little things Matter 😄
You're Welcome