Data cleanup - Background script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-24-2024 06:46 AM
I want to delete demo data from my PDI by clicking on Remove Demo Data. I want the background script that shows all the objects that are deleted. In the script execution history, I got one code
var sch = new ScheduleOnce();
sch.script = "gs.pause();gs.sleep(1000);gs.setCleaningDemoData(true);gs.loadBatchScript('clean_demo_data.js');gs.setCleaningDemoData(false);gs.resume();";
sch.setLabel("Remove demo data");
sch.schedule();
var SNJSON = JSON, writer;
writer = GlideTransaction.get().getResponse().getWriter();
if (typeof answer !== 'undefined') {
writer.write(new SNJSON().encode(answer));
}
writer.flush();
writer.close();
I am not able to locate the clean_demo-data.js as it contains the logic of data clean up. Is the script part of a standard ServiceNow feature (like demo data cleanup).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-24-2024 07:35 AM
@NishaB -Its tricky to see what was deleted as a part of demo data cleanup
Yes - clean_demo-data.js is a script used for demo data cleanup.
You will not be able to access clean_demo-data.js as its ServiceNow internal.
Mark this post as helpful/correct if it works for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-24-2024 08:19 AM
Hi @NishaB ,
You can try the 'Deleted Records' module in the navigation menu.
If you find it helpful, please mark my answer as correct so that it can useful to others.
Thanks & Regards,
Sumanth meda