# How do you model labor laws, union rules and mandatory technician breaks in Salesforce Field Service scheduling?

**Topic:** Field Service · **Difficulty:** Hard · **Asked at:** Salesforce, Deloitte Digital, PwC · **Tags:** Field Service, Labor Compliance, Operating Hours

Read it on the site: https://www.forcechallenges.com/interview-questions/how-does-salesforce-field-service-handle-labor-laws-union-rules-and-mandatory-technician-breaks

## Answer

Field Service has **no single "labour law" switch**. Compliance is built from several settings that you combine, and then checked with reports.

**Building blocks**
- **Operating Hours and Time Slots**: cap the hours a technician can be scheduled each day and week.
- **Resource Absences of type Break**: reserve a mandatory break, such as a 45-minute lunch, so the engine never schedules over it.
- **Service Resource Availability work rule**: makes the engine respect those hours and breaks.
- **Minimize Overtime objective**: steers work away from overtime hours where possible.
- **Time Sheets and Time Sheet Entries**: record actual hours for payroll and audit.
- **Union or contract rules** (for example job types only certain staff may do): use skills, Extended Match or Excluded Resources.

**Create daily breaks in Apex**

```apex
List<ResourceAbsence> breaks = new List<ResourceAbsence>();
Date tomorrow = Date.today().addDays(1);
for (ServiceResource sr : [SELECT Id FROM ServiceResource
                           WHERE IsActive = true AND ResourceType = 'T']) {
    Datetime start = Datetime.newInstance(tomorrow, Time.newInstance(12, 0, 0, 0));
    breaks.add(new ResourceAbsence(
        ResourceId = sr.Id, Type = 'Break',
        Start = start, End = start.addMinutes(45)
    ));
}
insert breaks;
```
Remember that times use the running user's time zone, so create breaks in the technician's local time.

**Good practice**
- Automate break creation with a scheduled Flow or Apex job.
- Report on hours worked, overtime and break compliance.
- Remember that the rules differ by country and contract, so get legal and HR sign-off on the configuration.

**Interview tip:** be clear that Salesforce provides the tools, and the *customer* must define and validate the rules.

---
Source: ForceChallenges · last updated 2026-10-31
