Setting up the org
Status: ⚠️ Written from the program's own install requirements and walked in part against real managed installs — not verified end to end on one fresh subscriber org in one pass — see What has not been verified.
Everything that has to be true before Territory Mapper works, in the order to do it.
This page exists because four of the steps below fail silently when they are missed — no error, no warning, nothing in a log. That is why it is blunt about which steps have no error message, and why the verification section at the foot is worth running even when everything looks fine.
The order
| # | Step | If you skip it |
|---|---|---|
| — | Enable Enterprise Territory Management | Nothing installs correctly — the objects Territory Mapper decorates do not exist |
| — | Install the package | — |
| 1 | Enable geocoding clean rules | 🔴 Nothing is ever assigned. No error. |
| 2 | Connect the org to the map service (Register this org) | 🔴 Nothing is ever assigned. Records pile up in the exception queue as NOT_CONFIGURED |
| 3 | Grant users access to the credential | 🔴 Same symptom as 2, and it is a separate step people miss |
| 4 | Assign permission sets | Users see no app, or see it and can change nothing |
| 5 | Check the app's CORS entry | 🔴 The map cannot read your territories, and nothing can be saved. The map stops at "Territory Mapper is not yet connected to this Salesforce org", and any save fails with "Failed to fetch" |
| 6 | Create a Territory Type | No territory can be created, on the map or in Setup |
| 7 | Put the packaged layouts on your profiles | A Territory record shows none of Territory Mapper's fields, and its Assigned Users list cannot be reached |
| 8 | Put people into territories | 🔴 A user with the right permission sets sees an empty map |
| 9 | Open the map once | 🔴 Most records are never assigned, and every automatic retry fails as NOT_CONFIGURED |
| 10 | Define your territory roles | The role selector is empty and users cannot be added to territories at all — the Assign users button never enables |
| 11 | Show territories on the Account page | Accounts are assigned, but nobody can see it on the record |
| 12 | Activate the territory model, once it is built | The account's Assigned Territories list stays empty, and Salesforce grants none of the access its territories give |
Steps 1, 2, 3 and 9 all produce the same symptom — nothing is assigned — and they have different fixes. That is what the verification section at the foot of this page is for.
1. Enable geocoding clean rules
This has its own page, and it is the one to do carefully: Geocoding clean rules.

The geocoding rules. A record with no latitude and longitude cannot be placed on a map, so nothing is assigned to it — this page is the first place to look when assignment produces nothing at all.
In short: Setup → Data Integration Rules → activate the Account billing address rule, plus the address rule for any other object you assign (for example Lead Address), then process existing records.
2. Connect the org to the map service
Territory Mapper resolves a point against boundaries by calling the MapKraken map service. Before the service answers, your org has to prove who it is, once, with a certificate of its own. There is no token to paste. From version 1.3.0, Territory Mapper signs every request itself.
Before you start, do step 3 for yourself. Registering calls the service through the KoopGIS credential, so it fails without that access, and nothing is changed.
- Create a certificate. Setup → Certificate and Key Management → Create Self-Signed Certificate. Give it a label and a Unique Name, for example TerritoryMapper. Leave the other values at their defaults.
- Open the Territory Mapper Setup tab (App Launcher → Territory Mapper Setup).
- In Connect this org to the map service, enter the certificate's Unique Name and press Register this org.
You must be an administrator with the API Enabled permission and the Territory Mapper Administrator permission set.
A green message means it worked, and the badge at the top of the page then reads Configured — RS256, certificate followed by your certificate's name. Pressing the button again shows a blue message saying the org is already registered; that is information, not an error. A red message says what went wrong and that nothing was changed, so you can fix the cause and press it again.
| The badge reads | Means |
|---|---|
| Configured — RS256, certificate … | The org is registered. This step is done |
| Older shared-secret connection — register this org below | The org connected with the method used before version 1.3.0. Register this org to move it to its own certificate |
| Not connected — register this org below | Not registered yet. Do this step |
The page has one form, Connect this org to the map service. Above it, Current signing mode and Certificate name show what the org uses now; after a successful registration they read RS256 and your certificate's name. (Versions before 1.4.0 also showed a Signing secret form above it; it belonged to the older connection method and is gone.)
If the address looks wrong, stop and tell us
Setup → Named Credentials, on the Named Credentials tab: KoopGIS → Edit → URL should already name a real MapKraken host. You are not expected to set it — the package ships it.

The Named Credentials tab, with KoopGIS and the address the package ships in its URL column. This is how your org reaches the mapping service.
🔴 If it instead reads https://__KOOP_HOST__, that is a packaging defect, not a setup step. Nothing you can configure will make that address resolve. Contact MapKraken Labs and quote this paragraph; you need a corrected package version.
Until the org is registered, records land in the exception queue as NOT_CONFIGURED. That is the state every new installation starts in, so a queue full of NOT_CONFIGURED is the expected first sight of a new install, not a fault.
3. Grant users access to the credential
A separate step from 2, and the one most often missed.
Every request to the map service goes through the KoopGIS credential, and a user can use it only when a permission set lets them. ⚠️ The three packaged permission sets cannot hold this grant — they are managed, so their External Credential Principal Access page has no Edit button. Create your own permission set; this is the only route, not a fallback.
- Setup → Permission Sets → New. Any label will do, for example Territory Mapper Koop Callout.
- Open it → External Credential Principal Access → Edit → add KoopGIS - KoopServiceAccount → Save. Give it nothing else. ⚠️ The page above it, External Data Source Access, looks alike and is not the one.
- Manage Assignments → assign it to every user whose record edits should be assigned — read-only users included — and to the administrator who does step 2 and step 9.
Missed, this looks exactly like step 2: nothing is assigned, and the records land as NOT_CONFIGURED. One administrator's edits being assigned while ordinary users' are not is this step, for those users.
4. Assign permission sets

The three permission sets the package installs. The person who installed the package already holds all three; nobody else holds any.
| Permission set | Label in Setup | Gives |
|---|---|---|
| Territory Mapper User | Territory Mapper - Viewer (read only) | The app, the map and its tab, the territory tree, and read access to the exception queue. Everyone who opens the map needs this one |
| Territory Manager | Territory Mapper - Administrator | Editing boundaries, acting on exceptions, adding users to territories, the Territory Mapper Setup tab, and the Territory Object Configs tab for configuring which objects are assigned. ⚠️ It does not include the map itself — assign it together with the Viewer set |
| TM Territory Fields | Territory Mapper - Administrator (with Account fields) | The Territory Mapper Setup tab and the Account fields Location and Territory Assignment Stamp. It is not a superset of the Administrator set |
Everyone you assign here also needs your credential permission set from step 3.
Editing a boundary, resolving an exception and assigning users all require the Administrator set. A user with only the User permission set sees the queue and cannot clear it, which is intended — but it looks like a bug if nobody said so.
⚠️ Who may edit is decided by the Administrator permission set, not by the map. From version 1.4.0 a user without that set sees only the exploring controls — pan, zoom, search, legends, and the list of a territory's children; the buttons that add, draw, save, rename or assign are not shown, and the map service refuses such a user's edits as well. If a user with only the Viewer set still sees editing controls, tell MapKraken Labs.
⚠️ Known limitation — adding a user to a territory needs the Administrator set. There is no middle tier that would let, say, a sales-operations person manage territory membership without also being able to redraw boundaries. If that split matters to you, tell us: it is a small change to make and we would rather make it because a real organisation needs it than guess at the shape.
5. Check the app's CORS entry
Setup → Security → CORS. The package adds one entry, https://koop.mapkraken.com — the address the map is served from. Check it is there. If it is missing, add exactly that origin. Your org's other entries are unaffected; count the Territory Mapper one, not the total.

