ServiceTerritory

Represents a geographic or functional region in which work can be performed in Salesforce Scheduler. This object is available in API version 38.0 and later.

Supported Calls 

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

Special Access Rules 

Salesforce Scheduler must be enabled.

Usage 

If you want to use service territories, determine which territories you must create. Depending on how your business works, you can decide to create territories based on cities or counties, or on functional categories such as sales versus service. If you plan to build out a hierarchy of service territories, create the highest-level territories first.

For example, you can create a hierarchy of territories to represent the areas where your team works in California. Include a top-level territory named California, three child territories named Northern California, Central California, and Southern California, and a series of third-level territories corresponding to California counties. Assign service resources to each county territory to indicate who is available to work in that county.

Fields 

Address 

  • Type: address
  • Properties: Filter
  • Description: An address to associate with the territory. You can want to list the address of the territory’s headquarters.

City 

  • Type: string
  • Properties: Create, Filter, Group, Nillable, Sort, Update
  • Description: The city of the associated address. Maximum length is 40 characters.

Country 

  • Type: string
  • Properties: Create, Filter, Group, Nillable, Sort, Update
  • Description: The country to associate with the territory. Maximum length is 80 characters.

Description 

  • Type: textarea
  • Properties: Create, Nillable, Update
  • Description: The description of the territory.

IsActive 

  • Type: boolean
  • Properties: Create, Defaulted on create, Filter, Group, Sort, Update
  • Description: Indicates whether the service territory is meant to be used. If a territory is inactive, you can’t add members to it or link it to service appointments.

LastReferencedDate 

  • Type: dateTime
  • Properties: Filter, Nillable, Sort
  • Description: The date when the territory was last modified. Its label in the user interface is Last Modified Date.

LastViewedDate 

  • Type: dateTime
  • Properties: Filter, Nillable, Sort
  • Description: The date when the territory was last viewed.

Name 

  • Type: string
  • Properties: Create, Filter, Group, idLookup, Sort, Update
  • Description: The name of the territory.

OperatingHoursId 

  • Type: reference
  • Properties: Create, Filter, Group, Sort, Update
  • Description: The territory’s operating hours, which indicate when service appointments within the territory can occur. Service resources who are members of a territory automatically inherit the territory’s operating hours unless different hours are specified on the resource record. This is a relationship field.
  • Relationship Name: OperatingHours
  • Relationship Type: Lookup
  • Refers To: OperatingHours

PostalCode 

  • Type: string
  • Properties: Create, Filter, Group, Nillable, Sort, Update
  • Description: The postal code of the address associated with the territory. Maximum length is 20 characters.

PricebookId 

  • Type: reference
  • Properties: Create, Filter, Group, Nillable, Sort, Update
  • Description: This field creates a foreign key relationship with the PriceBook record, storing data related to pricing. This is a relationship field.
  • Relationship Name: PriceBook
  • Relationship Type: Lookup
  • Refers To: PriceBook2

State 

  • Type: string
  • Properties: Create, Filter, Group, Nillable, Sort, Update
  • Description: The state of the address associated with the territory. Maximum length is 80 characters.

Street 

  • Type: textarea
  • Properties: Create, Filter, Group, Nillable, Sort, Update
  • Description: The street number and name of the address associated with the territory.

Associated Objects 

This object has the following associated objects. If the API version isn’t specified, they’re available in the same API versions as this object. Otherwise, they’re available in the specified API version and later.

ServiceTerritoryChangeEvent (API version 48.0): Change events are available for the object.

ServiceTerritoryFeed: Feed tracking is available for the object.

ServiceTerritoryHistory: History is available for tracked fields of the object.

ServiceTerritoryOwnerSharingRule: Sharing rules are available for the object.

ServiceTerritoryShare: Sharing is available for the object.