Development questions
Write a SOQL query to fetch all deleted Accounts currently sitting in the Recycle Bin (WHERE IsDeleted = true ALL ROWS).
Filter on IsDeleted = true and add ALL ROWS so the query includes Recycle Bin records. In Apex only (not Query Editor) use this syntax.
apex
List<Account> deleted = [SELECT Id, Name, DeletedDate FROM Account WHERE IsDeleted = true ALL ROWS];
You can pass the results to undelete to restore them.
soqlscenariorecycle-bin
More Development questions
- What is an Apex Trigger in Salesforce and when should you use it over Flows?
- What is the difference between before triggers and after triggers?
- Explain all Trigger context variables (isInsert, isUpdate, isDelete, isUndelete, isBefore, isAfter, isExecuting, size, operationType).
- What is the difference between Trigger.new and Trigger.old?
- In which trigger events are Trigger.new and Trigger.newMap available?
- In which trigger events are Trigger.old and Trigger.oldMap available?