Skip to content

PranavNagrecha/AwesomeSalesforceSkills / skills/admin/entitlements-and-milestones

entitlements-and-milestones

Unverified

Use this skill to design, configure, and troubleshoot Salesforce Entitlement Management on Cases: entitlement processes, milestone definitions, recurrence types, milestone actions (success/warning/violation), business hours assignment, and entitlement templates. Covers the deployable EntitlementProcess / MilestoneType / EntitlementTemplate / EntitlementSettings metadata, signed timeLength time triggers, recurrenceType semantics, process versioning, and how a milestone actually completes. Trigger keywords: entitlement process, milestone, SLA timer, milestone tracker, first response SLA, time trigger, recursChained, CaseMilestone, EntitlementId, SlaProcess, stopped clock. NOT for SLA milestones on Field Service work orders — use admin/fsl-sla-configuration-requirements. NOT for time-based case escalation rules — use admin/escalation-rules. NOT for the business-hours calendar itself — use admin/business-hours-and-holidays.

references/examples.md

View on GitHub
# Examples — Entitlements and Milestones

## Example 1: Platinum/Gold/Standard Three-Tier SLA Process

**Context:** A B2B SaaS company sells support tiers as line items on their contracts. Platinum customers get 1-hour response / 4-hour resolution during 24/7 coverage. Gold gets 4-hour response / 1-business-day resolution during business hours. Standard gets next-business-day response / 3-business-day resolution.

**Problem:** Without entitlement processes, agents have no visibility into how much time remains on SLA commitments. Escalation rules fire too broadly (they do not distinguish between tiers) and cannot pause for business hours.

**Solution:**

Three entitlement processes are created in Setup > Entitlement Processes:

```
Entitlement Process: "Platinum SLA"
  Business Hours: 24/7 (process level)
  Version: 1
  Start: Case Created
  Exit: Case Closed

  Milestone 1: First Response
    Time Limit: 1 hour
    Recurrence: No Recurrence
    Business Hours: (inherit process — 24/7)
    Warning Actions:
      30 min (50%): Email alert → Case Owner
      45 min (75%): Email alert → Case Owner + Support Manager
    Violation Actions:
      60 min (100%): Email alert → VP Support; Field Update: Case.SLA_Breached__c = true
    Success Actions:
      On Completion: Field Update: Case.First_Response_Met__c = Now()

  Milestone 2: Resolution
    Time Limit: 4 hours
    Recurrence: No Recurrence
    Business Hours: (inherit process — 24/7)
    Warning Actions:
      2 hr (50%): Email alert → Case Owner
      3 hr (75%): Email alert → Case Owner + Support Manager
    Violation Actions:
      4 hr (100%): Email alert → VP Support; Field Update: Case.Resolution_Breached__c = true
```

The Gold and Standard processes follow the same structure with adjusted time limits and a "Business Hours: M–F 8am–5pm" assignment at the process level.

The percentages above are how the tier is *described*. They are not what you deploy: an
`EntitlementProcessMilestoneTimeTrigger` carries a `timeLength` offset from the milestone target and a
unit, never a percentage (Metadata API Developer Guide, api_meta.txt:59204–59224). Convert once, and
keep the conversion beside the design so the next SLA change re-derives all of it:

| Milestone | `minutesToComplete` | Design threshold | Deployed `timeLength` / unit | Sign means |
|---|---|---|---|---|
| First Response (Platinum) | 60 | 50% → 30 min elapsed | `-30` `Minutes` | Warning — target not yet reached |
| First Response (Platinum) | 60 | 75% → 45 min elapsed | `-15` `Minutes` | Warning |
| First Response (Platinum) | 60 | 100% → breach | `1` `Minutes` | Violation — target has passed |
| Resolution (Platinum) | 240 | 50% → 2 hr elapsed | `-120` `Minutes` | Warning |
| Resolution (Platinum) | 240 | 75% → 3 hr elapsed | `-60` `Minutes` | Warning |
| Resolution (Platinum) | 240 | 100% → breach | `1` `Minutes` | Violation |

The full deployable file for a process shaped like this is in `references/metadata-examples.md` § 2.

