# How do Territory Planning simulations help operations teams design optimal sales territories?

**Topic:** Sales Cloud · **Difficulty:** Medium · **Tags:** Sales Cloud, Territory Planning, Operations

Read it on the site: https://www.forcechallenges.com/interview-questions/how-do-territory-planning-simulations-help-operations-teams-design-optimal-sales-territories

## Answer

**Basics:** A territory model holds territory types, a hierarchy, and account assignment rules. Models have states: Planning, Active, Archived. Only one model is Active; others let you experiment without affecting sales.

**How it works:**
1. Clone the Active model or create a Planning model.
2. Define territory types and the hierarchy; add rules with criteria on Account fields (for example region, revenue).
3. Run assignment rules; Salesforce populates account-to-territory assignments within the model.
4. Review results: reports on territories and accounts, check coverage gaps, overlaps and counts.
5. Add forecast users and opportunity assignment logic.
6. Activate the model. This makes it the live model and the former Active model becomes Archived; sharing recalculates.

**Advanced / deep dive:** Territory models allow multiple territories per account, so overlaps and coverage need explicit checks. Activation triggers sharing recalculation, which can take time on large orgs; schedule off-hours. Limits on models by edition exist (verify in current docs). Opportunity territory assignment follows either the account's territory or a custom Apex filter implementing TerritoryMgmt.OpportunityTerritory2AssignmentFilter for logic such as choosing the highest-priority territory. Rolling forward across fiscal periods means cloning and reactivating, since quotas and forecasts tie to the active model. Salesforce Maps adds map-based territory design and analysis. The original Territory Management is legacy; verify its status for your org.

**Code / config example:**
```apex
global class OppTerritoryFilter implements TerritoryMgmt.OpportunityTerritory2AssignmentFilter {
  global Map<Id, Id> getOpportunityTerritory2Assignments(List<Id> oppIds) {
    Map<Id, Id> result = new Map<Id, Id>();
    Map<Id, Id> oppToAcct = new Map<Id, Id>();
    for (Opportunity o : [SELECT Id, AccountId FROM Opportunity WHERE Id IN :oppIds])
      oppToAcct.put(o.Id, o.AccountId);
    Map<Id, Id> acctToTerr = new Map<Id, Id>();
    for (ObjectTerritory2Association a : [SELECT ObjectId, Territory2Id
        FROM ObjectTerritory2Association WHERE ObjectId IN :oppToAcct.values()])
      if (!acctToTerr.containsKey(a.ObjectId)) acctToTerr.put(a.ObjectId, a.Territory2Id);
    for (Id oid : oppToAcct.keySet())
      if (acctToTerr.containsKey(oppToAcct.get(oid))) result.put(oid, acctToTerr.get(oppToAcct.get(oid)));
    return result;
  }
}
```

**Hidden gotchas & must-remember points:**
- Only one model is Active at a time; activating is not easily reversible.
- Changes in a Planning model do not affect users until activation.
- Activation and rule runs cause sharing recalculation.
- Accounts can sit in several territories; plan overlap rules.
- Account assignment rules cover accounts; opportunity logic needs the filter or default behavior.
- Model-count limits depend on edition; verify.

**Best practice:** Simulate in a sandbox or Planning model, review coverage reports with ops, then activate in a low-traffic window.

---
Source: ForceChallenges · last updated 2026-11-02
