Salesforce Field Service: Create Batches of Appointments with Service Appointment Generator

Last update: January 31, 2022

Authors: Leigh-Anne Nugent and Christopher Albanese

Watch the Video. Send united states Feedback!

Business Requirements

Customers need to be able to build a solution that supports the following scenarios for teamwork and multi-stage work:

  1. Wanting in day changes to the Coiffure Fellow member/Job Assignment i.east. a coiffure member called in sick on Monday and nosotros need to transport someone in but for that day
  2. Partial task assignment to a new Crew Member for a single day of the multi-solar day i.east. tech assigned on Monday but will meet the whole week on the mobile app and also doesn't get alerted or have an Assigned Resource created
  3. When various resources are required throughout the elapsing of the task i.due east. need someone with troubleshooting skills for the first day, then a mechanic the second 24-hour interval, then an electrician the third day (squad approach)

This will provide a end-gap accelerator-mode solution that volition exist an unmanaged packet with access to the source code for customers to modify.

General Capabilities and Principles

  • Leverage the knowledge of the dispatcher to generate a collection of Service Appointments (SAs), assigned to designated Service Resource (SRs or techs) past creating Assigned Resources (AR) records. It improves the end-user experience for the creation and maintenance of a large number of SAs which would be administratively burdensome, if not impossible, to do with the out of the box capabilities.
  • This tool provides an culling to using the Salesforce Field Service Crew Management and Multiday Work features.  This does not provide an automatic, project-like scheduling tool, it'due south intended to raise multi-resource assignment capabilities.
  • Generate SAs and Assignments based on the Dispatcher's direction.
    • Create 2 weeks' worth of SAs, with the option to include Saturday and/or Sunday, for Gloria and Alan for this Work Lodge.
  • Generate an ad hoc batch of SAs to staff a night shift for a given period of time.
    • The customer reduced the due date which requires an overnight shift to be added for the job to finish on time.
  • View the SAs for a Work Social club and edit them in an easy, spreadsheet-style way.
    • The client wants the task finished sooner, which ways we need to add 2 hours to each SA Duration.
  • Selectively Delete SA and Delete all SAs.
    • The customer called and says we tin can't be on-site for a set of days or wanted to cancel the whole job.
  • Move jobs from one resource to another.
    • Fred is out for 3 days then move a set of his appointments to another Service Resources.
  • Push some or all of the jobs N days into the future or to a new engagement.
    • The client says we tin can't be on-site for a set of days, so shift all appointments to when nosotros can go back on site.

Phase ane  Features

(MVP) As a Scheduler, I know what jobs my resources are working on. I should be able to:

  • Set up the Service Appointment Parameters I need to determine the first engagement on-site, the concluding appointment on-site (or in the batch), the Kickoff Fourth dimension, the Elapsing on-site.
  • When I'thousand scheduling jobs outside of my Timezone, I want to be able to be articulate about what Timezone I am creating the Service Appointments for and then that I can properly offset the Start Time in the Service Appointment Creation Parameters screen.
  • I need to be able to select from a listing of Service Resource that take a Primary or Secondary Territory Membership record of the Service Territory of the Piece of work Order (or manually selected).
  • In the Resource selection listing, I want to know if the Service Resources have any existing Absences and/or Service Appointments already assigned to them during the engagement range selected then I can select the Service Resources that have the about availability.
  • In the Service Appointment Cosmos Review list, I need the power to NOT create some Service Appointments for some Service Resources on some dates because they only need to exist on-site for some of the days in the batch.
  • I demand all created and Assigned Service Appointments to appear on the dispatcher console as shortly as they are assigned and I demand whatever updates fabricated in the dispatcher console to reflect in the information table Service Appointment review screen (and vice versa).
  • I need the ability to create and assign additional batches of Service Appointments that may include night shift and/or off-shift coverage to shorten the elapsed elapsing of the chore.
  • When I create new assignments, I'd like to be guided past the dates of the SAs that have already been created and then I know where to create the next batch of SAs (visibility on the summary tabular array).
  • When I create boosted assignments, I'd like to be guided by the overall Piece of work Order Start and End Dates so I don't create SAs exterior of this engagement range (visibility on the summary table).
  • I want the choice to create a single batch of Service Appointments for more than 14 days (up to 16 weeks) if I know I but demand 1 or 2 resource to assign piece of work and know I will be well beneath the tool limits of 1000 SAs in the Data Table.
  • I want to be able to review all of the Service Appointments and Assignments across all of the days so I can see everyone who has been assigned.
  • I need to be able to motility all or some of the Service Appointments to another start engagement so I don't accept to manually update each appointment start engagement/time.
  • I want to exist able to edit the Scheduled Stat and/or the Elapsing of selected Service Appointments and accept the Scheduled End recalculate for me so I don't take to worry about computing and updating that field myself.
  • I want to mass delete all or selected open assignments if the job gets rescheduled or canceled to simplify the data management of deleting each one manually.
  • I want to reassign all or some of the open assignments if a resource becomes unavailable (team shuffle) to simplify the data management of reassigning each one manually.

