---
schema_version: "1"
id: 9b9e5d4ede981e43466b129a9fcb6bba2359cf7960b6fe516a818f1dda48bc1d
title: UserTerritory
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_userterritory.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_userterritory.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: ddd802097d4a0e68661513a0754ecaa407b827cda0d75b8813492d7c18c4b31e
description: Represents a User who has been assigned to a Territory.
---
# UserTerritory

Represents a User who has been assigned to a Territory.

## Supported Calls

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

## Special Access Rules

- Only available if territory management has been enabled for your organization.
- As of Spring ’20 and later, only users with the View Setup and Configuration permission can access this object, and only users with the Manage Territories permission can edit this object.

## Fields

| Field | Details |
| --- | --- |
| IsActive | 
Type

boolean

Properties

Defaulted on create, Filter

Description

Indicates whether the user is active in the given territory (true), or inactive in the given territory (false):

- Users who are active in a territory are explicitly assigned to the territory and can have open opportunities, closed opportunities, or no opportunities associated with that territory.
- Users who are inactive in a territory are not explicitly assigned to the territory, but own an open or closed opportunity that is associated with the territory. For example, a user may have been transferred out of a territory, but still own opportunities in his or her old territory.

Until a user is deleted from a territory (not simply removed from the territory), the record is not returned in a getDeleted() call.





 |
| IsDeleted | 

Type

boolean

Properties

Defaulted on create, Filter

Description

Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is **Deleted**.



 |
| TerritoryId | 

Type

reference

Properties

Create, Filter

Description

ID of the Territory to which the user has been assigned. This field is required when creating a record in API version 20.0 and later.



 |
| UserId | 

Type

reference

Properties

Create, Filter

Description

ID of the user. This field is required when creating a record.



 |

## Usage

If a user is inactive in a territory, and the opportunities they own that are associated with the territory are all closed, the user is not returned in the Territories related list on the User page in Setup. Regardless of whether the user is inactive or the opportunities are closed, the user is returned in the Quotas related list.

#### See Also

- [Territory](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_territory.htm "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.")
- [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.")