Disable Audit when making changes to the fields in change_request table
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2013 08:42 AM
Hi,
I am writing a script to make changes to the fields of change_request table. As this table is audited, all the changes are getting recorded and displayed in the Activity Formatter.
I need to avoid the changes to get audited in the table. Please let me know how i can accomplish this through scripting.
Thanks,
Praveen
Labels:
- Labels:
-
Change Management
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2013 08:58 AM
The only way to avoid auditing is to turn off GlideRecord's workflow for the update. This is done in script like so:
var gr = new GlideRecord("change_request");
gr.addQuery(your query here);
gr.query();
while (gr.next()) {
gr.setWorkflow(false);
gr.u_your_field = some_value;
gr.update();
}
And if you want to not update the "Updated" and "Updated by" fields, you can add gr.autoSysFields(false) to the script as well.