Newer Version Available

This content describes an older version of this product. View Latest

Territory

Represents a territory in your organization.

Declarative Metadata File Suffix and Directory Location

The file suffix for territory components is .territory and components are stored in the territories directory of the corresponding package directory.

Version

Territory components are available in API version 24.0 and later.

Fields

This metadata type extends to subtype RoleOrTerritory.

Field Name Field Type Description
accountAccessLevel string Specifies whether users in this territory can access accounts that are assigned to this territory and are otherwise inaccessible. Valid values are:
  • Read
  • Edit
  • All

If your organization’s sharing model for accounts is Public Read/Write, valid values are only Edit and All.

If no value is set for this field, this field value uses the default access level that is specified in the Manage Territory page in Setup.

This field is available in API version 31.0 and later.

fullName string The unique identifier for API access. The fullName can contain only underscores and alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. This field is inherited from the Metadata component. Corresponds to Territory Name in the user interface.
parentTerritory string The territory above this territory in the territory hierarchy.

Declarative Metadata Sample Definition

The following is the definition of a territory.
1<?xml version="1.0" encoding="UTF-8"?>
2<Territory xmlns="http://soap.sforce.com/2006/04/metadata">
3    <accountAccessLevel>Edit</accountAccessLevel>
4    <caseAccessLevel>Edit</caseAccessLevel>
5    <contactAccessLevel>Edit</contactAccessLevel>
6    <description>Sample Territory</description>
7    <mayForecastManagerShare>false</mayForecastManagerShare>
8    <name>T22name</name>
9    <opportunityAccessLevel>Read</opportunityAccessLevel>
10</Territory>

Wildcard Support in the Manifest File

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.