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?
Thanks.
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. https://www.salesforce.com/us/developer/docs/api_rest/Content/dome_get_deleted.htm
/services/data/v29.0/sobjects/Merchandise__c/deleted/โโโ?start=2013-05-05T00%3A00%3A00%2B00%3A00&end=2013-05-10T00%3A00%3A00%2B00%3A00
Attribution to: Prasanna
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/4871