The CreatorCon Call for Content is officially open! Get started here.

Deleting old records from import set

SD29
Tera Expert

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

13 REPLIES 13

Yadin
Tera Contributor

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.

Natsufab3
Kilo Guru

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


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


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


Set it up as a fix script, and you can just run it on demand. Or you can schedule it.