When a record's address changes
Status: Describes package version 1.3.0. Walked end to end for Accounts in a test org upgraded Re-read for 1.4.0.5 on 2026-11-07: the path now runs through one engine, TerritoryAssignmentEngine.cls, for every object (DB-21). from 1.1.0.1: a geocoded account was linked, moved, and kept a hand-made assignment. The other-object path is covered by the package's tests, not by a walk in a customer-shaped org.
From version 1.3.0, Territory Mapper keeps assignments up to date on its own. Every five minutes it looks at the records that changed since its last look:
- A record that has just got coordinates is assigned. That includes an address Salesforce geocodes after the record is saved, which used to wait for the hourly pass. For accounts, "assigned" means holding a territory in any model, including a model in Planning or one you imported associations into: an account that already holds one is left alone and is not assigned in the active model until those other associations are removed — a known defect in 1.4.0 (
216-F1), see Which objects a model assigns. - A record whose coordinates moved is checked again. If it is now in a different territory, it moves there. If it is in the same territory, nothing changes. An account whose standard Exclude from territory assignment rules box is ticked is left out of this check.
It only acts on records that change after it starts. Turning it on does not re-check every record you already have.
How long it takes
| Step | Typical time |
|---|---|
| Salesforce geocodes the new address | Up to about 15 minutes in our tests, after the address was edited |
| Territory Mapper notices the new coordinates | Up to about 5 minutes, plus 2 minutes it waits so it never reads a save that is still in progress |
So an address edit is not re-assigned instantly. Allow about 20 minutes before you look. Until Salesforce writes the new coordinates, the record has not moved as far as Territory Mapper can tell, so nothing happens and nothing is wrong.
The five-minute check starts after setup step 9. The hourly job, Territory Mapper — Assignment Retry, starts it, and restarts it if it ever stops. Once an administrator has opened the map once (which repairs that job), the check begins at the next top of the hour.
Hand-made assignments are never removed
Territory Mapper records what it assigned in an assignment stamp on each record: where the record was, which territories it gave it, and which owner it set. When the record moves, it changes only what is in its stamp. Anything else was put there by a person, and it is left alone.
| When a record moves… | What Territory Mapper set | What a person set |
|---|---|---|
| Account: a territory in Assigned Territories | Removed, if the new address is outside it. The new territory is added | Kept. A Manual assignment kept row says so |
| Other objects: the territory field | Follows the record to its new territory | Kept, and the owner with it. A Manual assignment kept row says so |
| Other objects: the owner (or other assignee field) | Follows the new territory's role holder | Kept, unless the object is set to Always (below). A Manual assignment kept row says so |
A Manual assignment kept row appears on the Assignment Exceptions tab. It is not an error. It asks you to decide: if the hand-set territory or owner should stay, dismiss the row. If it should not, change or remove it on the record, and Territory Mapper takes over from the record's next change.
Two more rules:
- A record that moves outside every territory loses the territories Territory Mapper gave it, and an Outside every territory row is written. Its owner is not changed.
- A move inside the same territory changes nothing. The owner is not picked again, so a territory with several role holders does not reshuffle its records every time an address is corrected.
Territory Mapper never changes an Account's owner. For accounts it manages territory membership only.
Records assigned before version 1.3.0
A record assigned by an earlier version has no stamp, so Territory Mapper cannot prove it set anything on it. It treats those assignments as hand-made, and errs on the side of keeping them:
- The first time it sees such a record change, it only records where the record is. Nothing else changes. If that first change is the address move itself, the move is not followed.
- On a later move, the old assignment stays, with a Manual assignment kept row. An account gains its new territory and keeps the old one; another object keeps its old territory and owner.
What to do: work the Manual assignment kept rows. Remove the old territory from the record by hand where it no longer applies. Territory Mapper owns only what it assigns from then on, so the rows stop as your records are re-assigned.
Keeping a history
To see who changed a territory and when, turn on Field History Tracking for the territory field and the owner field on each object you assign. Territory Mapper keeps no separate log of its changes.
Settings for objects other than Account
Accounts follow their billing address with no setting at all. For any other object, these fields on its Territory Object Config record decide what happens. The rest of that record is described in Which objects a model assigns.
| Field | What it does |
|---|---|
| Assignment Stamp Field | The API name of a Text field (length 255) you create on the object. Territory Mapper writes its stamp there. Without it, new records are still assigned (given a Territory Field — see below), but a move is not followed. A field shorter than 58 characters is refused |
| Reassign Owner On Move | Only if Territory Mapper set it (the default): when the record moves territory, the owner changes only if Territory Mapper set the current one, or it is blank. An owner someone chose by hand stays. Always: the owner always follows the new territory's role holder |
| Tie Break | Who receives the record when a territory has more than one holder of the role. ⚠️ Only two behaviours exist today. Leave unassigned writes no person at all, even when only one person holds the role. First, Round robin and All role holders all give the record to the first holder in a fixed order. Round robin and All are not built yet |
The first time Territory Mapper assigns a record, it sets the owner whatever Reassign Owner On Move says. The setting is about moves only.
⚠️ This needs a Territory Field. Territory Mapper finds the records that still need assigning by an empty Territory Field. Without one it looks at the Assignee Field instead, and an owner field is never empty: Salesforce fills it with whoever created the record. So a configuration that writes
OwnerIdand has no Territory Field never assigns a record on its own, and no exception row says so. Name a Territory Field on the object's configuration — see One thing you must provide yourself — or call the Assign Territory action from a Flow.
Objects that Salesforce does not geocode
Salesforce's geocoding rules cover a few standard addresses, such as an account's billing address and a lead's address — see Geocoding clean rules. Your own custom objects have no geocoding rule. Their latitude and longitude must be filled in some other way: by your integration, a data load, or a Flow.
Territory Mapper finds the coordinate fields itself when the object has only one pair. If it has more than one, name the pair in Latitude Field and Longitude Field on the object's configuration — see Which coordinates it uses. When those fields change, the record is treated as moved, exactly like a geocoded address, provided the object has an Assignment Stamp Field.
Turning it off
There is no separate switch. The check stops when the scheduled job Territory Mapper — Assignment Retry is deleted (Setup → Scheduled Jobs).
⚠️ Treat that as a short pause, not an off switch. Deleting the job also stops the hourly retries, and since version 1.4.0 the next time someone who can manage territories opens the map or the Assignment Exceptions tab, a missing job is recreated. A package upgrade also replaces it; it then fails until an administrator opens the map once (setup step 9).
Last verified: 2026-11-07 · Owner: MapKraken Labs LLC
Something on this page wrong, or a setup step missing? That is a documentation defect and we want it — tell us and this is the page that gets fixed.