Each entitlement record is created on the customer's Account, referencing the correct process. When a case is created for the account, a Record-Triggered Flow populates `Case.EntitlementId` by querying the active entitlement for that account.

**Why it works:** Milestone timers respect the process-level business hours assignment, so Gold and Standard timers pause automatically outside M–F 8–5. Platinum timers run 24/7. The action system handles agent notification without custom Apex, and the field updates enable standard reports to track SLA breach rates by tier.

---

## Example 2: Independent Recurrence for Ongoing Response SLA

**Context:** A managed services provider commits to responding to every new comment on an open case within 2 business hours. Customers frequently add comments throughout the day expecting rapid responses. The business wants to track each comment response as a separate SLA commitment.

**Problem:** Using No Recurrence on the response milestone means that once the first response is logged, the milestone is complete and subsequent customer comments have no SLA timer attached.

**Solution:**

```
Entitlement Process: "MSP Ongoing Response"
  Business Hours: M–F 8am–6pm

  Milestone: Customer Comment Response
    Time Limit: 2 hours
    Recurrence: Independent  (MilestoneType.recurrenceType = recursIndependently)
    Reset Event: Case Comment Added (when contact is the author)
    Business Hours: M–F 8am–6pm (milestone-level override to be explicit)
    Warning Actions:
      1 hr (50%): Email alert → Assigned Agent
      1.5 hr (75%): Email alert → Assigned Agent + Queue Manager
    Violation Actions:
      2 hr (100%): Email alert → Customer Success Manager; Field Update: Case.Ongoing_Response_Breached__c = true
```

A Flow also stamps `Case.Last_Customer_Comment__c` each time a contact adds a comment, which feeds a report showing average response time per agent.

**Why it works:** Independent recurrence restarts the milestone timer each time the reset event fires, regardless of whether the prior instance was completed. This means every customer comment opens a new 2-hour SLA window. Warning and violation actions fire independently per instance.

---

## Anti-Pattern: Applying Entitlements but Forgetting the Case Lookup

**What practitioners do:** Enable Entitlement Management, create entitlement processes and entitlement records, then go live — but never populate the `EntitlementId` field on cases created via Email-to-Case or Web-to-Case.

**What goes wrong:** Milestone processes are only triggered when `Case.EntitlementId` is populated. Cases without an entitlement lookup have no process, no milestone timers, and no SLA tracking — silently. Agents see no Milestone Tracker on the case. No warning or violation actions fire. The org believes entitlements are running when they are not.

**Correct approach:** Build a Record-Triggered Flow on Case creation (Before Save for performance) that queries `Entitlement` WHERE `AccountId = triggerCase.AccountId` AND `Status = 'Active'` and stamps the result into `Case.EntitlementId`. For cases without an account (anonymous web submissions), define a fallback default entitlement (e.g., "Standard SLA — No Account") so at minimum baseline tracking applies.

**Diagnosing it before go-live.** The failure is silent, so it needs a query rather than a look at the
Setup screen. Run this by intake channel — any `Origin` with a high `noEntitlement` count is a channel
the automation does not cover:

```sql
SELECT Origin, COUNT(Id) noEntitlement
FROM Case
WHERE EntitlementId = NULL
  AND IsClosed = false
  AND CreatedDate = LAST_N_DAYS:7
GROUP BY Origin
ORDER BY COUNT(Id) DESC
```

Then confirm the cause on one of those cases rather than guessing. `Case.SlaStartDate` "shows the time
that the case entered an entitlement process" (Object Reference, object_reference.txt:62659–62666), so
a null here is proof the case never entered:

```sql
SELECT Id, CaseNumber, Origin, AccountId, ContactId, EntitlementId,
       SlaStartDate, IsStopped, StopStartDate, BusinessHoursId
FROM Case
WHERE Id = '500xx0000000001AAA'
```

For the live version of the same question, turn on a debug log with the **Workflow** category at
**INFO** and create a case through the failing channel: `SLA_NULL_START_DATE` in the log says the
engine ran and found no SLA start date, while no `SLA_PROCESS_CASE` event at all says the engine never
looked at the case (Apex Developer Guide debug-log event table, apexdev.txt:39104–39117). Those two
answers point at different fixes — the first is the entitlement lookup, the second is the process
entry criteria.
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 323kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall