---
schema_version: "1"
id: 431302f1ac786b98c364e1868726b6e85acb6333345d1c0cc53f3252da82a311
title: RoleOrTerritory
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_roleorterritory.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_roleorterritory.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 022b57c6486c59444f1a38f9ec7e607a85506752fb241eb0ff19cfd39bf74259
description: Represents the common base type and valid values for role or territory.
---
# RoleOrTerritory

Represents the common base type and valid values for role or territory.

## Version

RoleOrTerritory components are available in API version 24.0 and later.

You can’t create a RoleOrTerritory component directly. Use the Role or Territory metadata types instead.

## Fields

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d828805e65">Field Name</th>

              <th class="featureTableHeader  " id="d828805e68">Field Type</th>

              <th class="featureTableHeader  " id="d828805e71">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d828805e65" data-title="Field Name"><span class="keyword parmname">caseAccessLevel</span></td>

              <td class="entry" headers="d828805e68" data-title="Field Type">string</td>

              <td class="entry" headers="d828805e71" data-title="Description">Specifies whether a user can access other users’ cases that are associated with
                accounts the user owns. Valid values are:<ul class="ul bulletList">
                  <li class="li"><samp class="codeph apex_code">Read</samp></li>

                  <li class="li"><samp class="codeph apex_code">Edit</samp></li>

                  <li class="li"><samp class="codeph apex_code">None</samp></li>

                </ul>
                <p class="p">This field is not visible if your organization’s sharing model for cases is Public
                  Read/Write.</p>
                <p class="p" id="default_value"><a name="default_value"><!-- --></a>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.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d828805e65" data-title="Field Name"><span class="keyword parmname">contactAccessLevel</span></td>

              <td class="entry" headers="d828805e68" data-title="Field Type">string</td>

              <td class="entry" headers="d828805e71" data-title="Description">Specifies whether a user can access other users’ contacts that are associated with
                accounts the user owns. Valid values are:<ul class="ul bulletList">
                  <li class="li"><samp class="codeph apex_code">Read</samp></li>

                  <li class="li"><samp class="codeph apex_code">Edit</samp></li>

                  <li class="li"><samp class="codeph apex_code">None</samp></li>

                </ul>
                <p class="p">This field is not visible if your organization’s sharing model for contacts is
                  Public Read/Write or Controlled by Parent.</p>
                <p class="p">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.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d828805e65" data-title="Field Name"><span class="keyword parmname">description</span></td>

              <td class="entry" headers="d828805e68" data-title="Field Type">string</td>

              <td class="entry" headers="d828805e71" data-title="Description">The description of the role or territory.</td>

            </tr>

            <tr>
              <td class="entry" headers="d828805e65" data-title="Field Name"><span class="keyword parmname">fullName</span></td>

              <td class="entry" headers="d828805e68" data-title="Field Type">string</td>

              <td class="entry" headers="d828805e71" data-title="Description">The unique identifier for API access. The <span class="keyword parmname">fullName</span> 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 <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm" title="The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.">Metadata</a> component.</td>

            </tr>

            <tr>
              <td class="entry" headers="d828805e65" data-title="Field Name"><span class="keyword parmname">mayForecastManagerShare</span></td>

              <td class="entry" headers="d828805e68" data-title="Field Type">boolean</td>

              <td class="entry" headers="d828805e71" data-title="Description">Indicates whether the forecast manager can manually share their own forecast.</td>

            </tr>

            <tr>
              <td class="entry" headers="d828805e65" data-title="Field Name"><span class="keyword parmname">name</span></td>

              <td class="entry" headers="d828805e68" data-title="Field Type">string</td>

              <td class="entry" headers="d828805e71" data-title="Description">Required. The name of the role or territory.</td>

            </tr>

            <tr>
              <td class="entry" headers="d828805e65" data-title="Field Name"><span class="keyword parmname">opportunityAccessLevel</span></td>

              <td class="entry" headers="d828805e68" data-title="Field Type">string</td>

              <td class="entry" headers="d828805e71" data-title="Description">Specifies whether a user can access other users’ opportunities that are associated
                with accounts the user owns. Valid values are:<ul class="ul bulletList">
                  <li class="li"><samp class="codeph apex_code">Read</samp></li>

                  <li class="li"><samp class="codeph apex_code">Edit</samp></li>

                  <li class="li"><samp class="codeph apex_code">None</samp></li>

                </ul>
                <p class="p">This field is not visible if your organization’s sharing model for opportunities is
                  Public Read/Write.</p>
                <p class="p">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.</p>
              </td>

            </tr>

          </tbody>

        </table>

## Declarative Metadata Sample Definition

The following is the definition of a role.

<?xml version="1.0" encoding="UTF-8"?>
<Role xmlns="http://soap.sforce.com/2006/04/metadata">
    <caseAccessLevel\>Edit</caseAccessLevel\>
    <contactAccessLevel\>Edit</contactAccessLevel\>
    <description\>Sample Role</description\>
    <mayForecastManagerShare\>false</mayForecastManagerShare\>
    <name\>R22</name\>
    <opportunityAccessLevel\>Read</opportunityAccessLevel\>
</Role\>

The following is the definition of a territory.

<?xml version="1.0" encoding="UTF-8"?>
<Territory xmlns="http://soap.sforce.com/2006/04/metadata">
    <accountAccessLevel\>Edit</accountAccessLevel\>
    <caseAccessLevel\>Edit</caseAccessLevel\>
    <contactAccessLevel\>Edit</contactAccessLevel\>
    <description\>Sample Territory</description\>
    <mayForecastManagerShare\>false</mayForecastManagerShare\>
    <name\>T22name</name\>
    <opportunityAccessLevel\>Read</opportunityAccessLevel\>
</Territory\>

#### See Also

- [Role](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_role.htm "Represents a role in your organization.")
- [Territory](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_territory.htm "Represents a territory.")