Assign Territory to User
sf_assign_territory_to_userAssign a Salesforce user to an Enterprise Territory Management territory to grant visibility into accounts within that territory. Specify username, territory API name, and optional role.
Instructions
Assigns a user to an Enterprise Territory Management territory via the UserTerritory2Association SObject. Users assigned to a territory get visibility into accounts in that territory.
username or userId: identify the user territoryName: DeveloperName of the Territory2 to assign roleInTerritory: optional role — 'Salesperson', 'Manager', or 'BusinessUser'
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes | Salesforce username to assign | |
| territoryName | Yes | Territory API name to assign user to | |
| roleInTerritory | No | User role within the territory | Salesperson |