Question:
Why Soft-Deleted ObjectTerritory2Assocation (OT2A) Records Cannot be Retrieved and Restored in Salesforce (Veeva CRM)?
Answer:
Salesforce confirmed this to be the expected in Enterprise Territory Management (TM2.0). OT2A records cannot be restored.
In the event an OT2A record is soft-deleted, the record will be still accessible with a SOQL query if the Include Archived and Deleted records checkbox is ticked by Salesforce Inspector, Workbench, or Developer Console. The records cannot be purged or undeleted. They will remain in this state for 15 days. A Physical Deletion is required in order to permanently delete the record.
Quoting SFDC:
There are 3 stages of deletion. Soft delete is putting a record into the recycle bin. Hard delete is emptying the record from the recycle bin or deleting the record through API. Finally, there is physical delete which permanently removes the record.
Soft deleted records can still be queried by users with the appropriate access when filtering on isDeleted = True. Once the records are physically deleted they will no longer return in queries. There is an automated PD sweeper process that runs PD batch jobs on each instance, and Salesforce Support can also initiate PDs per customer request.
OT2A records having the AssociationCause of Territory2AssignmentRule can be regenerated by running the Territory Utilities and SFDC Assignment Processes.
- The same scenario is applied to the Territory2, UserTerritory2Association other TM 2.0-related objects, and AccountShare records.
- CRM User Roles are completely hard deleted after a Delete action, they are not queriable.
Related Documentation:
CRM Help Documentation: