How to fetch records form recycle bin in Salesforce?

"ALL ROWS" keyword is used to fetch records form recycle bin in Salesforce

Sample SOQL:

SELECT Id, AccountId FROM Contact WHERE IsDeleted = true ALL ROWS

Execute the below code in Anonymous window to check the results.

String strQuery = 'SELECT Id FROM Account WHERE IsDeleted = true ALL ROWS';
system.debug( Database.query( strQuery ) );

No comments:

Post a Comment