Loading

Managing Data Storage for the Territory Planning Unit Assignment Object in Salesforce Maps

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

How TPUA Records Accumulate

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).

Comparing Live vs. Copied Data Storage

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
Решение

This resolution explains why TPUA storage can grow large over time and how to clean up old Datasets and Alignments to reclaim storage.

Why This Matters

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 important to regularly archive and delete old and unused Datasets and Alignments from the 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 removes 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'

Steps to Clean Up Old Datasets and Alignments

  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 Setup 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