Capture Audit history with setworkflow(false)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2017 05:01 AM
Hey Guys,
1.
In one of the data source, 'Run Business rules' is unchecked. Is it still possible to capture the changes/updates done in the audit history.
2. In another data source, 'Run Business rules' is checked, with we have used 'setworkflow(false)' which again does not capture the audit changes. But we need those audit details.
Is there a solution for this.
TIA
Nikh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2017 05:08 AM
The setWorkflow(false) will not do any audit:
You need to have it set to "true" if you want audit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2017 08:15 PM
Yes, setWorkflow(false) was written with a purpose. So I am looking for a scenario where setWorkflow(false) is used and still changed are audited.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2017 10:41 PM
That can't be done with setWorflow then. One of the things to keep in mind here is that imports that run very often, if they do keep the audit, can increase the sys_audit to a very large size and then you might run into other performance issues. So, if you have such imports, I would think twice if I really need the audit data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2017 05:20 AM
There is a way to do it.
You need to create a custom table against the table you want audit.
For the table where you do not want audit make serWorkflow(false) and pass the the values to custom tables to get it updated.
var gr= new GlideRecord('incident');
gr.get('sys_id');
gr.test="something to update";
gr.setWorkflow(false);
gr.update();
var gr1= new GlideRecord('u_incident');
gr1.intialize();
gr1.number=gr.number;
gr1.test=""something to update";
gr1.insert();
Thanks,
Jagarnath