---
schema_version: "1"
id: c8a1c6858d36b3c65d980a368e05a42046ea4ebf38da722941a735c25a9e3633
title: Create Archive Policies from the Archive Managed Package
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/archive_o_create_policies_from_archive_package.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.archive_o_create_policies_from_archive_package.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 436d919c78bcbc1c432ab41454e64dddac505ecd41e73d9dda7488763b218612
description: Create an archive policy for objects that you want to archive.
products:
  - Security
  - Salesforce Platform
release: "264"
---
# Create Archive Policies from the Archive Managed Package

Create an archive policy for objects that you want to archive.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note This content relates to Archive. For Salesforce Archive, see [Store Data Externally with Salesforce Archive](https://help.salesforce.com/s/articleView?id=xcloud.archive_overview.htm&type=5&language=en_US).

Policies created or edited in the Archive Console are viewable but not actionable from the package. To drill down, edit a policy, or run a policy, refer to the Archive Console.

From Archive Package 21, a new Policies tab is displayed in the top navigation bar.

Lightning users see the new Policies tab.

Salesforce Classic customers must manually add the new Policies tab.

Configuring a policy is executed with the permissions of the dedicated authenticated user specified in the Archive account settings. The ability to create policies and preview results varies depending on the permissions you have.

To add the new tab:

1. Open the Salesforce App Launcher.
2. Under Items, select **Policies**.
3. Go to the Policies tab and select **New**.
    
    The New Policy window opens.
4. Select **Archiving Policy**.
5. Click **Next**.
    
    The window opens on the Details tab of New Archiving Policy form.
    
    You can click the [Preview Table](https://help.salesforce.com/s/articleView?id=platform.archive_o_manage_policies_from_archive_package.htm&release=264.0.0&type=5 "To streamline your data archiving process, run, edit, clone, estimate, and preview archive policies from the Archive managed package.") tab at any stage to view a sample of 10 detected records that match your query criteria.
6. In the Policy Information section, complete these fields.
    
    - Policy Name: Enter an identifiable name. For example, Inactive Cases Opened 2 Years Ago. This field is mandatory.
    - Description: Include a policy description. This field is optional.
    - Enabled/Disabled: Only a policy set to `Enabled` can be run from the Archive Console. The default value is `Enabled.`
    - Schedule Policy (UTC): Schedule the frequency of the policy to run daily, weekly, or monthly. This field is mandatory.
        - For **Day**, select the hour from the dropdown list.
        - For **Week**, select the day of the week (Sunday–Saturday) and then the hour.
        - For **Month**, select the day of the month and the hour. You can also select the policy to run on the last day of the month.
7. In the Query Details section, you can run a query based on a list of objects in your org, and filter which records to archive. For more details, see [Archive Policies Query Details](https://help.salesforce.com/s/articleView?id=platform.archive_o_create_policies_from_archive_package.htm&release=264.0.0&type=5 "Options to select for your archive policy queries in the Archive managed package.").
8. Click **Save**.
    
    A success message is displayed.

- **[Archive Policies Query Details](https://help.salesforce.com/s/articleView?id=platform.archive_o_create_policies_from_archive_package.htm&release=264.0.0&type=5)**  
    Options to select for your archive policy queries in the Archive managed package.
- **[Archive Related ContentDocuments](https://help.salesforce.com/s/articleView?id=platform.archive_o_create_policies_from_archive_package.htm&release=264.0.0&type=5)**  
    Depending on your requirements, ContentDocuments can be archived using one of these methods in the Archive managed package. Consider how each method aligns with your archiving strategy and data relationships before proceeding.
- **[Archive ActivityFieldHistory](https://help.salesforce.com/s/articleView?id=platform.archive_o_create_policies_from_archive_package.htm&release=264.0.0&type=5)**  
    ActivityFieldHistory tracks changes made to specific fields on Activity records, such as Tasks and Events. This feature shows what the Archive managed package record was modified, the time and date when it was modified, and who made the change.
- **[Archive ContentDocuments by Using Parent Object Filtering Criteria](https://help.salesforce.com/s/articleView?id=platform.archive_o_contentdocuments_parent_object_filtering.htm&release=264.0.0&type=5)**  
    Archive ContentDocument records by using filtering criteria based on parent objects in the Archive managed package. For example, you can archive files associated with Opportunities when the opportunity stage is Closed Lost. You can use this business case to archive specific files while retaining essential Opportunity records in the system. This approach identifies duplicate records.
- **[Archive EmailMessages with Related Tasks](https://help.salesforce.com/s/articleView?id=platform.archive_o_create_policies_from_archive_package.htm&release=264.0.0&type=5)**  
    Archive all EmailMessages along with their associated Tasks in the Archive managed package.
- **[Archive Digital Signatures in Field Service Lightning (FSL)](https://help.salesforce.com/s/articleView?id=platform.archive_o_create_policies_from_archive_package.htm&release=264.0.0&type=5)**  
    When applying `DigitalSignatures` in the Archive managed package, the `ServiceAppointment`, `WorkOrder`, and `WorkOrderLineItem` use cases require special attention.
- **[Archive Archived Records in Salesforce](https://help.salesforce.com/s/articleView?id=platform.archive_o_create_policies_from_archive_package.htm&release=264.0.0&type=5)**  
    Archive records previously archived in your org, including events and closed tasks over 365 days old. If the new policy configuration window isn't turned on in the Archive managed package, you can manually add a specific clause to your archive query.
- **[Archive nCino Objects](https://help.salesforce.com/s/articleView?id=platform.archive_o_create_policies_from_archive_package.htm&release=264.0.0&type=5)**  
    The Archive managed package can archive files related to specific Loans, Relationships, Collateral Management, and other parent records from Document Manager. The parent record remains in your org while all root records are archived.
- **[Same Root and Child Filter](https://help.salesforce.com/s/articleView?id=platform.archive_o_create_policies_from_archive_package.htm&release=264.0.0&type=5)**  
    Automatically exclude parent records from a data set when they have children of the same object type in the Archive managed package. This filter addresses a specific limitation in Salesforce Object Query Language (SOQL) and enables more advanced filtering of hierarchical data.
- **[Archive Objects with Missing Relationship Names](https://help.salesforce.com/s/articleView?id=platform.archive_o_create_policies_from_archive_package.htm&release=264.0.0&type=5)**  
    When archiving related records in Salesforce, the Archive managed package typically relies on defined relationship names to navigate parent-child relationships. These relationship names are used in subqueries to identify and retrieve child records associated with a parent. However, some objects don't expose relationship names in the metadata, which can limit or block the archiving process for those object types. To archive these objects, use the **Enable Archiving of Objects with Missing Relationship Names** setting, and then filter `ContentLocation` by any external content references.

#### See Also

- [Archive ActivityFieldHistory](https://help.salesforce.com/s/articleView?id=platform.archive_o_create_policies_from_archive_package.htm&release=264.0.0&type=5 "Create an archive policy for objects that you want to archive.")
- [Archive Archived Records in Salesforce](https://help.salesforce.com/s/articleView?id=platform.archive_o_create_policies_from_archive_package.htm&release=264.0.0&type=5 "Create an archive policy for objects that you want to archive.")
- [Archive ContentDocuments Using Parent Object Filtering Criteria](https://help.salesforce.com/s/articleView?id=platform.archive_o_create_policies_from_archive_package.htm&release=264.0.0&type=5 "Create an archive policy for objects that you want to archive.")
- [Archive EmailMessages with Related Tasks](https://help.salesforce.com/s/articleView?id=platform.archive_o_create_policies_from_archive_package.htm&release=264.0.0&type=5 "Create an archive policy for objects that you want to archive.")
- [Archive Multi-Level Objects](https://help.salesforce.com/s/articleView?id=platform.archive_o_view_the_archive_console.htm&release=264.0.0&type=5 "View multiple Archive instances and their statuses from one platform in Archive Console.")
- [Archive Related ContentDocuments](https://help.salesforce.com/s/articleView?id=platform.archive_o_create_policies_from_archive_package.htm&release=264.0.0&type=5 "Create an archive policy for objects that you want to archive.")
- [Archive Search](https://help.salesforce.com/s/articleView?id=platform.archive_o_archive_search.htm&release=264.0.0&type=5 "Search for and view the records you've archived in the Archive managed package. Archive Search doesn't enforce role hierarchy, sharing, or visibility rules, so limit access to admins. Standard users use the Archive Widget.")
- [Manage Archive Policies from the Archive Package](https://help.salesforce.com/s/articleView?id=platform.archive_o_manage_policies_from_archive_package.htm&release=264.0.0&type=5 "To streamline your data archiving process, run, edit, clone, estimate, and preview archive policies from the Archive managed package.")

## Archive Policies Query Details

Options to select for your archive policy queries in the Archive managed package.

### Archive sObject

A list of available objects that can be deleted from your org. The selected object and all its related objects are archived.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note If you don't see a standard or custom object in the Available Objects panel, check with your admin to make sure that you have the correct user permissions.

### Archiveable Root-Level Objects

In order for an object to be archived as a root-level object, these calls must be supported.

- `create()`
- `delete()`
- `describeSObjects()`
- `query()`
- `update()`

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note

- Any object in your Salesforce environment that doesn't support all of these calls isn't available in the Archive sObject list when creating an Archive Policy.
- Big Objects aren't supported.

### Archive Records Filter

Select Filter in the Query dropdown list.

- Limit Query Field: The limit of records.
    
    The allotted amount in a single archive policy is restricted to 2 million root records.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)
    
    Note
    
    Users who need to archive more than 2 million root records per day are recommended to set multiple archive policies at complimentary time intervals with the same SOQL.
    
    The final number of total records archived can be higher than 2 million, depending on the number of child records archived together under the root.
    
    When setting multiple policies with the same SOQL, or policies with the same date range, make sure to schedule them to run at different times to avoid collisions.
    
    Boosting must be used to enable up to 2 million records. For more information, see Boost under Advanced Settings.
- Take Action When
    - All conditions are met: All the conditions in the condition builder exist (similar to `AND` between conditions).
    - Any condition is met: Select this option when at least one of the conditions in the condition builder exist (similar to `OR` between conditions).
- Field Object: Additional options are displayed once you select a date field type object, such as CreatedDate or LastModifiedDate.
    
    - Operator: An argument.
    - Value: The number or text relevant for the query.
    - Date Category: Scale in years, months, and days.
    
    Click Add Conditions as needed.
- Reset Query: Clears all conditions built so far and allow you to start over.
- Delete: Deletes the reference condition.
- SOQL Query: Customizes the SOQL query. To create your own complex query, select Manual from the Query dropdown list.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)
    
    Note You can use a handy query to archive records according to criteria in the parent object (Master-Detail). For example, archive all tasks where the parent cases are `status=closed`.
    
    ```
    SELECT Id FROM Task WHERE WhatId IN (SELECT Id 
       FROM Case WHERE status='On Hold') LIMIT 10
    ```
    
    This query can be applied to all objects.

### Lookup Relationships

When you select an sObject, you can archive child objects under the selected object by checking the Lookup relations archiving checkbox.

This option is only available if there is a relationship to lookup from child to parent. If not, an error message related to that object appears.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note To view the detailed schema relationships and select lookup descendant records to be archived with the root object, please refer to [Multi-level Archiving](https://help.salesforce.com/s/articleView?id=platform.archive_o_view_the_archive_console.htm&release=264.0.0&type=5 "View multiple Archive instances and their statuses from one platform in Archive Console.") from the Archive Console.

### Content Documents

Check the box to archive ContentDocument records that are potentially linked to other records still in Salesforce.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note If the ContentDocument is associated with multiple parent links, these can potentially be lost, and the document no longer points to other parents still in Salesforce. To ensure that the archived ContentDocument maintains its relationships with any active records, make sure the document is only linked to records under the same root object before archiving.

To maintain the relationship of the content document to records still in Salesforce, do not check the include Content Documents checkbox. Instead, define the policy with the Content Document as the root object.

### Retention Policy

Select the criteria from these sources.

- Archived Date
- Created Date
- Last Modified Date

Select the amount of time you want to retain the archived data. The maximum is 99 years and eleven months.

![Warning](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_warning.png)

Warning Set retention to zero years and zero months only if you intend to automatically purge all archived data within 24 hours. This action cannot be undone.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note When created, you can edit the retention policy. Consider whether you want the retention period to apply retroactively to existing archived data or only to records archived from this point forward. Create an archive policy with an updated retention period to restrict the system to querying only newly archived records. Change the current retention period to impact both already archived records and new records.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note If you have new retention criteria for a specific object and don't want previously archived records of that object impacted, stop archiving with this policy and create a policy with revised retention criteria.

### Advanced Settings

Boost: Accelerates archiving throughput by running parallel activities. You can have up to 8 active boosted policies.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note Disabled policies aren't included in the count.

Salesforce Data Protected For: The number of days to prevent archiving newly created records. By setting a data protection period, records updated in this timeframe aren't archived even if they are included in the policy query results.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note The default setting under Archive Settings is set to 90 days.

## Archive Related ContentDocuments

Depending on your requirements, ContentDocuments can be archived using one of these methods in the Archive managed package. Consider how each method aligns with your archiving strategy and data relationships before proceeding.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note This content relates to Archive. For Salesforce Archive, see [Store Data Externally with Salesforce Archive](https://help.salesforce.com/s/articleView?id=xcloud.archive_overview.htm&type=5&language=en_US).

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note When archiving without knowing all the relationships, the document might no longer be accessible in the context of those linked records. This could lead to confusion or an unintended loss of access. It's important to understand whether a document is linked to multiple records before deciding how to archive it.

### Archive ContentDocument as Root Object

Choose this method when the ContentDocument isn't tied to a specific parent record. For example, if a legal document is linked to multiple cases, archiving it as a root object ensures the relationships to these cases are maintained. This method maintains the integrity of parent relationships, even when the ContentDocument is unarchived.

Why Use This Method?

- Preserves Parent Relationships: The relationships to parent records remain intact.
- Independent Archiving: The ContentDocument can be archived without being linked to a specific parent record.

Important Considerations

- Parent Relationships: While parent relationships are maintained, they are no longer tied to specific records after archiving.
- ContentDocument Links (CDLs): CDLs, which connect content documents to parent records, are archived along with the content documents.
- Specific Object Types: You can archive ContentDocuments belonging to a specific object type. After selecting the ContentDocument as the root, you can choose the object type, such as ContentDocuments related to Cases.
- Searchable in Salesforce: Archived ContentDocuments can still be searched in Salesforce through the widget, as CDLs remain intact.

Example: Archive a Project Document

Before Archiving: You have a content document, CD1, linked to a parent record, Case.

After Archiving: When you archive CD1 as a root object, it retains its relationship to Case. However, it is no longer functionally connected to that campaign and won't appear as part of it in the system.

Viewing Archived Documents: Even after archiving, you can still view the archived content documents in Salesforce by searching through the widget. For instance, if you search for CD1 in the widget, you still find the archived document due to the intact ContentDocument Links (CDLs). This allows you to access the archived content without losing track of its previous associations.

1. Create a new archiving policy.
2. In the Archive SObject dropdown, select `ContentDocument`.
3. From the Sobject to archive its content document dropdown, select the object associated with the ContentDocument.
4. Click `Save`.

### Archive Root Records with Related ContentDocuments

This method is used when the ContentDocument is directly associated with a single parent object. For instance, if a document is attached to a specific Case, this approach bundles the parent record and its related ContentDocuments together for archiving. This ensures that the document remains closely tied to its parent object throughout its lifecycle.

In this method, the root record (such as Opportunity A) is archived along with its related content documents (like Sales Contract). This approach ensures that both the parent record and the content documents linked to it are archived together. Any lookup relationships are also handled during this process.

Why Use This Method?

- Comprehensive Archiving: Archives both the parent record and its associated ContentDocuments.
- Maintains Document Relationships: This method is particularly effective for keeping related documents closely tied to their parent records.

Important Considerations

- Multiple Parent Links: If a ContentDocument has links to multiple parents, those relationships may be lost during archiving.
- Archiving Scope: Archiving a content document under a root object means you're not just archiving that specific content document. Instead, all content documents associated with the root object and its archived child records (in the hierarchy) are archived.
- Unarchive with Related References: To preserve relationships on unarchiving, enable the Unarchive with Related References option in the Archive Settings. For further details, refer to [Unarchive Related References Management](https://help.salesforce.com/s/articleView?id=platform.archive_o_unarchive_from_archive_search_or_widget.htm&release=264.0.0&type=5 "Restore archived records with Archive Search or Archive Widget in the Archive managed package.").
- When the ContentDocument checkbox is checked, the policy is set to archive the root along with the associated child records.

Example: Archive an Account and Its Related Case ContentDocuments

Scenario: An account ABC Corp has multiple cases (e.g., Case 101, Case 102), each with its own attached ContentDocuments.

Archiving Process: When you archive ABC Corp as a root object, all ContentDocuments associated with related cases (e.g., Service Agreement from Case 101 and Technical Issue Report from Case 102) are archived along with the account.

Result: After archiving the account, Service Agreement and Technical Issue Report remain accessible from their respective cases (Case 101 and Case 102), and they are still preserved in Archive. You can view these documents through the widget in Salesforce and the Archive Search. On unarchiving, all are returned to Salesforce with respective links.

1. Create a new archiving policy.
2. In the Archive SObject dropdown, select the parent object (e.g., Case)
3. In the dynamic wizard, enable the Archive related content documents option.
4. Select the Cases to be archived.
5. Review the warning and click **Approve**.
6. Click **Save**.

To support archiving over 800 content documents under one root, see [Enable Archiving of Over 800 Lookups for Each Root Record](https://help.salesforce.com/s/articleView?id=platform.archive_o_view_the_archive_console.htm&release=264.0.0&type=5 "View multiple Archive instances and their statuses from one platform in Archive Console.").

## Archive ActivityFieldHistory

ActivityFieldHistory tracks changes made to specific fields on Activity records, such as Tasks and Events. This feature shows what the Archive managed package record was modified, the time and date when it was modified, and who made the change.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note This content relates to Archive. For Salesforce Archive, see [Store Data Externally with Salesforce Archive](https://help.salesforce.com/s/articleView?id=xcloud.archive_overview.htm&type=5&language=en_US).

### Why Salesforce Support Is Required

Controlled Access and Availability

- Selective Activation: ActivityFieldHistory isn't on by default in all orgs. Support reviews your setup to establish compatibility and compliance before activation.
- Regulatory Compliance: Support configures tracking to meet data protection requirements, establishing secure integration with Archive.

Data Security

- Sensitive Data Handling: Salesforce uses strict security measures to protect detailed tracking information stored in ActivityFieldHistory.
- Controlled Access: Salesforce Support verifies that appropriate access controls exist so only authorized users can archive historical activity data.

### Expected Timeline for Availability

After Salesforce Support turns on ActivityFieldHistory, it can take a few hours to a few days for the object to be available for archiving. Availability depends on how much data is in the object, and how long it takes for the system to process it.

### Limitations

Unarchive Not Supported: After archiving, ActivityFieldHistory records can't be unarchived.

Post-Archive: After archiving, the ActivityFieldHistory object can briefly appear in both Archive and Salesforce. This status is temporary. The record has been deleted in Salesforce, and the system completes the deletion asynchronously. This delay is normal and establishes data consistency across systems.

### Turn On ActivityFieldHistory

Request Activation: Contact Salesforce Support to turn on ActivityFieldHistory for Archive.

Configuration and Testing: Contact Own to turn on the ActivityFieldHistory feature.

## Archive EmailMessages with Related Tasks

Archive all EmailMessages along with their associated Tasks in the Archive managed package.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note This content relates to Archive. For Salesforce Archive, see [Store Data Externally with Salesforce Archive](https://help.salesforce.com/s/articleView?id=xcloud.archive_overview.htm&type=5&language=en_US).

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note To archive and unarchive EmailMessage records with attachments (ContentDocument), the Salesforce Enhanced Email setting must be enabled, and the Email Drafts setting must be enabled in your Salesforce org.

In Salesforce, sending an Email automatically creates a related Task with the same reference ID.

When you archive an Email, its associated Task might be deleted or remain in Salesforce, depending on your settings. If you later unarchive the Email, Salesforce creates a new Task.

This means that if the original Task wasn’t deleted, you’ll have duplicate Tasks. However, any custom fields from the original Task won’t be included in the new one.

To avoid duplicated orphan Tasks, consider these options.

### Use the Archive EmailMessages with Related Tasks Setting

1. When enabled, Archive automatically finds the related Task and archives it along with the Email.
2. Go to the Archive Settings tab.
3. Under the Archive section, find the option Archive EmailMessages with Related Tasks.
4. Toggle the switch to On.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note If you need to unarchive an Email, the system checks if the original Task still exists.

If the original Task was deleted, Archive generates a new one, and it is restored along with the email.

### Archive the Task as the Root Record

To ensure emails and their attachments are archived together, configure the Archive policy on the Task object and establish a relationship between EmailMessage and Task.

1. Define the Archive policy.
    
    Set up the archive policy on the Task object.
2. Add Field, Operator, and Value.
    
    - Select Field - Task Subtype
    - Select Operator - Equals
    - Select Value - Email
3. Archive process.
    
    This keeps the Task archived together with the related Email.

## Archive Digital Signatures in Field Service Lightning (FSL)

When applying `DigitalSignatures` in the Archive managed package, the `ServiceAppointment`, `WorkOrder`, and `WorkOrderLineItem` use cases require special attention.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note This content relates to Archive. For Salesforce Archive, see [Store Data Externally with Salesforce Archive](https://help.salesforce.com/s/articleView?id=xcloud.archive_overview.htm&type=5&language=en_US).

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note This article makes use of `ServiceAppointments` as an example, but these steps apply to all the use cases mentioned previously.

1. Under Service Appointment, a Service Report is created as a child with an `In Progress` status.
2. When the service has been provided, and the customer signs the Service Report, a Digital Signature is added to the Service Appointment.
3. When the Service Report is complete, the Content Document of the finalized report is generated, and the Digital Signature is deleted.
    
    The Service Report now has `Completed` status.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)
    
    Note Archiving the Service Appointment before the Service Report has a `Completed` status isn't recommended because you can't finalize the process.
    
    If Service Appointments are archived before the document is finalized, and then unarchived, Salesforce removes the Digital Signature file upon reinsertion for business logic reasons.

## Archive Archived Records in Salesforce

Archive records previously archived in your org, including events and closed tasks over 365 days old. If the new policy configuration window isn't turned on in the Archive managed package, you can manually add a specific clause to your archive query.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note This content relates to Archive. For Salesforce Archive, see [Store Data Externally with Salesforce Archive](https://help.salesforce.com/s/articleView?id=xcloud.archive_overview.htm&type=5&language=en_US).

Salesforce archives these activities.

- Events that ended more than 365 days ago.
- Closed tasks due more than 365 days ago.
- If there's no due date, closed tasks created more than 365 days ago.

Salesforce doesn't delete archived activities, but they can be deleted manually, or use Archive to delete them from Salesforce and Archive into AWS/Azure.

- When you create or refresh a sandbox, archived activities aren't copied.
- You can view and interact with archived activities in exported data and in certain locations in Salesforce.

If you haven't turned on the new policy configuration window to archive records that Salesforce has previously archived into Archive, you must add this clause to the query.

```
WHERE IsDeleted=False AND IsArchived=True Limit XXX
```

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note The regular archive `SELECT Id FROM Task WHERE Title=" LIMIT 10` must be manually changed to `SELECT Id FROM Task WHERE Title = ' AND IsDeleted=False AND IsArchived=True LIMIT 10`.

## Archive nCino Objects

The Archive managed package can archive files related to specific Loans, Relationships, Collateral Management, and other parent records from Document Manager. The parent record remains in your org while all root records are archived.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note This content relates to Archive. For Salesforce Archive, see [Store Data Externally with Salesforce Archive](https://help.salesforce.com/s/articleView?id=xcloud.archive_overview.htm&type=5&language=en_US).

You can create policies on these main Placeholder objects to be archived as Roots with all of their attached documents.

- Loan Placeholder \[`LLC_LoanDocument`\] and its Document Store Infrastructure.
- Relationship Placeholder \[`LLC_BI__Account Document`\] and its Document Store Infrastructure.
- Global Placeholder \[`LLC_BI__ Document_Placeholder`\] used in Collateral Management, Deposits, etc. and its Document Store Infrastructure.

As part of the policy, the underlying Document Manager infrastructure is archived together with the content document such as driver's license, passport and other financial transactions. Multiple versions of these documents are also archived.

### Create a Policy

This use case archives a Loan Placeholder with all Content Documents, Content Versions, and Document Store infrastructure.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note While this is to show one use case, the same steps apply to all three Placeholder objects.

In this scenario, these documents were uploaded under these Placeholders.

- Credit Memo
- Privacy Policy
- Term Sheet
- Generated Forms - 3 versions

1. Select **Archiving Policy**.
2. Click **Next**.
    
    The policy window opens.
3. In the Policy Information section, add values for these fields.
    
    - Policy Name: Enter an identifiable name.
    - Description: Opt to include a policy description
    - Enabled: If enabled, the policy becomes active when saved.
    - Schedule Policy (UTC): Schedule the frequency to run the policy (Daily/ Weekly / Monthly).
        
        If applicable, additional options are displayed.
        
        - All dates and hours are in UTC, make sure to adjust the time according to your time zone.
        - When selecting Day, you are prompted for the Hour.
        - When selecting Week you are prompted for the day of the week (Sunday-Saturday) and then the Hour.
        - When selecting Month you are prompted for the day of the month and then the Hour.
4. In the Query Details section, populate these fields as part of the policy.
    
    - Archive SObject: `LLC_LoanDocument`
    - Field: `LLC_BI__Loan__c`
    - Logic: `AND`
    - Operator: `equals`
    - Value: `Golf Augusta Pro Shops - Real Estate Only`
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)
    
    Note
    
    In this section, confirm these details.
    
    - Enter `LLC_BI__attachmentId__c` in the Field element.
    - Make sure that the Operator selected isn't empty.
    - Check the **Include Content Documents** checkbox.
        
        A warning message appears when clicking the **Include Content Documents** checkbox.
    
    SOQL Query Example
    
    ```
    SELECT Id FROM LLC_BI_LLCLoanDocument_c 
    WHERE LLC_BI_Loan_r.Name + 
    'Golf Augusta Pro Shops - Real Estate Only' 
    AND LLC_BI_AttachmentId_c!="LIMIT 10
    ```
5. Click **Accept**.
6. To select the fields that are available in your Archive Widget view, click **Preview Table**.
    
    You can select up to 15 fields.
    
    In our sample use case, these fields have been selected.
7. Click **Save**.

### View the Archived Data

To customize the page:

1. Add the Lightning Web Component to the Loan Object Page.
    
    In this example, we have created a Custom Tab named Archived Documents and placed it next to Documents.
2. View the Archived Documents under Loan: Golf Augusta Pro Shops - Real Estate Only.
3. To view the actual Content Document, click **CurrentAttachmentId**.
    
    This action takes you to the Content Document. To see a preview version, click on the right-hand side of the Content Document. If the Placeholder has multiple versions, the latest version of the Content Document is displayed.
4. To view all versions of a Placeholder with Content Document, click `View` under the little arrow on the right of the Placeholder.
    
    This action takes you to the Loan Placeholder (`LLC_LoanDocument`) Detail tab.
    
    1. From the Detail tab, go to the Related tab.
    2. Under Related, you can see the Document Manager underlying Infrastructure. The Document Stores (1) Related Lists has all versions of the Content Document.
    3. Click the Document Store Name link, or click `View` on the right to get to the Document Store Detail Page.
    4. From the Detail tab, go to the Related tab.
        
        The Related list displays all three versions of the Content Documents and Content Document Links and the link to the Document Store Indices.
    5. To see a preview version, click the right-hand side of any of the Content Documents.

## Same Root and Child Filter

Automatically exclude parent records from a data set when they have children of the same object type in the Archive managed package. This filter addresses a specific limitation in Salesforce Object Query Language (SOQL) and enables more advanced filtering of hierarchical data.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note This content relates to Archive. For Salesforce Archive, see [Store Data Externally with Salesforce Archive](https://help.salesforce.com/s/articleView?id=xcloud.archive_overview.htm&type=5&language=en_US).

The feature is available from the Archive Settings and lets you effectively isolate standalone or "leaf" records in a hierarchy for processing. For example, if a Case record is the parent of another Case, this filter excludes the parent, leaving only the child records.

While SOQL makes it easy to filter records based on a relationships to a different objects, such as finding Accounts with no Contacts, it doesn't support direct queries to filter records based on relationships to the same object, such as finding Cases that aren't parents of other Cases.

Same Root and Child Filter bridges this SOQL gap. It programmatically analyzes your records to provide this capability, enabling a more advanced level of filtering on hierarchical data.

Key Attributes

- Action: Skips the parent (root) record, not the child.
- Scope: Applies only to self-referencing hierarchies, such as Case to Case.
- Purpose: Solves a native SOQL limitation for filtering self-referencing lookups.

## Archive Objects with Missing Relationship Names

When archiving related records in Salesforce, the Archive managed package typically relies on defined relationship names to navigate parent-child relationships. These relationship names are used in subqueries to identify and retrieve child records associated with a parent. However, some objects don't expose relationship names in the metadata, which can limit or block the archiving process for those object types. To archive these objects, use the **Enable Archiving of Objects with Missing Relationship Names** setting, and then filter `ContentLocation` by any external content references.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-own_from_salesforce-264-0-0-production-enus/8ac98673-ede2-4046-a41e-2d5c846f24ff/images/icon_note.png)

Note This content relates to Archive. For Salesforce Archive, see [Store Data Externally with Salesforce Archive](https://help.salesforce.com/s/articleView?id=xcloud.archive_overview.htm&type=5&language=en_US).

For example, in this query `FeedItems` is the relationship name that connects the `Account` (parent) object to its related `FeedItem` (child) records.

```
SELECT Id, (SELECT Id FROM FeedItems) FROM Account
```

Some objects, such as `FeedItem`, do not expose relationship names in the metadata. This means that Archive can't use subqueries to retrieve related records, which can hinder the archiving process for those object types.

To address this issue, Archive provides the **Enable Archiving of Objects with Missing Relationship Names** setting. When this setting is enabled, Archive uses foreign key fields, such as `ParentId`, to retrieve related records directly, without depending on relationship names.

If the setting isn't enabled, the previous query fails because `FeedItem` lacks a subquery relationship name to `Account`.

### Filter External Content References

The `FeedItem` object includes the `ContentLocation` field to identify where content is stored.

Valid values for `ContentLocation` are:

- `E`—Content is stored externally.
- `S`—Content is stored within Salesforce.

To avoid archiving records that refer to externally stored content, add a filter to the Archive query.

```
SELECT Id FROM FeedItem WHERE ParentId IN (list of Account Ids) AND ContentLocation != 'E'
```

This filter ensures only `FeedItem` records with content stored in Salesforce are archived. By enabling this setting and using the appropriate filters, you can archive records even when relationship names aren't available.