function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Restricting Recycle Bin Access to Users

Hi All,


I have the following requirement. Please suggest some solutions


All items deleted by users should be kept in the recycle bin for 12 months . The users should not be able to manually empty the recycle bin.

Is there a way to implement this in salesforce.





In Salesforce? No. The rules for how Recycle Bin works are defined here:


It is certainly possible to write an external application that uses the APIs to query Salesforce on a schedule and pull back the contents of the Salesforce Recycle Bin and store them in an external database. (I've done this before and I can tell you that if you set it to synchronize more often than every 15 minutes, you will have performance issues.)


On a related note, I generally don't give regular users the right to delete records - and if you don't trust your System Administrator to delete records, you may have the wrong System Administrator.


Additionally, you can use Javascript to hide elements on the page as described here:


Good luck!