How to retrieve deleted objects?

Actually, workbench is what you want. Easy to log in to, easy to use, quick and dirty query building, etc. Instead of adding ALL ROWS you just need to check the option to include archived and deleted records (the upper-right corner of the query editor)

For in-org access, consider writing a visualforce page that accepts a query that you can feed directly into database.query, or you could even build a GUI for it. You may also want to consider the Apex Data Loader. Unfortunately, you can't "report" on the recycle bin, so the options above are the most efficient in most cases.


There are new methods in Database class from the Salesforce Release Winter 14(page 279), to get the deleted/updated records of an object at a specific time, Database.getDeleted and Database.getUpdated, i.e :

//simple example
Database.GetDeletedResult result  = Database.getDeleted(Merchandise__c',Datetime.now().addHours(-1),Datetime.now());
Database.DeletedRecord[] deletedRecords = result.getDeletedRecords();

I hope that can help

Tags:

Soql

Data

Query