Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Execute a SOQL Query that Includes Deleted Items
The following query requests the value from the Name field from all deleted Merchandise__c records, in an organization that has one deleted Merchandise__c record. The same query using Query instead of QueryAll would return no records, because Query automatically filters out any deleted record from the result set.
Example usage for executing a query for deleted Merchandise__c records
1curl https://MyDomainName.my.salesforce.com/services/data/v67.0/queryAll/?q=SELECT+Name+from+Merchandise__c+WHERE+isDeleted+=+TRUE -H "Authorization: Bearer token"Example request body for executing a query: none required
Example response body for executing a query
1{
2 "done" : true,
3 "totalSize" : 1,
4 "records" :
5 [
6 {
7 "attributes" :
8 {
9 "type" : "Merchandise__c",
10 "url" : "/services/data/v67.0/sobjects/Merchandise__c/a00D0000008pQRAIX2"
11 },
12 "Name" : "Merchandise 1"
13 },
14 ]
15}Retrieving the Remaining SOQL Query Results
1"nextRecordsUrl" : "/services/data/v67.0/query/01gD0000002HU6KIAW-2000"In such cases, request the next batch of records and repeat until all records have been retrieved. These requests use nextRecordsUrl, and do not include any parameters.
Although the nextRecordsUrl has query in the URL, it still provides the remaining results from the initial QueryAll request. The remaining results include deleted records that matched the initial query.
Example usage for retrieving the remaining results
1curl https://MyDomainName.my.salesforce.com/services/data/v67.0/query/01gD0000002HU6KIAW-2000 -H "Authorization: Bearer token"Example request body for retrieving the remaining results: none required
Example response body for retrieving the remaining results
1{
2 "done" : true,
3 "totalSize" : 3214,
4 "records" : [...]
5}