Loading

Comprehending Data Storage for Territory Planning Unit Assignment Object

Дата публикации: Aug 19, 2025
Описание

The Territory Planning Unit Assignment (TPUA) object in Salesforce holds all the individual units (Salesforce records) and boundary containers for Territory Planning Datasets and Alignments. Storage is handled differently between Datasets created using live and copied data.

For each Dataset that is created using copied data, a TPUA record is created for each unit it contains. So if 25,000 Accounts were added to the Dataset from a SOQL query or a Report, 25,000 TPUA records would be created. No TPUA records are created for Datasets created with live data.

For each Alignment created in Territory Planning, a TPUA record is created for each unit that exists in the Alignment and for each container that is added to the Alignment; however, when using live data, a TPUA is only created after assigning a record to an area. For example, if you created an Alignment with 25,000 Accounts and selected United States Postal Codes as the container set (which has 32,584 postal codes), then the total number of created TPUA records would be 57,584 (25,000 + 32,584).

Let's bring these concepts together and look at the overall impact to an org when using either option.

Live

  • Dataset = 0 records

  • Alignment = 25,000 TPUA records for accounts + 32,583 TPUA records for boundaries = 57,584 records

  • Total = 57,584 records

Copied

  • Dataset = 25,000 TPUA records for accounts

  • Alignment = 25,000 TPUA records for accounts + 32,583 TPUA records for boundaries = 57,584 records

  • Total = 82,584 records

 

Решение

The TPUA object in Salesforce can accumulate a large amount of data over time due to the continuous insertion of records for every Dataset and Alignment. This can potentially slow down the system's performance and make data management more challenging. To ensure Data storage is managed effectively, it's indeed important to regularly archive and delete old and unused Datasets and Alignments from Territory Planning UI. Once these have been deleted, the admin can run the Permanently Delete job from the Maps configuration page. Running the 'Permanently Delete' job will help in removing all the records related to the deleted datasets and alignments from the related objects, including TPUA. You can run the below SOQL queries to check how many Datasets and Alignments are in the deleted Status-

SELECT ID FROM maps__TPDataSet__c WHERE maps__Status__c = 'Deleted'

SELECT ID FROM maps__TPAlignment__c WHERE maps__Status__c = 'Deleted'

Here are the steps to run the Permanently Delete job:

  1. From Setup, in the Quick Find box, enter Installed Packages, and then select Installed Packages.
  2. Next to the Salesforce Maps package, click Configure.
  3. Under Territory Planning, click Data Management.
  4. Click Permanently Delete.
  5. To avoid the task of removing deleted datasets and alignments from the recycle bin, select Skip Recycle Bin.

Notes:

  1. Once the Permanently Delete button is clicked, an Apex batch job runs in the background to clean up the data. You can check the status of this job by navigating to the Salesforce Set up menu and entering 'Apex Jobs' in the Quick Find box. Click the Apex jobs to check the status of the job 'TPCleanupBatch'
  2. You can also automate running this job either by creating a Schedule-Triggered Flow or Programmatically
Номер статьи базы знаний

001176945

 
Загрузка
Salesforce Help | Article