Introduction
Sometimes it may beed needed to query Territories assigned to Lead or Account.
Solution
SELECT ObjectId, AssociationCause, SobjectType, Territory2Id FROM ObjectTerritory2Association
Field Name | Details |
---|---|
AssociationCause | Possible values are: Territory2AssignmentRule—Territory assignment rule association Territory2Manual—Manual association |
ObjectId | Lookup Refers ToAccount or Lead |
SobjectType | Account or Lead |
Territory2Id | Territory Id |