End-User Guide

  1. Create SA Screen
    1. Parameter screen
      1. When there aren't any Service Appointments for the Work Order, you will be presented with the Service Appointment Parameters including the technicians you lot want to surface.
      2. The Outset Fourth dimension is presented in the Users Salesforce Time Zone. Consider the TimeZone offset if you are creating Service Appointments in a different TimeZone.
    2. Service Resource choice tabular array
      1. This Data Table volition show you all the Service Resources a dispatcher can select to assign work to.
      2. Select as many resource you would desire to add to the job.
    3. Service Appointment option table
      1. This Data Tabular array volition show yous all draft SAs for the entire elapsing of the job and for each tech.
      2. Select the SAs to keep; you can select all the rows and deselect the ones y'all don't want.
      3. Can sort past Scheduled Commencement Date or Service Appointment.
      4. Tin can inline edit the Scheduled Outset Time and Duration.
  2. Edit SA Screen
    1. When there are Service Appointments for the Work Club, you will exist presented with two options: Edit SAs or Create SAs.
    2. Edit SAs
      1. This Information Table will evidence you all Last SAs for the entire duration of the task and for each tech.  Tin inline edit the Scheduled Start Time and Duration.
      2. You will take three new options likewise every bit a Data Table.
        1. Modify Service Resource – Use this feature when you accept to shift a gear up of SAs to new Service Resources.
          1. Select the SAs you would similar to reassign in the Data Tabular array.
          2. Select the Service Territory and Skills to build the listing of Service Resource to select.
          3. Select the Service Resource from the Data Table.
          4. All Assigned Resources records will be updated to the new Service Resource.
        2. Shift Appointment Dates – Use this feature when you accept to shift a set of SAs to new start date.
          1. Input the start date and the end date range of the SAs to motility.
          2. Input the new date to shift the SAs to.
        3. Delete Service Appointments – Employ this feature when y'all have to delete an ad hoc set of SAs.
          1. Select the SAs you would like to delete in the Information Table.
    3. Create SAs
      1. Y'all volition be redirected to the create Service Appointment parameters screen.
  3. Delete All SAs
    1. Use this when you lot need to delete all of the Service Appointments.

