# Why are Business Hours and Holiday configurations critical for accurate milestone SLA calculations?

**Topic:** Service Cloud · **Difficulty:** Medium · **Tags:** Service Cloud, Business Hours, Holidays

Read it on the site: https://www.forcechallenges.com/interview-questions/why-are-business-hours-and-holiday-configurations-critical-for-accurate-milestone-sla-calculations

## Answer

**Basics:** An SLA like "first response within 4 business hours" is meaningless if the clock keeps running overnight or on a public holiday. Business Hours define the weekly working schedule in a time zone; Holidays list dates excluded from it. Without them, Salesforce assumes 24x7 and agents appear to breach SLAs for hours when nobody was on duty.

**How it works:** Setup > Business Hours: create schedules per day, set the time zone, mark one as default. Setup > Holidays: create dates (one-time or recurring) and attach them to the business hours records through the Holidays related list. Then reference the hours on the entitlement process (and entitlement records, and Case through its Business Hours field). When a milestone starts, Salesforce counts only minutes inside open hours and skips attached holidays to compute the target date and time remaining.

**Advanced / deep dive:** Multiple business hours records let you support regional teams or premium tiers (for example 24x7 for Platinum, 9-5 for Standard). Precedence between case-level and entitlement-process-level hours can surprise people, so test with a case and verify the order in current documentation. Holidays are matched by attached business hours, not globally, so a holiday not attached to a schedule has no effect. Apex exposes the `BusinessHours` class (`isWithin`, `nextStartDate`, `add`, `diff`) for custom date math such as escalation reminders, and it requires the business hours Id. Business-hours-based fields also feed reports on time in status. Changing hours later does not retroactively recalculate past milestones.

**Code / config example:**
```apex
// Compute a due date that respects the default business hours and attached holidays
BusinessHours bh = [SELECT Id FROM BusinessHours WHERE IsDefault = true LIMIT 1];
Datetime start = Datetime.now();
Datetime dueDate = BusinessHours.add(bh.Id, start, 4 * 60 * 60 * 1000L); // 4 business hours in ms
Boolean open = BusinessHours.isWithin(bh.Id, start);
```

**Hidden gotchas & must-remember points:**
- Business hours store a time zone; an agent's personal time zone does not change the SLA.
- Holidays do nothing until linked to a business hours record.
- Recurring holidays must be defined as recurring, or you re-enter them every year.
- Business hours class methods take milliseconds and require the hours Id; querying BusinessHours without filtering returns multiple records.
- Entitlement Management and milestones must be enabled in Setup first.
- Changing business hours does not recalculate milestones already running.

**Best practice:** Model one business hours record per support region/tier, link all local holidays, and test an overnight and holiday case before go-live.

---
Source: ForceChallenges · last updated 2026-11-02
