- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2023 11:57 PM
Hello Experts,
I want to delete a large amount of data when a user clicks on a UI action button. In my script, I have used the deleteMultiple method, but it's only deleting a very small number of records, around 50, and my instance's performance is also degrading.
How can I efficiently delete these records without impacting instance performance?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2023 12:43 AM
Hi @Mark Wood ,
Please use below code as example for deleting all recods from table in UI action
Please modify table name as per your requirement.
- delContractRecords();
- functiondelContractRecords()
- {
- var gr= newGlideRecord("ast_contract");
- gr.query();
- gr.setWorkflow(false); //Don't fire Business rule,notifications
- gr.deleteMultiple();
- }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2023 12:43 AM
Hi @Mark Wood ,
Please use below code as example for deleting all recods from table in UI action
Please modify table name as per your requirement.
- delContractRecords();
- functiondelContractRecords()
- {
- var gr= newGlideRecord("ast_contract");
- gr.query();
- gr.setWorkflow(false); //Don't fire Business rule,notifications
- gr.deleteMultiple();
- }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2023 04:29 AM - edited ‎09-26-2023 04:32 AM
Hello @Community Alums
the script you provided works well for deleting 20,000 records with a single click. However, when attempting to delete more than 20,000 records, it encounters issues.It deleted 9000 records I want to delete all records Could you please provide guidance on how to delete all records successfully? Thank you for your assistance.