The CORS allowlist, with the one entry the package adds. If it is missing, the map cannot read your territories and every save fails.
The map is a web application that talks to your org directly from the browser — to read your territory hierarchy when it opens, and whenever it saves. If your org has not been told to accept requests from the app's address, the browser blocks them before they are sent. When the map opens it then stops at:
Territory Mapper is not yet connected to this Salesforce org
and any save attempt fails with:
Error creating territory: Failed to fetch
Nothing is wrong with your data, your credential or your permission sets when you see either — check this entry first.
Two rules the platform enforces, both of which catch people out:
- The origin must be
https://. Salesforce rejects anhttp://entry outright, with "Invalid protocol in a URL pattern. Origins must use the HTTPS protocol." - The origin is scheme + host + port, with no trailing path.
If saves still fail with that entry present, open your browser's developer console on a failed save — the blocked origin is named in the error.
6. Create a Territory Type
Setup → Territory Types → New Territory Type. Name it — Geographic is the name Territory Mapper looks for first — and give it a priority. One is enough.
Salesforce does not let a package create a Territory Type, so the install cannot do this for you, and without one no territory can be created anywhere. If your org already uses Enterprise Territory Management you probably have one already.
7. Put the packaged layouts on your profiles
The package ships page layouts for Territory and Territory Model with the map buttons already on them. But Salesforce has no Page Layout Assignment screen for Territory, so the assignment cannot be made from Setup — it has to be deployed with the Metadata API, for each profile that needs the map:
sf project deploy start --manifest package.xml --target-org <your-org>
where package.xml names the profile (<types><members>Admin</members><name>Profile</name></types>) and the profile file carries a layoutAssignments entry for Territory2-mapkraken__Territory Layout. Repeat for Territory2Model-mapkraken__Territory2 Model Layout. Deploy the profile only — including the layout itself fails, because it already exists in your org from the install.
Then open a Territory record and confirm the packaged fields are visible: Child Click Type, Feature Bounds, Level, Level Name. Until they are, the record's Assigned Users list is not reachable, so step 8 cannot be done.
8. Put people into territories
Setup → Territory Hierarchy → open each territory → Assigned Users → add the people who should see it.
🔴 What a user sees on the map comes from territory membership, not from the permission set. A user with every Territory Mapper permission set and no membership sees an empty map, and nothing says why. This is the most common reason a correctly set-up user sees nothing. Once your first territories exist you can also do this from the map — see People, roles and assignment.
9. Open the map once
Open the Territory Mapper tab once, as an administrator who holds the Viewer and Administrator permission sets (a System Administrator profile also works) and your credential permission set from step 3. Press nothing. The Administrator set alone does not open the map tab; if that is all you hold, open the Assignment Exceptions tab instead, which does the same thing.
The install schedules an hourly job, Territory Mapper — Assignment Retry. It retries failures, and it starts the five-minute check that assigns records Salesforce geocodes after they are saved — which is most of them — and follows records whose address changes. But an install runs as an internal Salesforce user your org cannot see, so that user can never be given the credential, and every pass of the job fails as NOT_CONFIGURED.
Since version 1.4.0, opening the map (or the Assignment Exceptions tab) as someone who can manage territories re-registers that job as you when it is broken: missing, owned by a user the org cannot see, or failing. A healthy job is left alone. It is a one-time step after an install or an upgrade. The five-minute check then starts at the next top of the hour.
If you prefer to see it happen, open the Assignment Exceptions tab instead: a green message Retry job re-registered confirms it. If that tab shows a yellow banner with a Re-register as me button instead, the automatic re-registration did not succeed; press the button, which does the same thing. In versions before 1.4.0 the button is the only way.
10. Define your territory roles
This has its own page: Defining territory roles.
The package ships no roles, deliberately. Until you add some, the role selector has nothing to offer and users cannot be added to territories at all.
11. Show territories on the Account page
The package does not change your page layouts. To see which territories an account is in, add the Assigned Territories related list to your Account page layout:
- Setup → Object Manager → Account → Page Layouts → open the layout your users see.
- In the palette at the top, choose Related Lists, and type Assigned in the palette's Quick Find box. The list is easy to miss without it.
- Drag Assigned Territories onto the layout, and Save.
Repeat for each Account layout in use.
12. Activate the territory model
Do this once your model has territories with boundaries — see Building a territory model.
Setup → Territory Models → click the model's name → Activate.
Until the model is active, Salesforce does not show its territories in an account's Assigned Territories list, and does not grant the record access that territory membership gives. In our test org the list stayed empty while the model was in planning, and filled once it was activated. Salesforce allows one active model at a time; read its warning on that page before you activate.
Verify the whole chain
Run these in order. Each one separates two different failures, so do not skip ahead — a later check is only meaningful once the earlier one passes.
1. Do records have coordinates?
SELECT BillingGeocodeAccuracy, COUNT(Id) FROM Account GROUP BY BillingGeocodeAccuracy
All null → step 1. Full reading of this result.
2. Did anything get assigned?
SELECT COUNT(Id) FROM ObjectTerritory2Association
Zero, while check 1 shows coordinates → the geocode half is fine and the callout half is not. Go to 3.
3. What does the exception queue say?
Open Assignment Exceptions and look at the categories:
| Mostly | Means | Fix |
|---|---|---|
NOT_CONFIGURED | The org is not registered, users cannot use the credential, or the hourly job still belongs to the install user | Steps 2, 3 and 9 |
NO_GEOCODE | A record lost its coordinates after it was queued. (Records that never had coordinates are not listed at all) | Re-geocode the record |
COVERAGE_GAP | Everything is working. Those records are outside every territory | Coverage gaps — a map problem, not a setup problem |
ENDPOINT_UNREACHABLE / TIMEOUT | The credential is set and the service is not answering | Retried automatically. Persisting for hours: contact MapKraken Labs |
| The queue is empty and nothing is assigned | Usually: no record has coordinates yet (step 1), or the five-minute check has not started — it starts at the top of the hour after step 9 | Wait for the top of the hour, then 10 minutes. Still empty: check Setup → Scheduled Jobs for Territory Mapper — Assignment Retry, and do step 9 |
After fixing a coverage gap or an address, select the affected rows and choose Re-run after a fix. NOT_CONFIGURED rows also clear on their own, about 25 an hour, once the org is connected; re-run them yourself to go faster.
What has not been verified
Stated so that nobody reads this page as a tested procedure.
These steps have now been walked, in part, against real managed installs on fresh Developer Edition orgs. The Setup screenshots on this page were captured against one such install on 2026-10-13, on version 1.1. Step 2 is new in version 1.3.0 and was walked in a test org upgraded from 1.1.0.1 to 1.3.0, together with steps 9, 11 and 12; that org's other steps were set up by script, not by hand.
What is still not verified is the whole chain end to end in one pass, by one person, on one fresh org, ending in assigned records. Individual steps have been confirmed; the sequence has not been walked start to finish.
What that means in practice: each step is something the package cannot ship, and the list has already grown twice — steps 6 to 9 were added on 2026-10-21, and 11 and 12 on 2026-10-30. What is unverified is the exact wording of screens, and whether a genuinely fresh org needs anything not listed here. If you hit a step that is not on this page, tell MapKraken Labs — it is a documentation defect, and this is the page that gets it.
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.