---
schema_version: "1"
id: fe21596cedf5f2b24bd497590a74dd9f5ebff6092aa5ecfa3906de7808f49415
title: Territory
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_territory.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_territory.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: c68be20ff33291dd6c9531b1eac065188a910511699bb38a3abe23c9596630d1
description: Represents a flexible collection of accounts and users where the users have at least read access to the accounts, regardless of who owns the accounts. Available if Sales Territories has been enabled. This object is available in API versions 7.0 to 52.0. Use Territory2 instead of Territory in API version 52.0 and later.
---
# Territory

Represents a flexible collection of accounts and users where the users have at least read access to the accounts, regardless of who owns the accounts. Available if Sales Territories has been enabled. This object is available in API versions 7.0 to 52.0. Use Territory2 instead of Territory in API version 52.0 and later.

## Supported Calls

create(), delete(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), update(), upsert()

## Special Access Rules

Standard and partner users can access this object. Users assigned to the Manage Territories permission set can edit this object.

## Fields

| Field | Details |
| --- | --- |
| AccountAccessLevel | 
Type

picklist

Properties

Create, Filter, Group, Sort, Update

Description

Account access level granted to users assigned to this territory.



 |
| CaseAccessLevel | 

Type

picklist

Properties

Create, Filter, Nillable, Group, Sort, Update

Description

Case access level granted to users assigned to this territory.



 |
| ContactAccessLevel | 

Type

picklist

Properties

Filter, Group, Nillable, Sort

Description

A value that represents the type of access granted to the target Group, UserRole, or User for any associated contacts. The possible values are:

- None
- Read
- Edit

![Note](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/images/icon_note.png)

#### Note

When DefaultContactAccess is set to “Controlled by Parent,” you can’t create or update this field.















 |
| Description | 

Type

string

Properties

Create, Filter, Nillable, Sort, Update

Description

A description of the territory that is 1,000 characters or less.



 |
| DeveloperName | 

Type

string

Properties

Create, Defaulted on create, Filter, Group, Sort, Update

Description

The unique name of the object in the API. This name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. In managed packages, this field prevents naming conflicts on package installations. With this field, a developer can change the object's name in a managed package and the changes are reflected in a subscriber's organization. Corresponds to **Territory Name** in the user interface.

This field is available in API version 24.0 and later.

When creating large sets of data, always specify a unique DeveloperName for each record. If no DeveloperName is specified, performance slows down while Salesforce generates one for each record.





 |
| ForecastUserId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

ID of the Forecast Manager, who is the user to whom forecasts from this territory’s child territories roll up.



 |
| MayForecastManagerShare | 

Type

boolean

Properties

Create, Defaulted on create, Filter, Group, Sort, Update

Description

Indicates whether the forecast manager can manually share their own forecast.



 |
| Name | 

Type

string

Properties

Create, Filter, Group, Sort, Update

Description

A name for the territory. Limit is 80 characters. Corresponds to **Label** on the user interface.



 |
| OpportunityAccessLevel | 

Type

picklist

Properties

Create, Filter, Group, Sort, Update

Description

Opportunity access level granted to users assigned to this territory.



 |
| ParentTerritoryID | 

Type

reference

Properties

Create, Filter, Nillable, Update

Description

Territory immediately above this territory in the territory hierarchy. Label is **Parent Territory ID**.



 |
| RestrictOppTransfer | 

Type

boolean

Properties

Create, Defaulted on create, Filter, Update

Description

Indicates whether the opportunities associated with this territory are kept within the bounds of this territory and this territory’s children when account assignment rules are run (true), or if opportunities associated with this territory can be assigned to other nodes of the territory hierarchy when account assignment rules are run (false). Label is **Confine Opportunity Assignment**.



 |

## Usage

Use the Territory object to query your organization’s territory hierarchy. Use it to obtain valid territory IDs when querying or modifying records associated with territories.

#### See Also

- [AccountTerritoryAssignmentRule](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_accountterritoryassignmentrule.htm "An account assignment rule that assigns accounts to territories based on account fields. Available if Sales Territories has been enabled.")
- [AccountTerritoryAssignmentRuleItem](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_accountterritoryassignmentruleitem.htm "A row of selection criteria for an AccountTerritoryAssignmentRule object. Available if Sales Territories has been enabled.")
- [UserTerritory](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_userterritory.htm "Represents a User who has been assigned to a Territory.")