{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":15012,"path":"field-service-management/territory-planning-components-fsm.md","title":"Field Service Territory Planning components","bundle":null,"doc_type":null,"release":"australia","body":"\n# Field Service Territory Planning components\n\nSeveral types of components are installed with the Field Service Territory Planning feature, including tables, roles, script includes, and business rules.\n\n## Tables\n\nField Service Territory Planning adds the following tables.\n\n<table id=\"table_w5n_3bj_stb\"><thead><tr><th>\n\nTable\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nTerritorysn\\_tp\\_territory\n\n</td><td>\n\nStores information about territories, such as the name of a territory.\n\n</td></tr><tr><td>\n\nTerritory Conditionsn\\_tp\\_territory\\_condition\n\n</td><td>\n\nStores conditions added to a territory to filter the best matched territory for a work order or work order task.\n\n</td></tr><tr><td>\n\nTerritory Geographysn\\_tp\\_territory\\_geography\n\n</td><td>\n\nStores the geoJSON script information that is auto-generated when drawing a geography for the territories.\n\n</td></tr><tr><td>\n\nTerritory Groupsn\\_tp\\_territory\\_group\n\n</td><td>\n\nStores information about the qualification, dispatch, and assignment groups assigned to a territory.\n\n</td></tr><tr><td>\n\nTerritory Membership Overridesn\\_tp\\_territory\\_membership\\_override\n\n</td><td>\n\nStore information whether the agent or crew is primary or secondary member of the territory.\n\n</td></tr><tr><td>\n\nTerritory Modelsn\\_tp\\_territory\\_model\n\n</td><td>\n\nStore information about the default territory model and its mapped territories and resources.\n\n</td></tr><tr><td>\n\nTerritory Model Sourcesn\\_tp\\_territory\\_model\\_source\n\n</td><td>\n\nStore information about the source tables mapped to the territory model, such as wm\\_task and wm\\_order.\n\n</td></tr><tr><td>\n\nTerritory Managersn\\_tp\\_territory\\_manager\n\n</td><td>\n\nStores information regarding the managers of the territory.\n\n</td></tr></tbody>\n</table>## Roles\n\nField Service Territory Planning adds the following roles.\n\n<table id=\"table_rsw_l3l_stb\"><thead><tr><th>\n\nRoles\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nField Service Territory Edit Resource Allocation\\[sn\\_fsm\\_tp.fsm\\_territory\\_edit\\_resource\\_allocation\\]\n\n</td><td>\n\nEdit allocation of resources who are associated with the selected Field Service territory.\n\n</td></tr><tr><td>\n\nFSM Territory Planner\\[sn\\_fsm\\_tp.fsm\\_territory\\_planner\\]\n\n</td><td>\n\nCreate new Field Service territories along with the ability to view the existing Field Service territories, manage resource allocation in territories, and others.\n\n</td></tr><tr><td>\n\nFSM Territory Read\\[sn\\_fsm\\_tp.fsm\\_territory\\_read\\]\n\n</td><td>\n\nView Field Service territory data.\n\n</td></tr><tr><td>\n\nFSM Territory Manager\\[sn\\_fsm\\_tp.fsm\\_territory\\_manager\\]\n\n</td><td>\n\nManage Field Service territories and their related information. Additionally, inherits the role of territory resource manager.\n\n</td></tr><tr><td>\n\nFSM Territory Resource Manager\\[sn\\_fsm\\_tp.fsm\\_resource\\_manager\\]\n\n</td><td>\n\nManage Field Service resources of territory where the logged in user has been assigned as resource manager\n\n</td></tr></tbody>\n</table>## Script Includes\n\nField Service Territory Planning adds the following script includes.\n\n|Script include|Description|\n|--------------|-----------|\n|FieldServiceTerritoryPlanning|Contains the utility functions to provide data, such as territory details, assignment groups, or others to data brokers.|\n|MatchTerritoryCondition|Contains the utility functions Filter territories for work order task based on the filtering conditions used by the territory planning matching rules​.|\n|TerritoryFilters|Contains methods for all reference qualifiers to filter territory based on the corresponding groups, agents, crews, and parent territory.|\n|TerritoryMatchingDimensionLocation|Contains the utility functions to filter territories based on the task location to be used by the Matching Rule​.|\n|TerritoryPlanningHelpers|Contains helper methods for overall territory planning implementation.|\n|TerritoryPlanningAJAX|Ajax class that provides helper functions to verify if the territory planning plugin is active, get default model, populate territory in the work order task form, and validates the assignment group selected for a work order task.|\n\n## Business Rules\n\nField Service Territory Planning adds the following business rules.\n\n<table id=\"table_amv_vjl_stb\"><thead><tr><th>\n\nBusiness Rule\n\n</th><th>\n\nTable\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nDelete Agent Override\n\n</td><td>\n\nTerritory Group\\[sn\\_tp\\_territory\\_group\\]\n\n</td><td>\n\nDeletes the modified membership record of an agent if the corresponding group is deleted​ from the territory.\n\n</td></tr><tr><td>\n\nDelete Crew Member Override\n\n</td><td>\n\nTerritory Group\\[sn\\_tp\\_territory\\_group\\]\n\n</td><td>\n\nDeletes the modified membership record of a crew if the corresponding group is deleted​ from the territory.\n\n</td></tr><tr><td>\n\nPopulate assignment groups\n\n</td><td>\n\nTerritory Group\\[sn\\_tp\\_territory\\_group\\]\n\n</td><td>\n\nAuto-populates the corresponding assignment groups when adding a dispatch group to the territory.\n\n</td></tr><tr><td>\n\nUpdate Territory if not matched\n\n</td><td>\n\nWork Order Task\\[wm\\_task\\]\n\n</td><td>\n\nValidates and assigns the best territory for the selected assignment group​ if allow\\_assignment\\_override is selected.\n\n</td></tr><tr><td>\n\nValidate Qualification Group\n\n</td><td>\n\nWork Order\\[wm\\_order\\]\n\n</td><td>\n\nChecks if work order has a valid qualification group​.\n\n</td></tr><tr><td>\n\nAllow only unique group-territory\n\n</td><td>\n\nTerritory Group\\[sn\\_tp\\_territory\\_group\\]\n\n</td><td>\n\nPrevents adding a combination of duplicate groups that includes qualification, dispatcher, and assignment to a territory.\n\n</td></tr><tr><td>\n\nAllow only unique users\n\n</td><td>\n\nTerritory Membership Override\\[sn\\_tp\\_territory\\_membership\\_override\\]\n\n</td><td>\n\nPrevents the selection of duplicate user for a territory in the territory membership override table​.\n\n</td></tr><tr><td>\n\nCalculate geography bounding box\n\n</td><td>\n\nTerritory Geography\\[sn\\_tp\\_territory\\_geography\\]\n\n</td><td>\n\nCalculates the maximum or minimum latitude and longitude value from defined territory geography GeoJSON​.\n\n</td></tr><tr><td>\n\nCheck and create crew membership\n\n</td><td>\n\nWork order task\\[wm\\_task\\]\n\n</td><td>\n\nCreates a new territory membership record for the dynamically assigned crew when saving the work order task, setting the 'From' and 'To' dates to match the 'Effective start' and 'Effective end' dates of the crew.\n\n</td></tr><tr><td>\n\nMembership date validations\n\n</td><td>\n\nTerritory Membership Override\\[sn\\_tp\\_territory\\_membership\\_override\\]\n\n</td><td>\n\nValidates the dates entered in the **From** and **To** fields in the territory membership override table for a territory member.\n\n</td></tr><tr><td>\n\nValidate Color Field\n\n</td><td>\n\nTerritory\\[sn\\_tp\\_territory\\]\n\n</td><td>\n\nValidates the hexadecimal code for the color of a territory.\n\n</td></tr><tr><td>\n\nValidate Parent\n\n</td><td>\n\nTerritory\\[sn\\_tp\\_territory\\]\n\n</td><td>\n\nValidates the hierarchy of a parent territory.\n\n</td></tr><tr><td>\n\nValidate Source Table For Model\n\n</td><td>\n\nTerritory Model Source\\[sn\\_tp\\_territory\\_model\\_source\\]\n\n</td><td>\n\nPrevents duplicate entries for a model and source table on the territory model source.\n\n</td></tr><tr><td>\n\nValidate Territory Condition\n\n</td><td>\n\nTerritory Condition\\[sn\\_tp\\_territory\\_condition\\]\n\n</td><td>\n\nPrevents the creation of duplicate entries for territory conditions for a specific territory.\n\n</td></tr><tr><td>\n\nValidate territory geography name\n\n</td><td>\n\nTerritory Geography\\[sn\\_tp\\_territory\\_geography\\]\n\n</td><td>\n\nPrevents the creation of duplicate entries for a new territory geography.\n\n</td></tr><tr><td>\n\nValidate Territory Model Name\n\n</td><td>\n\nTerritory Model\\[sn\\_tp\\_territory\\_model\\]\n\n</td><td>\n\nPrevents the creation of duplicate entries for a new territory model.\n\n</td></tr><tr><td>\n\nValidate Territory Name\n\n</td><td>\n\nTerritory\\[sn\\_tp\\_territory\\]\n\n</td><td>\n\nPrevents the creation of duplicate entries for a new territory.\n\n</td></tr><tr><td>\n\nValidate User and Territory\n\n</td><td>\n\nTerritory Membership Override\\[sn\\_tp\\_territory\\_membership\\_override\\]\n\n</td><td>\n\nEnsures the user added to the territory membership override table is associated with the territory\n\n</td></tr></tbody>\n</table>## Properties\n\nField Service Territory Planning adds the following system properties.\n\n<table id=\"table_s2q_vfq_5zb\"><thead><tr><th>\n\nProperty\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nsn\\_fsm.use\\_query\\_rules\n\n</td><td>\n\nWhen the setting is \"true\", rules from the \"sn\\_query\\_rule\" table will control what Field Service Management-related data a user can read. This includes work orders \\(WO\\) and work order tasks \\(WOT\\). If set to \"false\", these records won't be filtered based on rules, and users can access them without rule-based restrictions.-   **Type**: Boolean\n-   **Default value**: False\n-   Location: **All** &gt; **sys\\_properties\\_list.do**\n\n</td></tr><tr><td>\n\nsn\\_tp.max\\_coordinates\\_allowed\n\n</td><td>\n\nMaximum number of coordinates allowed in GeoJSON Geography. This property is read-only and is non-editable. -   **Type**: Integer\n-   **Default value**: 3250\n-   Location: **All** &gt; **Territory Planning** &gt; **Properties**\n\n</td></tr><tr><td>\n\nsn\\_tp.percentage\\_overlap\n\n</td><td>\n\nPercentage value \\(ranging from 0 to 100\\) indicating the threshold for geographical overlap between territories. The default is set to 5%.-   **Type**: Integer\n-   **Default value**: 5\n-   Location: **All** &gt; **Territory Planning** &gt; **Properties**\n\n</td></tr></tbody>\n</table>## Query Rules\n\nField Service Territory Planning adds the following query rule. You can find the following query rule by clicking **All** &gt; **sn\\_query\\_rule\\_list.do**\n\n|Query rule|Description|\n|----------|-----------|\n|wm task - My assigned territory|Allows admins to enable data security for agents, dispatchers, and qualifiers for work orders and work order tasks. This helps them to see the work orders and work order tasks created in their territories. Mark the **WO - My territory** and **WOT - MY Territory** tables as active.|\n\n## Scheduled Jobs\n\nField Service Territory Planning adds the following Schedule Optimization adds the following scheduled jobs. You can find the following scheduled jobs by clicking **All** &gt; **sn\\_schedulejobs.do**\n\n|Scheduled job|Description|\n|-------------|-----------|\n|Territory Planning- Calculate Overlapping Territories|Calculates the overlaps for both agents and geographies.|\n|Territory Planning- Calculate Overlapping Territories - Agent|Calculates the overlaps for agents. When executed, the scheduled job triggers events to calculate the overlap between two agents.|\n|Territory Planning- Calculate Overlapping Territories - Geography|Calculates the overlaps for geographies. When executed, the scheduled job triggers events to calculate the overlap between two geographies.|\n\n**Parent Topic:**[Components installed with additional plugins for Field Service Management](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/field-service-management/components-inst-additional-plugin.md)\n\n**Related topics**  \n\n\n[Field Service Territory Planning](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/field-service-management/territory-planning-fsm.md)\n\n[Configuring Field Service Territory Planning](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/field-service-management/workforce-optimization-for-field-service/configuring-territory-planning-fsm.md)\n\n## Field Service Territory Planning console properties\n\nTerritory Planning console uses the following properties.\n\nYou can find these properties by clicking **Field Service** &gt; **Territory Planning** &gt; **Properties**.\n\n<table id=\"table_kkv_np2_stb\"><thead><tr><th>\n\nProperties\n\n</th><th>\n\nDefinition\n\n</th></tr></thead><tbody><tr><td>\n\nsn\\_fsm\\_tp.territory\\_membership\\_override\\_to\\_date\n\n</td><td>\n\nDetermines agent's default till date field when added to territory using the **Suggested agents** tab. Agents are available in the territory till the specified date.\n\n</td></tr><tr><td>\n\nsn\\_fsm\\_tp.territory\\_max\\_zoom\\_level\n\n</td><td>\n\nSets the maximum auto-zoom level for the map. The valid values are between 1–20.-   **Type**: Integer\n-   **Default value**: 12\n\n</td></tr><tr><td>\n\nsn\\_fsm\\_tp.overlay\\_markers\\_type\n\n</td><td>\n\nDetermines to display the data such as agents and crews based on the view port or territory. -   **Type**: Choice list\n-   **Default value**: Viewport\n\n</td></tr><tr><td>\n\nsn\\_fsm\\_tp.territory\\_initial\\_zoom\n\n</td><td>\n\nSets the initial zoom level for the map.-   **Type**: Integer\n-   **Default value**: 3\n\n</td></tr><tr><td>\n\nsn\\_fsm\\_tp.territory\\_transparency\\_level\n\n</td><td>\n\nDetermines how opaque a newly created geographic area looks on the map. -   **Type**: Integer\n-   **Default value**: 1\n\n</td></tr><tr><td>\n\nsn\\_fsm\\_tp.territory\\_map\\_type\n\n</td><td>\n\nUses different types of map views to visualize territories, such as roadmap, satellite, hybrid, and terrain.-   **Type**: choice list\n-   **Default value**: roadmap\n\n</td></tr><tr><td>\n\nsn\\_fsm\\_tp.max\\_territories\\_for\\_scheduling\n\n</td><td>\n\nDetermines the maximum number of territories that are ready for scheduling work order tasks.-   **Type**: Integer\n-   **Default value**: 100\n\n</td></tr><tr><td>\n\nOpacity level for heatmap on the map\n\n</td><td>\n\nDetermines the opactiy of the heatmap. Valid values are between 0.0 and 1.0.-   **Type**: Integer\n-   **Default value**: 0.6\n\n</td></tr><tr><td>\n\nRadius of influence of data points in heatmap\n\n</td><td>\n\nDetermines the radius that influence the data point in the heatmap. -   **Type**: Integer\n-   **Default value**: 20 \\(pixels\\)\n\n</td></tr></tbody>\n</table>"}}