2

I'm using the SObject Rows API to get the fields values of a given record. It works fine on existing records but when used on deleted records it returns with an error of {"errorCode":"NOT_FOUND","message":"The requested resource does not exist"}.

As the docs note, Accesses records based on the specified object ID. Retrieves, updates, or deletes records.

Can I retrieve deleted records with this API? if not, is there a way to retrieve the deleted records field values/data for a given record ID?

1

QueryAll

QueryAll will return records that have been deleted because of a merge or delete. QueryAll will also return information about archived Task and Event records. QueryAll is available in API version 29.0 and later.

URI

https://ap1.salesforce.com/services/data/v31.0/queryAll/?q=SELECT+Id,Name,isDeleted+FROM+Account

For retrieving additional query results if the initial results are too large:

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_queryall.htm


Edit

Query Based on Id

/services/data/v35.0/queryAll/?q=SELECT+Id,Name,isDeleted+FROM+Account+WHERE+Id‌​='0019000001cH0ud'
  • But QueryAll does not let me query by a specific record, am I right? I don't want to query ALL my deleted records, just the ones I define by their ID – Alon Weissfeld Jan 11 '16 at 8:31
  • @AlonWeissfeld try with queryAll/?q=SELECT+Id,Name,isDeleted+FROM+Account+WHERE+Name='test' – Ratan Paul Jan 11 '16 at 8:32
  • I only have the ID, not any of the other fields – Alon Weissfeld Jan 11 '16 at 8:34
  • @AlonWeissfeld then use Id field /services/data/v35.0/queryAll/?q=SELECT+Id,Name,isDeleted+FROM+Account+WHERE+Id='0019000001cH0ud' – Ratan Paul Jan 11 '16 at 8:36
  • @AlonWeissfeld let me know if you have any issue here? – Ratan Paul Jan 11 '16 at 8:44

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.