Explain the Salesforce Field Service data model and how Work Type, Work Order, Service Appointment, Assigned Resource and Service Resource relate to each other.
Answer
The core of Field Service is a chain of objects from the customer request to the person doing the work.
Relationships
- Work Type: a template with estimated duration, required skills, work plan templates and products. A Work Order points to one.
- Work Order: the job to be done. It may have Work Order Line Items, and can link to Account, Contact, Case and Asset.
- Service Appointment: the schedulable visit. Its parent record is the Work Order (or a line item, Account, Opportunity or Lead). It holds the dates, duration, arrival window and status.
- Assigned Resource: the junction that links a Service Appointment to a Service Resource. Crews and multi-technician jobs have several.
- Service Resource: the technician, dispatcher or crew, linked to a User, with skills and territory memberships.
Supporting objects: Service Territory, Service Territory Member, Operating Hours, Skill and Resource Absence.
Flow of data: Work Type \u2192 Work Order \u2192 Service Appointment \u2192 Assigned Resource \u2192 Service Resource.
soql
SELECT ServiceAppointment.AppointmentNumber,
ServiceAppointment.ParentRecordId,
ServiceAppointment.Status,
ServiceResource.Name
FROM AssignedResource
WHERE ServiceAppointment.Status = 'Scheduled'
Data ModelWork OrderService AppointmentService Resource