Deleting old records from import set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2017 09:40 AM
Hi All,
I have a requirement where I need to delete the old records from the Import set before Inserting new records into the import set.
How can i do that ??
Thanks,
SD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2019 07:49 AM
Still looking for this answer years later... Some posts seem to indicate you can put the desired target table in the call to the cleaner, but this doesn't work. It would be great if there was some kind of log that told you what was going on too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2017 09:46 AM
Hi Snow123,
There should be a Scheduled Job that runs 7 days to clean your import set if you want to do it right now what you can do is run a background script
var gr = new GlideRecord('name_of_import_set_table');
gr.query();
while(gr.next()){
gr.deleteRecord();
}
Thank you
Please mark correct/helpful if applicable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2017 10:02 AM
Hi Saketh,
I have to do this every time I run an Import for that particular Import set. So, would it be a business rule ??
Thanks,
SD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2017 10:20 AM
I am sorry but I am not sure of this as if you have it as a business rule what would you have condition for it and how would you define it? How about try this as a scheduled job suppose if you import every two days you can have this running every one day or any time before you start your import again it also depends on clearance time and import time. I'm not sure which would be the right way to do in your situation.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2017 10:52 AM
Set it up as a fix script, and you can just run it on demand. Or you can schedule it.