Workforce Scheduling maps each field visit, such as an inspection, investigation, or a home visit to a service appointment so it can schedule, assign, and dispatch resources for visits.
Required Editions
| Available in: Lightning Experience |
| Available in: Enterprise and Unlimited Editions |
Workforce Scheduling lets you view, schedule, and manage field visits, such as inspections, investigations, home visits, and wellness checks. While users interact directly with the Visit record, Workforce Scheduling automatically creates and manages a matching Service Appointment record to assign resources, optimize schedules, and dispatch resources.
A
single standard context definition, WorkforceSchedulingContext (API name:
WorkforceSchedule__stdctx), powers both record creation and continuous data
synchronization across Visit, Work Order, and Service Appointment records by default. The
standard context mapping captures and syncs key scheduling details across these records,
including:
- Work type and subject
- Scheduled start and end times, due date, and arrival window
- Duration, priority, service territory, and address
- Assigned resource information
The standard WorkforceSchedulingContext definition provides out-of-the-box mapping and can’t be edited directly. If your scheduling logic requires additional fields synced from the Visit record or modified mapping behavior, you can extend the default synchronization without disrupting standard behavior.
Before you customize mappings, verify that Context Definitions is enabled in Salesforce Setup and that you’re assigned the Context Service Admin permission set. To customize mappings, clone the standard WorkforceSchedulingContext definition, add the required Visit fields, and activate the custom context definition. Then, point Workforce Scheduling to your custom context definition from the Object Mapping for Workforce Scheduling page in Salesforce Go Setup. For details, see Customize Workforce Scheduling. If your scheduling logic requires additional fields synced from the Visit record or modified mapping behavior, you can extend the default synchronization without disrupting standard behavior.
Nodes and Objects in the Mapping
WorkforceSchedulingContext contains three nodes. The Visit mapping pairs each
node with a standard Salesforce object.
| Context Definition Node | Salesforce Object | What It Represents |
|---|---|---|
| WorkforceSchedule | Visit | The scheduled field visit, including its timing, duration, work type, and account. |
| WorkforceScheduleResource | Visitor | The resource assigned to the visit, such as an inspector or caseworker who completes the work. |
Field-Level Mappings
| Visit field | Service Appointment field | Description |
|---|---|---|
| VisitType | WorkType | Specifies the type of field work, such as an inspection or audit. The work type sets the default duration and required skills to complete the visit. |
| SchedulingPriority | SchedulingPriority | Indicates the appointment's priority to the automated scheduling and optimization
engine. Mapped to the VisitPriority dynamic enum field (synced with
WorkOrder.Priority). When you select a Visit Priority in the scheduling
flow, Workforce Scheduling converts the priority value to a number from 1 to 100. See the
priority mapping table that follows.
|
| Description | Description | Describes the work to be completed. |
| Subject | Title | Indicates the primary topic, headline, or purpose of the visit. |
| Account | Account | Identifies the account associated with the visit. |
| Place | No direct mapping. Derived from ServiceTerritory.Location |
Identifies the service territory that covers the visit location. Workforce Scheduling uses it to match the visit to resources who serve that territory. |
| CustomerAddress | Address | Stores the address where the service appointment takes place. |
| CustomerReferenceRecord | CustomerReferenceRecord | Stores the Lead Record data in guest user applications. |
| DueDate | DueDate | Specifies the date by which the visit must be completed. |
| EarliestStartTime | EarliestStartTime | Specifies the earliest date and time that the visit can begin. |
| ArrivalWindowStartTime | ArrivalWindowStartTime | Specifies the start of the time window during which the assigned resource is expected to arrive. |
| ArrivalWindowEndTime | ArrivalWindowEndTime | Specifies the end of the time window during which the assigned resource is expected to arrive. |
| PlannedVisitStartTime | SchedStartTime | Specifies the scheduled start time set when Workforce Scheduling books the visit. |
| PlannedVisitEndTime | SchedEndTime | Specifies the scheduled end time set when Workforce Scheduling books the visit. |
| ActualVisitStartTime | ActualStartTime | Specifies the actual start time of the visit. Salesforce doesn't automatically populate these fields. Set up your own business logic to populate them. The data syncs automatically between the two objects. |
| ActualVisitEndTime | ActualEndTime | Specifies the actual end time of the visit. Salesforce doesn't automatically populate these fields. Set up your own business logic to populate them. The data syncs automatically between the two objects. |
| Duration | Duration | Specifies the expected duration of the visit, derived from the work type. |
| DurationType | DurationType | Specifies the unit for the duration, such as Minutes or Hours, derived from the work type. |
Review these additional considerations when working with Visit records:
- The mapping of the
VisitPrioritydynamic enum to the Work Order priority is a default behavior. The system handles it automatically and isn't configured as part of the context definition. - The Work Order Priority picklist stores ordinal string codes. Each code maps to a numeric
SchedulingPriorityvalue. A lower number means a higher scheduling priority. If the priority is not set or is a custom value that isn't listed, the scheduling priority defaults to 100 (Low).Priority label Picklist code ( WorkOrder.Priority)SchedulingPriority value Critical 4 1 High 3 75 Medium 2 90 Low 1 100 Unset or custom value Any other value 100 (Low) - You can't edit the Status field on a Visit record directly. To update the status, use the Change Status action in the console or update the Status field on the associated Service Appointment record. Status changes automatically sync across both records.
Here's how Service Appointment Status Category maps to the Visit Status:
| Service Appointment Status Category | Mapped Visit Status |
|---|---|
| None | Unscheduled |
| Scheduled | Planned |
| Dispatched | Dispatched |
| In Progress | In Progress |
| Cannot Complete | Abandoned |
| Completed | Completed |
| Canceled | Abandoned |
Visit Assignees Mapped to Assigned Resources
A visit's assignees map to assigned resources on the service appointment, which identify who completes the work.
| Visit assignee field | Assigned resource field | Description |
|---|---|---|
| Assignee | ServiceResource | Identifies the resource, such as an inspector, assigned to complete the visit. |
| IsRequired | IsRequiredResource | Indicates whether the assigned resource is required for the visit. |
Related Lists on the Visit
Skill Requirements and Resource Preferences (including excluded, required, and preferred resources) don’t appear as related lists on Visit records. Instead, Visit records inherit this data from the Work Type through the Work Order. To modify skill requirements or resource preferences, edit the Work Order record.