Find your content:

Search form

You are here

Mobile SDK retrieve deleted records


I am using Salesforce Android SDK version 1.3.1.

I am trying to query all Contacts (deleted as well).

But no matter what I do, I don't seem to be able to retrieve the deleted records, meaning those that have IsDeleted=true.

My code:

RestRequest request = RestRequest.getRequestForQuery("v25.0", "SELECT Id, IsDeleted FROM Contact");

But I always get only non-deleted Contacts.

I read on a forum somewhere that you can't query deleted records via the Rest API.

Any ideas?


Attribution to: Alexandru Luchian

Possible Suggestion/Solution #1

You can construct a Apex Rest Service and for Query use 'ALL ROWS' and this fetches all the data even from the recycle bin and you can identify with isdeleted.I dont believe we have standard Rest API for the same

Attribution to: Mohith Shrivastava

Possible Suggestion/Solution #2

You can use the SOAP API's getDeleted call. The docs contain sample Java code. You can use the same OAuth token you use with the REST API as the session id for the SOAP call.

As of API version 29.0, you can use the queryAll REST endpoint with IsDeleted=true in your query.

Attribution to: xn.

Possible Suggestion/Solution #3

You can query the deleted records from Salesforce using the REST API. For that you will need to pass the Start and End datetime.


Attribution to: Prasanna
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content