I am retrieving deleted records through SOAP API through getDeleted(). However, this returns the deleted record. With this snippet from documentation:

// Get records deleted during the specified time frame.
            GetDeletedResult gdResult = soapConnection.getDeleted("Account", startTime, endTime);

            // Check the number of records contained in the results,
            // to check if something was deleted in the 60 minute span.
            DeletedRecord[] deletedRecords = gdResult.getDeletedRecords();
            if (deletedRecords != null && deletedRecords.length > 0)
                for (int i = 0; i < deletedRecords.length; i++)
                    DeletedRecord dr = deletedRecords[i];
                    System.out.println(dr.getId() + " was deleted on " + dr.getDeletedDate().getTime().toString());

How can I retrieve the all the properties of the deleted record dr? I can only get the ID, DeletedTime of the record.


To get more information you could use workbench.developerforce.com and run an SOQL query on the Account object, something like the following:

    SELECT Company_Name__c,Id,Industry,IsDeleted,LastModifiedDate,LastViewedDate,OwnerId,Phone FROM Account WHERE Isdeleted=true

The last modification should be the deletion so you could use LastModifiedDate to get the deleted date. If the results you receive from the query you have already created are better, then you could use VLookup in Excel to add the information from that query to this Workbench query.

Hopefully this is helpful. Good luck

  • Thanks, but this doesn't help my case. I'm left with the only option of querying through the SOAP API. My solution is to use the query with queryAll(). – dmachop May 22 '15 at 17:59

You should use SOQL Query with "ALL ROWS" clause to be able to retrieve deleted records. Something like:-

SELECT Id, Name, Industry FROM Account WHERE Isdeleted=true ALL ROWS
  • If I'm not wrong, ALL ROWS are used only for Apex. However, I guess the alternative is queryAll() for SOAP. – dmachop May 22 '15 at 17:34
  • Yes you are right, my bad, lost the context. – Anshul May 22 '15 at 18:06

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.