In a previous blog article, we’ve discussed how to create Service Territories, how to define Operating Hours, how to assign Service Territories to Service Resources and what types of allocation exist in a Salesforce Field Service. After configuration is completed the scheduling and optimization logic will respect Work Rules defined in a Scheduling Policy and assign Service Appointment based on either Match Territory or Match Territories Work Rules and availability by using Operating Hours.
Territory Planning does not end with a technical setup and step step-by-step instructions. It is fairly easy to make configurations to ensure Service Appointments can be assigned, but it is far more complicated to make sure that Service Appointments are assigned to the best resources at the right time considering the different factors we will cover in this article, so stay tuned.
First, what is Territory Planning?
Let’s start by defining what the scheduling problem is all about. Optimized resource scheduling answers the famous W6 question: “Who, does What, With what, When, Where and for Whom?”.
More to the point, it means we need to find the best technician(Who) that can complete a specific appointment (What) using tools available in his vehicle (With) at a specific date and time (When) at a specific location (Where) for our customer (Whom)
In this article, we will mainly focus on Who, What, When and Where questions and their combinations.
You may ask why – combinations specifically? And below you can find a few of the many reasons why combinations are crucial:
- Scheduling Quality – the schedule should be as efficient as possible. Technicians should work more and travel less. We don’t want to send technicians on a daily basis to remote areas.
- First-Time Fix Rate – when sending technicians, we need to ensure that the work can be completed to the customer’s satisfaction. If we assign a technician solely based on territory assignment without considering skills it may result in sending a technician who installs TV to fix a dishwasher – a task, he cannot accomplish. If we send a technician to enter a government facility but his entrance permit expired yesterday, he will not be allowed to meet a customer.
- Customer availability – when sending a technician, we need to consider customer availability. When providing the arrival window between 2pm-4pm to the store we need to remember that store is closed for lunch between 1pm-3pm so there is no point to arrive before 3pm and stay idle until the store gets opened.
Coverage requirements may change from organization to organization, from one territory to another the in the same organization, from one business unit to another, or even between technicians just because of different constraints and preferences.
Let’s assume we have the following requirement – “Ohana Happy Company” employs 10 technicians in total – during workdays the technicians can work only in their territories, and during weekends technicians are occasionally assigned on-call shifts covering all territories and are therefore traveling more. The customer is looking for out of the box solution without much maintenance and is not interested in complex coverage maintenance.
Before jumping into a solution and trust me we will, let’s first understand what factors contribute to territory planning and how.
Service Resources (Technicians – who)
Unless you are using VRA (Virtual Remote Assistant), Location-less Scheduling for remote work or Inbound Scheduling (such as scheduling appointments in a showroom for a perfect test drive experience) you are probably managing a traveling workforce.
The first question to ask a decision maker is where does Service Resources start and end their day? Normally you will hear one of a few answers:
- At Depot – since technicians need to pick up a vehicle from the facility in the morning and return the vehicle with broken equipment at the end of the day. This means a technician will travel from home to the depot at his own expense, be in the depot say at 8:30am, perform vehicle checks, collect equipment, and leave the depot at 9am towards the customer. In this case, a 9am-6pm availability includes travel back and forth. In addition, if all technicians start and end their day at the same depot, – and let’s call this point Homebase we better NOT have them working in the same routes crossing each other.
- At Home – which means they begin their day at home and finish at home and their route is optimized across Homebase (not necessary, though). The next thing we need to understand is the travel policy back and forth or in other words when technicians can actually start their work. Should a technician working 9am-6pm be at a customer site at 9am or leave home at that hour (such as in the depot use case)? Based on my experience the answer is not always straightforward and the start-day policy may change from the end-day policy but let us continue with this example.
a. The technician needs to be at the customer site at 9am, traveling either 5 minutes, 30 minutes or 2 hours. In this case, all travel is exclusively at the expense of the technician and the Resource Availability Work Rule should be configured with an empty value in the Travel From parameter. We should remember that technicians traveling a lot (in case of wrong territory planning) will get frustrated if the situation develops into a pattern.
b. The technician leaves home at 9am and his travel time is included in working hours – which means, fully at the expense of the organization. In this case, technicians mostly don’t care how much they travel if they are equally paid working or traveling. In this case, the Resource Availability Work Rule should be configured with a 0 value in Travel From parameter.
c. Partial coverage – say travel of up to 45 minutes is at the expense of the technician and the rest is included within working time. If the technician has to travel 30 min to an appointment, its earliest Scheduled Start will be 9am If the travel time to the first appointment is 1 hour and only 45 minutes are at the expense of the technician, he will leave home at 8:15am traveling 45 minutes outside of working hours and 15 minutes in working hours being at the customer site at 9:15am. - Either at home or depot – which means travel from, travel to and at expense of whom (back and/or forth) may change.
Tips for Resource Availability Work Rules:
- You can define different travel policies From and to work.
- In case your organization has multiple travel policies applied to different workforce groups, you can define more than one Resource Availability Work Rule with different configurations using an STM-based Relevance Group, but you must ensure that the Relevance Groups are mutually exclusive and that the Work Rule is not applied twice to the same STM.
Service Territories (geography, but not limited to – where)
The second question to ask a decision maker is where Service Resources should be working.
In my opinion, it is the toughest question to answer as there are many factors involved:
- Service Territories structure andthe way you define Service Territories – we can create either many small Service Territories; or fewer territories but have them large in size. We can also create a hierarchy between Service Territories.
In case an organization has different business lines using different scheduling logic, can both business lines share the same Territories, or do we need to split territories by business units and geography, and what should come first? Remember, Service Territories drive not only scheduling logic but also Salesforce Sharing Rules to determine records access.
Note: Match Service Territory and Working Territories Work Rules match between ServiceAppointment.ServiceTerritoryId and ServiceTerritoryMember.ServiceTerritoryId standard fields ignoring hierarchy. As such, for simplicity, if you have a Service Appointment with ServiceTerritoryId = London it will not be possible to use Scheduling Logic to assign it to Service Resource with primary STM.ServiceTerritoryId=UK.
Tips:
- You can draw polygons directly on the map from Salesforce Dispatcher Console or import them from KML files and link them to your service territories. Polygons make it easy to mass-update appointments directly from the map within a specific geographic area, for example, in case of extreme weather conditions it is possible to mass Unscheduled all Service Appointments in a polygon right from the map.
- You can create a parent-child polygons hierarchy, say Central London as the inner polygon and Greater London as the outer polygon, and use the Lowest level of Territory Assignment Policy. After you map the polygon to a territory you are ready to assign territories to resources as needed.
- It is critical to ensure that Service Territories don’t cross Time Zones. Remember, Book Appointment Global Action uses the time zone of the service appointment’s service territory’s operating hours. This way, when a customer selects a time slot, the appointment is scheduled according to the customer’s time zone.
- In Field Service Settings, it is possible to define whether the Gantt chart time zone will be the Territory Time zone or the User Time zone.
- Service Territories drive objects Sharing in Salesforce Field Service. It is recommended to ensure that OWD for SFS objects are Private and sharing settings in SFS are configured before Service Territories are created.
- Hard Boundaries vs Soft Boundaries. There are two Work Rule types: Match Territory and Match Territories. When Scheduling Policy includes Match Territory (Hard Boundaries) the scheduling and optimization logic will schedule Service Appointment from Central London to Service Resource assigned to Central London using Primary or Relocation STM. It means these technicians work only in Central London. Sometimes, service resources need to be available to take on work in more than one service territory. The Working Territories Work Rule type enforces primary and secondary service territory memberships.If a technician is assigned to an additional territory (as secondary) and Scheduling Policy uses Soft Boundaries, they can work in both territories.
Most of the time you’ll find that even if techs are allowed to cross some territories using soft boundaries, there are clear boundaries of areas that they cannot cross due to organizational hierarchies and budget. By using Service Territory hierarchies Territories can be grouped together and then they are allowed to cross territories within the upper territory. They are not allowed to cross upper-level territories unless relocated.
If our territories are small and we need techs to work in multiple territories – should we create one big territory and assign it as primary, while working in Hard Boundaries concept or create multiple small territories, assign one territory as primary and other as secondaries? In case the technician’s Home Base is located on a border between 2 territories, should he cross territories and service them all?
In the example below we created 3 polygons and mapped them to Service Territory equivalents: Central London colored in blue, West London in orange, and South-West in green. If a technician is assigned to South-West as the primary territory only, he can work in Chelsea and Fulham only. If a technician is assigned to Central London as Primary, West and South-West as Secondaries and the Scheduling Policy used allows scheduling using Soft Boundaries, the technician can work everywhere in these territories departing from his Homebase.
Tips:
- You can use both Hard Boundaries and Soft Boundaries in case scheduling relaxation is needed. We can first check availability using Hard Boundaries (Customer First, by default) and if no candidates are found we can try to expand the search using Soft Boundaries.
- To override the default Scheduling Policy set FSL__Scheduling_Policy_Used__c on Service Appointment.
- When using Soft Boundaries and planning optimization, make sure to include the relevant territories in the optimization job. On the other hand, if multiple optimization jobs are running at the same time, make sure you don’t concurrently optimize the same areas.
- Geography variations – should territories in urban areas and rural areas be roughly the same size and operated by the same policies?
Urban areas are normally characterized by a relatively high volume of appointments with many technicians living and working nearby. Every appointment in a high-density geography area can be assigned to multiple technicians. If a technician is sick, there is always someone to replace him. Technicians in urban areas don’t travel a lot, hence their productive utilization is high and normally there is enough work for everybody.
Rural areas, in contrast, have opposite specifications – these are normally remote and low-density areas having significantly lower demand. As such, fewer technicians are needed to serve such areas. Sometimes, there is not enough work even for a single technician, and as such, remote areas are not served by the same schedule as urban areas. It is very common that appointments in remote areas are scheduled during specific days and/or times either by relocating technicians as needed or by having a predefined weekly schedule using Visiting Hours. What happens if a technician visiting a remote area once a week is sick, do we always have a backup technician available? should we always keep an “on-call” technician during the day if such a scenario occurs? How many technicians are needed?
Another critical aspect to consider is travel allowance. While I am sorry for complicating things, you are reading this article because territory planning is not a trivial task. So, can they travel within all territories? Can they travel to other territories? Can they travel everywhere within all territories?
Let us look at the map again and for illustration purposes add a technician’s Homebase.
In the example below we defined a radius where technicians can work.
So, the technician living in Belgravia and assigned to all 3 territories can work in any of the 3, but only within the given radius.
The technician living in Covent Garden and assigned to Central London can also work only within the radius and cannot work in Mayfair or Soho within Covert Garden.
The technician living in Hurlingham and assigned to the South-West and working in a relatively large radius can work only in the South-West within a given radius and cannot work within a radius in other territories.
Tips:
- Different radiuses can be applied using Relevance Groups. In combination with the time phased STMs, you can define different radiuses that may change between STMs and/or resources. Using the same method, you can exclude appointments affected by radius limits.
- Radius-based restrictions can be applied to Primary and Relocation STM types and the radius is measured from the STM Homebase. You can define a different Center Of Work (COW) as needed.
- Keep in mind that when the technician is relocated, the relocation replaces the Primary membership. Technicians can still work in Secondary STMs.
- Avoid using daily or short STMs in case of using LS (old scheduling and optimization engine). Such limitation is less applicable in O2 or ESO (Enhanced Scheduling Optimization) due to infrastructure changes in a new engine.
Availability (Time – when)
The Service Appointment needs to be scheduled at a specific time, but what does it mean?
It means we need to consider many constraints and here I list just a few of them:
- SLA the appointment must be assigned between Earliest Time Permitted and Due Date. For high-priority appointments, SLA is normally short.
- Customer availability – when sending a technician to perform asset maintenance we need to make sure the asset is not being used.
- Resource availability – obvious, but we still need to ensure the technician is working and working in the right place.
- Customer entitlements – We can offer our customers a full-day arrival window or 2h slots.
- Other factors – for example, we do not want to send a technician to perform metering at night simply because the technician cannot accomplish meter readings when it is dark outside.
At the time the original article was created, the availability of Service Resources was managed using weekly Operating Hours defined by Service Territory Member – a time-phased junction object between Service Resource and Service Territory. Weekly Operating Hours are ideal for companies where Service Resources are working during standard working hours – for example, Monday-Friday 9 am-6 pm. But what happens when Service Resources are not working according to the standard weekly schedule? For example, in addition to working normal Monday – Friday hours, do technicians need to work every other Friday or have an extra on-call time slot during a specific day? You got it! In case availability is managed using Operating Hours you need to change the weekly patterns every week or even on a daily basis. The only way to manage flexible working hours was by using time-phased Service Territory Members. Having redundant STMs or the wrong solution may have performance impacts, hit limits and exceed the Apex CPU time limit. You can set Apex operation timeout limits and define different limits for Get Candidates and Book Appointment Global Actions in Field Service Settings or decrease search horizon, but then you end up not receiving all scheduling options. Lucky for us, Salesforce introduced an additional way to manage availability using a bunch of objects with Shift as the main object that drives resource availability. Shifts can complement availability defined using Operating Hours or completely replace it. It is possible to create a single Shift from the Schedule view or use Shift Templates and Shift Patterns to mass-create shifts using predefined patterns (for example to define a monthly pattern with Saturday included every other week and Sunday once a month). I like this feature a lot as it provides great flexibility to manage availability. But what is the right choice?
Let’s start to build a puzzle. We create technicians (who), we created territories (where), and we probably, but not always defined STMs (Service Territory Members) to assign working areas. Now we must answer the next question – “When”.
If we are talking about urban areas the answer will probably be – always, so unless you have a requirement to enable standard and fixed working hours, I would go with the Operating Hours solution and complement it with Shifts if needed.
If we are talking about rural areas, here things become more complex. Let us look at the following example. We have a very remote area with no technicians living nearby, so technicians must travel a lot. There is not enough work even for one technician so ideally, we need to combine appointments so 1 technician will travel once and complete them all. The best practice in this scenario is to use Visiting Hours to define (on a weekly basis) when we want to schedule appointments in this area. All you need to do is to define FSL__VisitingHours__c on a Work Order using simple automation, say by Service Appointment Territory and add Service Appointment Visiting Hours Work Rule to a Scheduling Policy. But is it enough? Not necessary. If you have two technicians assigned to this territory the scheduling logic will guarantee that no technicians are sent during non-visiting hours, but there is no guarantee that during visiting hours the system will not send them both. It means that we need to use other methods to control availability.
Let’s assume we decided that we want to visit Ardington (rural area) twice a week – on Mondays 8am-12pm and Wednesdays 1pm-6pm. We want to assign Monday and Wednesday to two different techs to make travel rotations.
Again, we can go into Operating Hours as to the solution of Shifts as an alternative. There are pros and cons that we need to consider before making a decision.
In the case of the Operating Hours solution, we need to use the Operating Hours defined on the Secondary STM of technician 1 with Monday morning availability. Similarly, we need to use the Operating Hours defined on the Secondary STM of technician 2 with Wednesday afternoon availability. But don’t forget that availability defined on secondary STM must be contained in the Operating Hours of Primary STM. It also means that when the technician is allocated to a Secondary territory, he is also working in a Primary (unless Working Territories Work Rule does not permit working in a Primary) which means we didn’t prevent scheduling appointments from the Primary territory to the tech when he is assigned to work the Ardington area. Primary STM is mandatory because it defines the home base and for many other reasons. If a technician will work in the primary territory, he might not be able to finish all work in the secondary territory because we overbook him in the primary or, he will zigzag between primary and secondary and have long travels. It means we need to find a way to prevent the technician from working in the primary when he is allocated to the secondary territory. If a technician never works in the primary territory, you should never use Hard Boundaries and Soft Boundaries should never allow work in the Primary. In case you need flexibility, the quick (but not right) answer will be – so instead of using secondary let’s use relocation which replaces primary, and it is true. Using relocation in this use case is the wrong solution. Reminder – the requirement was to allow the technician to work in Ardington during the morning and during the remaining part, work somewhere else (let’s say in a regular primary area). If we create relocation for the morning hours (partial relocation), the technician Homebase is changed in the middle of the day (even though it can be exactly the same address in both primary and relocation STMs) and therefore when scheduling, the scheduling engine will take the technician to the home base after the last appointment in relocation STM and again will take him from the home base of primary STM to next appointment in the primary territory causing incorrect travel in the middle of the day with 2 redundant travel legs. This type of configuration is not supported and should not be used. So, what options do we have? In this case, we can assign such a technician to virtual primary territory with 8am-6pm availability. This territory will not be mapped to any polygon so this territory will be a territory without appointments. The Technician will work according to availability solely defined by Secondary STMs within desired days of the week that will be contained in the Operating Hours of virtual primary and the technician will not be taken out of secondary STMs back and forth.
The shift-based solution provides great flexibility in defining working hours and has a relation to territories by nature. In this case, STMs without Operating Hours slots will define where technicians can work, and Shifts, as another layer, define times of the day when technicians can work. Similarly, to the ability to define time slots in Operating Hours, we can define 1 or multiple shifts during the day and specify Shifts’ Service Territory. If a Shift is defined without Service Territory, the availability is added across all territories when Soft Boundaries Scheduling Policy is used. If a Shift is designated to the Primary territory, during the shift, the technician can work only there and cannot work in any secondary. If a Shift is designed for Secondary territory, this configuration is not supported and not respected by scheduling operations (such as Book Appointment or Get Candidates) and is supported in Optimization only. Unless you are scheduling appointments by optimization only, feel free to use this solution but most customers need to use semi-automatic scheduling tools and use global actions. It means using Service Territory on a shift in case the secondary territory is not the right choice. The right solution in this scenario will be to use Recordset Filter Criteria (RFC) on a shift.
For technician 1 on Monday, we create 2 shifts:
- Shift at 8am-12pm with RFC as such:
- Shift at 12pm-6pm – with technician’s Primary Service Territory and empty RFC
For technician 2 on Wednesday, we created a morning shift in primary and afternoon shift with the same RFC as above.
What option to define availability works best for your business – Operating Hours (OH), Shifts or both? Below I summarized the pros and cons for each option as well as additional considerations not mentioned earlier:
Requirement | Preferred Solution |
Workforce with a static weekly schedule | In my opinion, OH would work best |
Workforce with a static weekly schedule and occasional changes, such as on-calls | OH and Shifts. Shifts will complement availability defined using OH. |
Use color scheme on Field Dispatcher Console to distinguish between different types of availability using a color scheme | In the OH solution, the color scheme is based on a slot type – Standard or Overtime with predefined colors. Shifts on Dispatchers’ colors are colored according to Shift color add can include comprehensive custom logic |
Workforce with no flexible schedule | Shifts are the preferred option. |
Ability to manage shifts approval processes | Shifts lifecycle can be managed using the standard Approval Process |
Ability to find candidates for specific availability | It is possible to first create a shift as not assigned and use Candidates on a Shift to search for the best technician or use mass actions for mass shift assignment |
Ability to create not weekly based rotations | Use Shifts along with Shift Templates, Shift Patterns, and mass shift actions |
UI to create availability and easily reshuffle availabilities between technicians | Use Shifts |
Ability to define designated work | In an OH-like solution use checkbox on SA to define Designated Time Slots in OH. In Shifts use Recordset Filter Criteria with flexible conditions |
Ability to create availability overlaps | In OH-like solution Availability in Secondary STM adds availability to Primary and Relocation STMs. Secondary STMs can overlap. Shifts can overlap with OH or overlap with another Shift. |
Tips:
- Because all three options can co-exist you may consider using multiple tactics in your solution, and even use what I call a hybrid solution across different types of workforces. Keep in mind that because theoretically a single availability can be defined in OH, Shifts or combinations such as Shifts overlapped with Ohs or even Shifts overlapped with another shift (yes, it’s possible) it might be a challenge to run utilization-like calculations where you compare work done against availability defined in multiple places.
- Guidelines and limitations of each option should be carefully reviewed.
- Remember, that availability is not defined by the Salesforce administrator or SFS administrator, but by a business role that is not technical, so strive to use a simple solution.
So, our technicians have skills, have working territories defined and assigned using STMs, and have availability assigned either using Operating Hours or Shifts using any tactic described earlier.
What about Work Type considerations or skills considerations?
As part of territory planning, we need to consider not only whether we have someone working in a territory and when, but whether they have the right skills (and other capabilities) to complete the work. Do we need one tech with all the required skills or multiple techs each responsible for each work type?
Do we want technicians with multiple skills to be assigned to all appointments all the time? Let’s examine a typical company in the Oil and Gas industry that has appointments from different work types – anything from Priority 1 for emergencies such as gas leaks to Priority 10 which is preventive maintenance. During standard working hours, technicians perform all work types starting from P1 to P10. Do we want the same tech to be assigned to non-critical appointments during his nightly on-call call shift? Probably not. Normally, during on-call shifts technicians work on critical issues only and all other appointments are deferred to standard working hours.
There are different options to achieve this requirement:
- Use Visiting Hours to define when appointments can be assigned to any techs available. For example, it is possible to define that a customer survey work type calendar is from Monday to Friday 4-6pm when customers are normally at home. With this approach, if Monday is a holiday and we have an on-call tech available, he can be assigned to conduct a customer survey because the Visiting Hours are based on a weekly calendar.
- Use Operating Hours or Shifts along with Time Slot Designated Work or Shift’s Recordset Filter criteria depending on the method used.
If Operating Hours are used, define designed work within Operating Hours’ Time Slots by the Service Appointment checkbox and optionally assign Color to be displayed on the OH record.
Note, the colors used in Operating Hours UI are not reflected on SFS Dispatcher Gantt.
Tips:
- Since Winter ’23 release it is possible to define AND/OR custom conditions on a Recordset Filter Criteria (RFC).
- Create RFC with up to five conditions. Typically, it is more than enough, but if you need more, create a Formula field on SA and define the condition based on the formula field.
Final word:
Territory Planning is a complex task and is not complete after the initial setup. It is crucial to understand every bit of your operations to design a proper approach. What is right today is not necessarily right tomorrow.
What about the initial requirement that we wanted to design? A quick reminder: “Ohana Happy Company” has 10 technicians in total – during workdays the technicians can work only in their specific territories and travel less. During weekends techs are occasionally assigned to shifts covering all territories and are traveling more. The customer is not interested in complex coverage maintenance.
I would solve it in the following way:
- Service Territories will be designed without availability. Create Operation Hours without creating Time Slots. Create Service Territories with empty OH.
- Service Resources will be assigned to all Service Territories. Create Primary STM without specifying OH. Create Secondary STMs for all territories.
- Availability – will be solely defined using Shifts capabilities:
- Weekday Shifts – will be created by “New from Pattern” mass-create action
- Create Recordset Filter Criteria for each technician to include only territories he needs to cover during weekdays.
- Create a Shift Template 9am-6pm with created RFC.
- Create a Shift Pattern with a pattern length of 7 days.
- Add 9am-6pm Shift Templates (with RFC) as positions 1-5 to Shift Patterns. Do not add entries for days 6-7.
- In Shifts Schedule UI click “New from Pattern” and select a created pattern, in Scheduling Start select Monday, in Scheduling End type the number of weeks to create a pattern, choose Shift Status as Confirmed, pick Service Resources (one or many) for shift assignment and press “Create Shifts”.
- Weekend Shifts – since shifts are occasional without predefined occurrence, they will be created on demand without Recordset Filter Criteria, which means availability will be opened across all territories.
- From the Shifts Schedule view, choose a Service Resource and a day and press “New”.
- Select Start Time, End Time and set Status to Confirmed.
- Optionally assign Background Color to highlight Exceptional Shifts.
- Click “Save” to create a single Shift.
And that’s it, as easy as that.
Contact Asperii if you have similar challenges and are looking for advice from a true expert. We will be more than happy to find the best solution for your unique needs.