---
schema_version: "1"
id: 89ab8adf33d049c46b3be34afb7bd4294722cafa7503359f2bbb050e387a689b
title: Enable Filter-Based Opportunity Territory Assignment
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/tm2_enable_ota.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.tm2_enable_ota.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 629bc2b1bca902c9e33dfaf51443102f15411f6f1162667e1631b7d97662b767
description: Automate assignment of territories to opportunities when you enable and configure filter-based opportunity territory assignment.
products:
  - Sales Cloud
release: "264"
---
# Enable Filter-Based Opportunity Territory Assignment

Automate assignment of territories to opportunities when you enable and configure filter-based opportunity territory assignment.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic for some features and Lightning Experience for all features</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Performance</strong> and <strong>Developer</strong> Editions and in <strong>Enterprise</strong> and <strong>Unlimited</strong> Editions with Sales</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d20229e72">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d20229e72 ">To enable filter-based opportunity territory assignment:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d20229e72 ">Customize Application</td>

          </tr>
        </tbody>
      </table>

1. From Setup, enter Territories in the Quick Find box, and then select the territory settings.
2. Enable Filter-Based Opportunity Territory Assignment.
3. If your organization is using the Apex code Salesforce provides, first create the class and then return to this Settings page and enter the class name: OppTerrAssignDefaultLogicFilter. If you opt to use your own code for the Apex class, come back and enter the name of the class that you create.
4. Select how you want to run the filter-based opportunity territory assignment job.
    
    You can choose to run the job when opportunities are created or by using multithreading. We recommend enabling multithreading only if you’re assigning opportunity or opportunity product splits.
5. Save your settings.

#### See Also

- [_Developer Guide_: OpportunityTerritory2AssignmentFilter Global Interface](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_TerritoryMgmt_OpportunityTerritory2AssignmentFilter.htm)