What role do Milestones play in measuring and enforcing Service Level Agreements (SLAs)?
Answer
Basics: An SLA says what support you promise and how fast. In Salesforce, Entitlement Management models this: an Entitlement is attached to a case, an Entitlement Process defines the sequence of milestones, and each Milestone has a target time. Case Milestone records show whether each step is open, completed or violated.
How it works:
- Enable Entitlement Management and define Milestones (Setup > Milestones) with a name and recurrence type.
- Create an Entitlement Process (Type: Case or Work Order), set the start/exit/entry criteria, and business hours if applicable.
- Add milestones to the process with a Time Trigger (minutes, hours or days), criteria for when the milestone applies, and actions.
- Actions: Success actions (completed in time), Warning actions (time trigger before target), Violation actions (target passed).
- Link the Entitlement to the process; when a case gets that entitlement, CaseMilestone records are created.
- Complete the milestone when the condition happens (for example first outbound email) via Flow or Apex, or the agent clicks Complete in the milestone tracker.
Advanced / deep dive: Milestone clock start and stop depend on case status and the Pause conditions (Stop clock when status is On Hold, if configured by the process "Exit criteria" and business hours). Recurrence types: No recurrence, Independent (restarts per criteria), Sequential. Reporting uses CaseMilestone fields (TargetDate, IsViolated, IsCompleted, CompletionDate, ElapsedTimeInMins). Use a Flow on Case, or Apex, to set CaseMilestone.CompletionDate for automatic completion.
Code / config example: Complete open "First Response" milestones when an agent replies (bulk safe):
Set<Id> caseIds = new <Id>();
List<CaseMilestone> toClose = [
SELECT Id FROM CaseMilestone
WHERE CaseId IN :caseIds AND MilestoneType.Name =
];
(CaseMilestone cm : toClose) cm.CompletionDate = System.now();
update toClose;