Considerations

  1. Datatable presents date/fourth dimension in the user's machine settings, not Salesforce User TimeZone or the Service Territory TimeZone.
  2. The max number of rows of Service Appointments the Data Table tin display is k rows.  Proceed this in mind when creating your Service Date batches. Its recommended to create batches 2 weeks at a time to keep the numbers down for performance.
  3. Validation rules are caught when you effort to relieve the records (yous won't see them in the table).
  4. Any scheduling conflicts volition have to be resolved in the Gantt based on dominion violations.
  5. Y'all won't see the list of Skills each Service Resources has in the table.
  6. If y'all don't select any rows in the Service Appointment creation table, yous could possibly not create any SAs.
  7. Information technology'due south not recommended to mass edit the Date/Fourth dimension fields in the Data Table Service Appointment.  It will update all the records to be the same date and time; you lot won't only just update the date value.
  8. If you lot back out of the menstruum or sit in the menses screen for over 10 minutes, yous might have SAs in a Typhoon status until the Delete Service Engagement Triggered Flow comes in to delete them (but this time frame tin can exist changed in the catamenia).
  9. If an date is shifted and crossed a daylight saving transition menstruum, this will have to exist manually adjusted as it is not accounted for in the solution.
  10. The Service Appointment edit table is not filtered by condition but tin can be configured if desired.
  11. Consider the implications when the parcel is retired if/when this feature is added to the Product long term roadmap
    1. It is recommended to document the configuration in detail to and so determine if something would crave refactoring or removal.

Developer Guide

Data Model

Service Appointment Fields

  • MR Service Resource – this is the Service Resources that the Dispatcher has assigned. It is used to create the Assigned Resource record when creating a new Service Engagement.
  • MR Parent Work Order – this is the Work Lodge that owns the Service Engagement.
  • MR Creation Condition – Picklist of Draft, Confirmed, Deleted, This is used to drive the cosmos procedure too equally the automatic deletion of Draft SAs that don't go confirmed or deleted (user but exits the flow with completing)

Work Gild Fields

  • MR_Estimated_Calendar_Days__c
  • MR_Hours_Actual__c
  • MR_Hours_Completed__c
  • MR_Hours_Created__c
  • MR_Hours_Scheduled__c
  • MR_Hours_To_Be_Assigned__c
  • MR_Hours_To_Be_Created__c
  • MR_Number_of_Techs_Needed__c
  • MR_Total_Hours_Required__c
  • MR_Trigger_Cleanup__c – Used by the time based workflow to delete Draft SAs
  • MR_Trigger_Date_Time__c – Used past the time based workflow to delete Draft SAs

Service Territory Member Fields

  • MR Resource Proper noun – formula field to display Service Resource Proper noun
  • MR Service Territory – formula field to display Service Territory Proper noun

Automation

Flows

  • MR DT Service Appointment Main (proper noun = Multi Resource Consignment Magician) – calls Creator, Review and Delete
  • MR DT Service Appointment Creator
  • MR DT Delete Service Appointments – Mass delete all of the SAs for a Work order
  • MR DT Service Appointment Review – Update, Alter Techs and Delete selected SAs
  • MR DT Trigger Delete Flow – Time Based menstruation which deletes Draft SAs that take not been confirmed within 10 minutes (parameter tin exist changed)
  • MR DT Update sched end time – Record Triggered flow to recalculate SchedEndTime if SchedStartTime and/or Elapsing change.

Apex Classes

  • WOSchedulePayload – Class  used to contain the parameters fix by the user and pass them to the batch apex job
  • MRDTAssignment – Assigns SAs to their Assigned Resource – called by MR DT Service Date Creator
  • MRDTGETSTMs – Returns filtered listing of STMs based on Territory and Skills and Start / Finish Dates
  • MRDTReassignTechs – Called by MR DT Service Engagement Review Menses and used to reassign existing SAs to a new Resource
  • MRDTSchedMultiVisit – called by MR DT Service Engagement Creator and is used to create the SAs initially
  • MRDTDateShift – motion selected appointments to a new date
  • MRDTSAValidateUpdate – update any discrepancies between manual updates to SA, similar a drag and drop, with the MR_Service_Resource field. return list of SAs to the Review flow along with count of SAs.
  • MRDTGetTimeZoneInfo – returns the timezone beginning between the running users timezone and selected service territory'southward timezone. This is used by the MR DT Service Date Creator menstruation to generate a warning message to the user if the timezone get-go is not 0.

Test Classes

  • WOSchedulePayloadTestClass
  • MRDTAssignmentTestClass
  • MRDTGETSTMsTestClass
  • MRDTReassignTechsTestClass
  • MRDTSchedMultiVisitTestClass
  • MRDTDateShiftTestClass
  • MRDTSAValidateUpdate
  • MRDTGetTimeZoneInfoTestClass

Platform

Permission Sets

  • MR DT Permission Set – grants access to all of the fields and classes above

Other Requirements

  • Prior to apply, you must deactivate Service Appointment Validation Rule called: Dont_allow_scheduled_or_dispatched

Installation Steps

  1. Install Base and Screen Base packs
  2. Install Datatable
  3. Install the Service Appointment Generator package
    1. Sandbox Installation Link: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t8c000000NRzz
    2. GitHub Repository: https://github.com/cxalbanese/multiresource.git
  4. Deactivate Validation Rule on Service Appointment called: Dont_allow_scheduled_or_dispatched
  5. Assign Permission Set up to Users who volition use this package: MR DT Permission Prepare
  6. Add flow to work order folio: Multi Resource Assignment Wizard

Optional Configuration Steps

  1. Update Flow Screen messaging to accommodate your business process
  2. Other fields to display in the Data Tables to suit your business organisation process

Related Requests, that are non related to the SA Generator solution

Nosotros heard these other requirements that would improve the cease-user experience.  Consider building something yourself to help with these.

  1. As a Scheduler, I want to be able to go to the Dispatcher console and visibly identify the Service Appointments for the Work Order so I don't become confused with all the jobs on the Gantt.
  2. As a Scheduler, I want an easy way to clone a Service Engagement from another Service Appointment on the Dispatcher Panel so that it is easy to add some other appointment for ane more day.

Feature Requests

Jobs to be Done Status Next Steps
Equally a Scheduler, I'd like the flexibility to select the Timezone I'd like the Service Appointments to exist scheduled in when setting up the initial parameters.  Design note: Information table renders the Appointment/Fourth dimension fields in the context of the Auto settings.  Also, mass edit doesn't only update the beginning time, it updates the date and the times. Captured Review and make up one's mind next step
As a Scheduler, in the typhoon Service Appointments list, I want to know if that SA has an existing Absence or Service Appointment on that engagement and then I can immediately see the conflicting tape for that specific Service Appointment (or employ any ensuing Gantt violations as guard rails for the dispatcher to use to tweak the schedule for a given Work Social club). Captured Review and decide side by side stride
As a Scheduler, I desire to ascertain the Skills required at the Work Order and accept the Lucifer Skills dominion consider that the combined Skills of the people I accept Assigned to the WO volition fulfill the Work Order Skill Requirements. Captured Review and decide side by side step
As an Admin, I want to be able to change the screen menses and so that I can insert another Data Table displaying the individual dates with start times and durations earlier seeing the Resources to select so that the rough schedule can be created before selecting the resources that will be assigned. Captured Review and determine next pace
As a Scheduler, when I am deleting a set of SAs, I'd like an additional confirmation screen so that I don't accidentally delete records. Captured Review and determine next pace
Every bit a Scheduler, I desire the selection to let the scheduling engine select the resource based on a defined Role required for each SA (extended match). Captured Review and determine next stride
Every bit a Scheduler, I'd similar to have a chore template that could create WOLIs with the required skills (sub-work types) that can be applied for each Job. Captured Review and determine next step
As a Tech using the app, I need to see who else is going to be on-site on the aforementioned day and so that I can see if I can carpool with someone. Captured Review and determine side by side step
As a Tech using the app, I need to see the tool that was assigned to me and so that I can bring the right tool on site. Captured Review and determine next step
As a Site Supervisor using the app, I need to run across all of the people who are staffed on the job each day so that I know who to await and when (they are ok seeing the data tabular array in the App). Captured Review and determine adjacent stride
Equally an Admin, I'd like to have admission to Setup Controls to assist identify which automation to enable.

– Status Filters for SA edits
– Align Earliest Start and Due date if the Scheduled Start/Scheduled End is updated
– Set how long the Draft SAs stay in Draft
– Error Message and Screen Message Templates

Captured Review and make up one's mind side by side pace
As an Admin, I want to be able to bring the component into Custom Gantt Actions to Create SAs, Edit SAs (make the component a VF Custom Gantt Activeness) Captured Review and determine next pace