[SalesForce] the lifecycle of isDeleted records

Quick question. I have record that I deleted two days ago. I still can do SOQL query and get it in workbench using isDeleted field.

Does Salesforce have some recycle mechanism for these kind of records? Will I still able to select isDeleted records in an year for instance?

Best Answer

Records once deleted reside in the recycle-bin, and they stay there for 15 days unless to forcefully delete them. Salesforce documentation regarding this states two important points

  • Deleted records remain in the recycle bin for 15 days, and can be restored during that time. To permanently remove your deleted items before the 15-day period, administrators and users with the Modify All Data permission, can click Empty your Recycle Bin or Empty your organization’s Recycle Bin.
  • After 15 days, deleted items are purged from the recycle bin, and once purged, they can’t be recovered.

How to troubleshoot the data, that is removed from Recycle bin

Records may still be queried, as the documentation states

If the records are deleted from the Recycle Bin, you may still be able to query on the record to retrieve the information but you cannot Undelete the same.

Note that availability of the records in the Recycle Bin may be variable and we cannot guarantee a specific length of time they will be available to query once removed or hard deleted from the recycle bin.

As for "will you be able to query records after a year of deletion", Salesforce doesn't guarantee the specific length of time the deleted records can be queried. I am sure Salesforce won't give a year's leverage to its customers for deleted records.

Related Topic