Archiving Policies

    It’s recommended to review the questions below before starting to create the Archiving Policies.

    • Which objects and related objects do you want to archive and why? 
    • What is the scheduled frequency the Archiver should run (weekly / daily / monthly)?
    • Who has the ability to set up archiving policies (Admins only)?
      • Permission Sets can be assigned to appropriate system admins
      • OwnBackup_CDE_Policy permission set will allow the user to create, delete and edit the policy
    • Who needs to see the archived data? (Admins only / End users / Auditors / etc.) 
    • Who has access to the unarchive records? ( Admins only / End users / Auditors / etc.)
      • Permission Sets can be assigned to appropriate users
      • OwnBackup_Unarchive permission set will allow the user to unarchive records

    Example of use cases & Queries 

    NOTE:  For testing purposes, we recommend starting out with a low limit to initially test the policy

    • Archiving Tasks 
      • Object: Task 
      • Use Case: Archiving Tasks that are associated with a specific record type of contact (ie RecordTypeID = ‘abc’)  and last modified more than 2 years ago
      • Limit = 5, will archive 5 tasks in each run and its related objects 
      • Preview:  Id, Activity Date, Category (custom field) Description, Owner ID, Subject, Status
      • Example query: Select Id FROM Task WHERE WhoId IN (SELECT Id FROM Contact WHERE RecordTypeid = 'abc') AND ActivityDate < LAST_N_DAYS: 730 LIMIT 5

     

    1. Archiving Cases 
      • Object: Case 
      • Use Cases: Archive cases that meet the following criteria:
        • Status is closed
        • Created more than 30 days ago 
      • Limit = 5000,  will archive 5000 cases in each run and its related objects 
      • Preview: Id, Case Number, Type,  Sub Category (custom field), Issue (custom field)
      • Example Query:
        Select Id, CaseNumber, Type, Sub_Category_c, Issue_c from Case WHERE Status = 'Closed' AND CreatedDate < LAST_N_DAYS: 30 LIMIT 5000

     

    • Archiving Cases From a Specific Account  
      • Object: Case 
      • Use Cases: Archive cases that meet the following criteria:
        • Status is closed
        • Created more than 30 days ago
        • And belongs to an account with Id=1234  
      • Limit = 5000,  will archive 5000 cases in each run and its related objects 
      • Preview: Id, Case Number, Type,  Sub Category (custom field), Issue (custom field)
      • Example Query: Select id From Case Where accountId IN (SELECT id from Account where id ='1234') AND Status = 'Closed' AND CreatedDate Last_N_Days 30 LIMIT 5000

     

    • Archiving Attachments  
      • Object: Attachment  
      • Use Cases: Archiving attachments that their:
        • The parent is an Opportunity in a stage that is either ‘Signed Off’ Or 'Asbestos Completed' 
        • The Opportunity Close Date is more than 6 months in the past
      • Limit = 2500,  will archive 2500 attachments in each run and its related objects 
      • Preview: Id, Parent ID, Created Date
      • Example Query: SELECT Id, ParentId From Attachment Where ParentId IN (SELECT Id FROM Opportunity WHERE (StageName='Signed Off' OR StageName='Asbestos Completed') AND CloseDate < N_MONTHS_AGO:6) LIMIT 2500

         

    • Archiving Contacts  
      • Object: Contact  
      • Use Cases: Archiving contacts that their:
        • Archiver__c field is set to True 
      • Limit = 1000,  will archive 2500 contacts in each run and its related objects 
      • Preview: Id, Parent ID, Created Date
      • Example Query: Select Id  From Contact Where  Archiver__c = true Limit 1000
    « Previous ArticleNext Article »


    Contact Us

    Our Customer Support team is available by phone for urgent Production issues

    Standard Plan: Monday – Friday: 9:00 AM – 6:00 PM Local Business Hours

    Premier Plan: 24/7