Enabling Retain This Object for a Templated Archive
Overview
The Retain This Object feature provides greater control over which objects are deleted in Salesforce. With this feature, you can mark objects added to an archive as Retained, meaning that the object will be included in the archive but also remain in Salesforce. A child object that is not retained will still be deleted. The instructions below demonstrate how to use this feature and provide examples to illustrate the expected outcome.
By default, objects do not have Retain This Object enabled. Which means they will be deleted from Salesforce when archived.
![]()
The Green Shield icon indicates that the object is marked for retention. However, if the object depends on its parent and the parent is deleted, the object will also be deleted, even though it is marked for retention.
![]()
The Red Lock icon signifies that the object depends on its parent. This means if the parent object is deleted, the child object will also be deleted.
Enabling Retain This Object
Click an object to open the Add child objects dialog.
Click the Retain this object toggle to enable it.
Click Apply to save the changes.

Once the Retain this object toggle is enabled, a Green Shield icon will appear next to the object.

Examples
Below are four examples that show different scenarios with Retain This Object enabled. Each example explains which settings are used, which objects will be retained in Salesforce, and which will be deleted.
Example: 1
In this example, the Contact and Contact >> Contract objects are both marked as Retained. The screenshot below indicates which objects will be deleted from Salesforce and which will be saved.
The Case, Contract, and Service Contract objects each have dependent child objects that will also be deleted. It’s important to understand that a cascading delete can extend through multiple levels of objects. However, for simplicity, this example lists only the child objects that are directly dependent on the root parent.

Example: 2
In this example, only the Contact >> Contract object is marked as Retained. However, because Contact >> Contract depends on its parent, it will still be deleted when Contact is deleted, triggering a cascading delete of Contact >> Contract. The screenshot below indicates which objects will be deleted from Salesforce and which will be saved.
This example illustrates the importance of understanding how dependency works when using the Retain This Object feature. Objects marked as Retained will still be deleted if they are dependent on a parent that is deleted.

Example: 3
In this example, only the Contact >> Client Answer object is marked as Retained. Since Contact >> Client Answer is not dependent on its parent, it will be saved even after the Contact object is deleted. The screenshot below indicates which objects will be deleted from Salesforce and which will be saved.

Example: 4
In this example, all objects are marked as Retained except for Contact >> Content Document. This is a practical example of archiving files attached to a contact while retaining the rest of the Contact record in Salesforce. The screenshot below indicates which objects will be deleted from Salesforce and which will be saved.

Last updated
Was this helpful?