# msgetterritoryid()

Return the ID of a nominated territory. This can then be mapped to the territoryid field of the account table.

## Arguments

Argument | Data Type | Description
Name | string | Name of the territory

## Returns

The string territory ID.

## Description

An account or a system user can be assigned to a territory.

To assign an account to a territory, map the territory ID to the account.territoryid field on an insert or update operation.

To assign a systemuser to a territory, map the territory ID to the systemuser.territoryid field.

## Examples

Example | Description
--- | ---
msgetterritoryid("US") | Get the user ID for the "US" territory

## See Also