Salesforce Recycle Bin

Salesforce Recycle Bin

When we will delete records or objects or anything in salesforce, then we know it will go to Recycle bin and it will be in Recycle bin for 15 Days only. 

How to access Recycle bin:

You can refer to below pic for further details.

Go to any of your objects tab and you could see it at the left most side
OR
Login into your Salesforce org and just replace the URL in address bar with 
https://na14.salesforce.com/search/UndeletePageImage

 

You can refer to the below URL for further details.

http://help.salesforce.com/HTViewHelpDoc?id=home_delete.htm&language=en_US

 

How do I delete records in the recycle bin?

Take a look at the Database.emptyRecycleBin(sObject) method or the other variants in the Database class such as Database.emptyRecycleBin(sObject[])

For example, to permanently delete a contact with Id of ‘003i000000O4xYZ’ in the recycle bin:

Contact c = new Contact(Id = ‘003i000000O4XyZ’);
Database.emptyRecycleBin(c);

ALso deleting a parent record can also delete its children records. For example, deleting accounts also deletes contacts. If you search the for the child record in the recycle bin, it won’t appear in the list. You can query for it, but you’ll get an error “Entity is not in the recycle bin” if you try to undelete it. Restoring the parent record also restores the children records. Purging the parent also irrevocably deletes the children records; this is what salesforce is expecting you to do before you can uninstall the package. Edit: It occurred to me that it’s important to note an important aspect here: If you can query it in Apex Code or the Data Loader, it’s either active or soft-deleted. Hard deleted records only appear in the replication API, and only for 30 days. Normal Apex Code can’t query hard-deleted data, so the fact that you can still see it means it is still only soft-deleted.

Leave a comment