Question

Does anyone have any idea how to retrieve deleted records data from Apex data loader or otherwise from Salesforce except from the Web service?

Was it helpful?

Solution

You can't. The only way to get deleted records through the API is to use queryAll, and DataLoader doesn't use queryAll ever.

(Sorry for the resurrection here.)

OTHER TIPS

Check the documentation: https://na7.salesforce.com/help/doc/en/salesforce_data_loader.pdf

If using the GUI version v20 or above, you'll have the Export All button.

From the Command Line version, the process-config.xml file should have the process.operation attribute value set equal to "extract_all" (the documentation states "Extract All" but that doesn't work).

Using either of these above options will extract soft deleted records, and will allow you to filter on IsDeleted = true or false. (You can include this filter regardless, but without using the above options, IsDeleted=true will always return zero records).

Hope that helps.

P.S. In Apex, it's slightly different. Your SOQL query will be [Select Id from Account where IsDeleted=false all rows] The 'all rows' appendage is the Apex equivalent of 'extract all'.

In Dataloader, use the EXPORT ALL button, not the EXPORT button

This gives you access to deleted & archived records.

Roll them back with a few lines of Apex code in the System Log. For instance:

Account[] a = [select id from Account where isDeleted=true ALL ROWS];
undelete a;
system.debug(a);

This should work as long as you didn't use emptyRecycleBin() (which will still return query results, but won't allow undelete as the records would now be marked for physical deletion). Take a few of the ids from the USER_DEBUG results for a to confirm that it worked.

Try extract, extract_all, hard_delete.

I hope it's not to late.

There are three ways to do it.

  • Recycle bin. In recycle bin change the option to all recycle bin. It is like soft delete we can get the record. If you didn't get your record from recycle bin
  • Workbench. In workbench select soql query and your required object and create a query like this example.

    SELECT Id,Name,AccountId,Isdeleted,CreatedDate,StageName
    FROM Opportunity where isdeleted =true
    

    in this section we didn't get the record we know the information of the opportunity record.

  • Dataloader. It also works like workbench and you can retrive the information of the record. Select exportall option and select the required fields and put a filter like is deleted is true.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top