Example of use cases & Queries
NOTE: For testing purposes, we recommend starting out with a low limit to initially test the policy
1. Archiving Tasks
Select Id FROM Task WHERE Whold IN (SELECT Id FROM Contact WHERE RecordTypeid = 'abc') AND ActivityDate<LAST_N_DAYS: 730 LIMIT 5
2. Archiving Cases
Select Id From Case WHERE Status = 'Closed' AND CreatedDate < LAST_N_DAYS: 30 LIMIT 5000
3. Archiving Cases From a Specific Account
Select id FROM Case Where accountId IN (SELECT id from Account where id ='1234XXXXXXXXXXXXXXX') AND Status = 'Closed' AND CreatedDate < Last_N_Days:30 LIMIT 5000
4. Archiving Attachments
Select IdFROM Attachment Where ParentId IN (SELECT Id FROM Opportunity WHERE (StageName='Signed Off' OR StageName='Asbestos Completed') AND CloseDate < N_MONTHS_AGO:6) LIMIT 2500
Select Id
5. Archiving Contacts
Select Id FROM Contact Where Archiver__c = true Limit 1000