A9. Territory Management
Administrator Guide. Territories decide which salesperson's patch a client entry belongs to, and Territory Alignment applies those rules to your client list in bulk. Because a bulk run can change thousands of records at once, nothing is written until you have seen the list of changes and approved it, and every run can be undone.
Open it from the ribbon: Setup ▸ Territory ▸ Territory Management.
The window has two tabs — Setup (define the territories) and Alignment (apply them) — and a Close button.
The Setup tab
| Part | What it is |
|---|---|
| The list | Every territory, in priority order — the one at the top is tested first. Two columns: Territory and Account Manager. |
| Add… | Create a territory. |
| Delete | Delete the selected territory (see Deleting a territory below). |
| Modify… | Edit the selected territory's name, account manager and rules. |
| Move Up / Move Down | Change the priority order. |
| Description | A read-only summary of the selected territory: its account manager, whether it is active, and its rules written out in plain English. |
Delete, Modify…, Move Up and Move Down stay greyed out until you select a territory — Move Up is also off for the top row, and Move Down for the bottom one.
Adding or modifying a territory
Add… and Modify… open the same dialog.
- Territory name — required, up to 79 characters, and it must be unique.
- Active — an inactive territory keeps its definition but is skipped by Align Territories.
- Account manager — tick one or more users.
- One manager: alignment sets each matched entry's territory and its Account Manager.
- None, or more than one: alignment sets the territory only and leaves each entry's Account Manager exactly as it is. (Recording several account managers on one client entry needs rows in the record-access security table, which TechieCRM deliberately does not write.)
- Alignment rules — the conditions an entry must meet to join this territory. Use Add Rule… / Edit Rule… / Remove Rule. A rule is a field, a condition and a value:
| Fields | Conditions |
|---|---|
| Country · State / Province · City · Zip / Postal Code · Name · Company (Firm) · Address line 1 · Department · Division · Owner · Account Manager | is · is not · begins with · contains · is one of · is empty · is not empty |
For is one of, separate the values with commas — BC, AB, SK. Comparisons ignore case and
surrounding spaces.
All the rules must be true for an entry to join the territory.
Catch-all territories
A territory with no rules at all is a catch-all. During alignment it takes every entry that no territory above it has already claimed — and alignment stops there. Territories listed below a catch-all are never tested. The dialog says so in the rules box and in the Description panel; put your catch-all at the bottom of the list unless you mean to shut off everything under it.
Deleting a territory
- If no client entries carry the territory, you are asked to confirm, and it is deleted.
- If entries do carry it, clearing them is a bulk change, so it goes through the same review screen as an alignment run: you see every entry that would be cleared, you approve it, and it is recorded so Undo last alignment… can put those entries back. If any entry fails to clear, the territory is not deleted.
The Alignment tab
Territory alignment conditions
Choose which client entries the run looks at:
| Condition | Meaning |
|---|---|
| Client entries created/modified since (date) | Only entries created or last modified on or after that date. This is the default; the date box is only live for this condition. |
| All client entries | Every company and individual in the database. |
| All entries in the Clients window | Only what the Clients list is currently showing (after a search or a favourite list). Greyed out when the Clients module is not open. |
| Selected entries in the Clients window | Only the rows you have highlighted. Greyed out when nothing is selected. |
Only companies and individuals are ever aligned. Contacts inside a company are never touched.
Options
- Unassign territories — instead of aligning, clear the territory from every entry in scope.
- Overwrite territories set by manager — an entry whose Territory Status is Set by Manager is protected: alignment leaves it alone and counts it under Skipped. Tick this to change those entries as well.
Align Territories
Align Territories does not write. It works out what would change and shows you a review window listing every affected entry — its name, its territory now, its territory after, and the status it would end up with. Nothing happens until you press Apply; Cancel leaves the database untouched.
When there is nothing to change, it tells you so and no review window appears.
Alignment results
After a run, the four counters report what happened:
| Counter | Meaning |
|---|---|
| Aligned | Entries given a territory by a rule, or dropped out of one because no rule matched any more. |
| Unassigned | Entries cleared by the Unassign territories option (or by clearing a territory before deleting it). |
| Skipped | Entries already correct, plus entries protected by Set by Manager. |
| Failed | Entries that could not be written. The message under the counters names the first few. |
Undo last alignment…
Every run records the previous territory, status and account manager of every entry it changed. Undo last alignment… puts them all back. The button is greyed out when there is no run to undo, and its tooltip names the run, who ran it and when. A run can only be undone once.
What a territory changes on a client entry
| Field | Set to |
|---|---|
| Territory | The winning territory's name (shown in the client's key fields). |
| Territory Status | Set by Rule when a rule matched · Unaligned when an entry lost its territory because nothing matched · Unassigned when it was cleared. The other two values, Set by User and Set by Manager, are written elsewhere in the CRM; alignment only reads them. |
| Account Manager | Only when the territory has exactly one account manager. |
Every entry alignment changes also has its last-modified date updated.
Where the information is stored
| What | Where |
|---|---|
| Territories, their order and their active flag | AMGR_Territory — the source CRM's own table |
| Account managers per territory | AMGR_Territory_Managers |
| Each entry's territory and status | AMGR_Client_Tbl.Territory_Id / Territory_Status (+ Assigned_To) |
| Alignment rules | TCRM_TerritoryRule |
| Alignment runs and the undo history | TCRM_TerritoryAlignment / TCRM_TerritoryAlignmentItem |
The three TCRM_ tables are created automatically the first time you connect (or the first time
you open this window). If your database login may not create tables, ask an administrator to run
docs/db/territory/01_schema.sql once. Without those tables the territory list, Add, Modify,
Delete, Move and the alignment itself all still work — only the rules and the undo history
are unavailable, so every territory behaves as a catch-all.
If this database is also used by the source CRM's own desktop client, do not run its Territory Alignment. It stores its rules differently, so it would treat a TechieCRM rule-based territory as a catch-all and sweep every entry into it.
Not yet available
- Setting a territory by hand on one client entry from the client dialog (status Set by User). Today a territory is assigned by alignment, and the client entry shows it read-only in its key fields.
- Rules on user-defined fields — the rule fields are the built-in address-book fields listed above.
- Multiple account managers written onto the client entry itself (see Account manager, above).
- Territory columns in the Clients list column setup, and territory-based reporting.