Can we undo an xml import via script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2017 04:42 AM
Is there any script to undo an xml import instead of manually deleting records ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2017 05:08 AM
Hi Dhiraj,
Are you aware of the sys_id and table name where you have the import done.
Run this in background script
var gr = new GlideRecord("table_name");
gr.get(sys_id);
gr.setWorkflow(false);
gr.deleteRecord();
Hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2017 05:19 AM
How do you know which records were inserted, vs which were there previously?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2017 06:10 AM
No i am trying to buld a functionality where the last xml import that was done can be un-done on click of a button or so..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2017 06:23 AM
Thing about an XML import is its not necessarily an insert. Records can be updated via the import as well. So there's no "undo" unless you have some place that stores a snapshot of the data immediately before the import. Another concern is updates that happened after the XML import: how do you propose to deal with them?