Territory

Represents a territory.

Parent Type 

This type extends RoleOrTerritory and inherits its fields.

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 

Introduced in API version 24.0.

Fields 

accountAccessLevel 

  • Type: string (enumeration of type string)

  • Required: No

  • Introduced: API version 31.0

  • Description: Specifies whether users in this territory can access accounts that are assigned to this territory and are otherwise inaccessible.

    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.

  • Possible values:

    • Read
    • Edit
    • All

fullName 

  • Type: string
  • Required: No
  • Description: 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 

  • Type: string
  • Required: No
  • Description: 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.