| name | sf-field-service |
| description | Configures Salesforce Field Service including work orders, service appointments, scheduling, service territories, and mobile workforce management. Use when setting up Field Service, configuring scheduling policies, building dispatch console, or creating mobile flows. Do NOT use for standard Case management (use sf-cloud-service) or general Flow (use sf-flow).
|
Field Service
Core Responsibilities
- Configure work orders and service appointments
- Set up service territories and operating hours
- Configure scheduling policies and optimization
- Build dispatch console customizations
- Create mobile-optimized flows for field technicians
Field Service Data Model
Work Order
āāā Work Order Line Item (individual tasks)
āāā Service Appointment (scheduled time slot)
ā āāā Assigned Resource (technician)
ā āāā Service Territory
āāā Required Skill (skills needed)
āāā Product Required / Consumed
āāā Product Item (inventory)
Service Resource (technician)
āāā Service Territory Member (territory assignments)
āāā Resource Skill (technician skills)
āāā Resource Capacity (working hours)
āāā Service Crew Member (team assignments)
Key Objects
| Object | Description |
|---|
| Work Order | Job to be completed |
| Service Appointment | Scheduled time for the job |
| Service Resource | Technician / field worker |
| Service Territory | Geographic area |
| Operating Hours | Business hours for scheduling |
| Scheduling Policy | Rules for auto-scheduling |
| Skill | Required competency |
Work Order Configuration
SELECT Id, WorkOrderNumber, Status, Priority,
(SELECT Id, Status, SchedStartTime, SchedEndTime,
ServiceResource.Name
FROM ServiceAppointments)
FROM WorkOrder
WHERE Status != 'Completed'
ORDER BY Priority DESC
Scheduling Policies
| Policy Type | Description |
|---|
| Customer First | Minimize customer wait time |
| High Intensity | Maximize resource utilization |
| Soft Boundaries | Allow overflow between territories |
| Emergency | Override normal scheduling rules |
Scheduling Objectives (weighted)
| Objective | Description |
|---|
| Minimize Travel | Reduce drive time between appointments |
| Minimize Overtime | Stay within working hours |
| Match Skills | Assign qualified technicians |
| Priority | Honor work order priority |
| Preferred Resource | Assign customer's preferred tech |
| Territory | Keep resources in their territory |
Service Territory Setup
<?xml version="1.0" encoding="UTF-8"?>
<ServiceTerritory xmlns="http://soap.sforce.com/2006/04/metadata">
<name>San Francisco Bay Area</name>
<isActive>true</isActive>
<operatingHoursId>BusinessHours_Standard</operatingHoursId>
<parentTerritoryId>California</parentTerritoryId>
</ServiceTerritory>
Mobile Flow for Technicians
Service Appointment opened on mobile
āāā Screen: Confirm arrival (update status to "In Progress")
āāā Screen: Checklist of tasks
ā āāā Loop: For each Work Order Line Item
ā āāā Checkbox: Task completed
ā āāā Text: Notes
āāā Screen: Parts consumed
ā āāā Add Product Consumed records
āāā Screen: Customer signature (capture component)
āāā Update: Service Appointment status ā "Completed"
Common Queries
SELECT Id, AppointmentNumber, ParentRecordId, Status
FROM ServiceAppointment
WHERE Status = 'None' AND SchedStartTime = TODAY
SELECT Id, ServiceResource.Name, ServiceTerritory.Name,
EffectiveStartDate, EffectiveEndDate
FROM ServiceTerritoryMember
WHERE ServiceResource.IsActive = true
SELECT Id, ServiceResource.Name, Skill.MasterLabel, SkillLevel
FROM ServiceResourceSkill
WHERE Skill.MasterLabel = 'Electrical'
Cross-Skill References
- For case-to-work-order automation: see sf-cloud-service
- For scheduling flows: see sf-flow
- For mobile LWC: see sf-lwc
- For deployment: see sf-deploy