amtrack / sfdx-browserforce-plugin

sfdx plugin for browser automation
MIT License
109 stars 38 forks source link

Automate "Empty Org Recycle Bin" #486

Open mkreth opened 2 years ago

mkreth commented 2 years ago

Problem Statement

In our Salesforce org, frequently large number of records get deleted and then are kept in the Recycle Bin for a while. This negatively affects the performance of our reports and dashboards (according to Salesforce Support). Recommendation from Salesforce Support was to frequently empty the recycle bin if these records are no candidates to be undeleted. We currently have no known way of automating this.

Feature Request

Provide a capability to automatically navigate to the Recycle Bin in LEX /lightning/o/DeleteEvent/home and press the "Empty Org Recycle Bin" button and automatically confirm the following question.

amtrack commented 2 years ago

I haven't tried it yet, but it looks like there is an API to do that: emptyRecycleBin() maybe in combination with getDeleted() So this could maybe automated with JSforce for example. But of course this could be a browserforce plugin, too.

mkreth commented 2 years ago

Max number of records the emptyRecycleBin() API call allows is 200 per request. If the recycle bin contains hundreds of thousands of records this sound very time consuming to do via API calls.