6

I was wondering why this query retrieves ZERO records when executed in the Workbench and Developer console (though I have records in the Recycle Bin):

Select Id, IsDeleted FROM Account WHERE IsDeleted = TRUE

The same query works in the Data Loader when using Export All. Why this behavior? Any thoughts?

13

Did you check "Deleted and archived records:" as "Include" ?

enter image description here

And as for the Developer console, you have no way to do it. You can do with Apex using SOQL with the "ALL ROWS" option, but the Query Editor on the Developer console doesn't support it.

1
  • Thank you Shingo. I missed this checkbox"Deleted and archived records". Now it's working. Jul 15 '15 at 6:56
9

Are you using the "QueryAll()" API call when you try to retrieve the delete records? Using the regular "Query()" call won't allow you to retrieve delete records. See the API documentation on the "QueryAll()" API call here:

http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic=Content/sforce_api_calls_queryall.htm

Thanks!!!

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.