How do entitlement templates automate SLA assignment upon product sale or asset registration?
Answer
Basics: An Entitlement says what support a customer gets: account or asset, dates, business hours, entitlement process (SLA) and per-incident limits. An Entitlement Template stores those terms for a product so staff can apply them consistently. The original answer overstates this; templates themselves do not fire on a purchase. They also have historically been a Salesforce Classic feature; verify Lightning support in your release.
How it works: Setup > Entitlement Templates: define name, type, entitlement process, business hours, term, cases per entitlement. Add the template to Products. For automation, create a record-triggered flow or Apex trigger on Asset (or Opportunity Product / Order Product / Service Contract Line Item) that creates an Entitlement with AccountId, AssetId, SlaProcessId, BusinessHoursId, StartDate and EndDate. Then enable Entitlement Settings so cases automatically pick the matching entitlement (for example when the contact's account has one active entitlement).
Advanced / deep dive: Decide whether entitlements hang off Account, Asset or Service Contract. Asset-level entitlements enable product-specific SLAs; contract-level ones suit enterprise agreements. Use a custom mapping (Custom Metadata Type) from Product to Process so admins can change it without code. Consider renewals: extend EndDate or create a new entitlement rather than editing history. Case entitlement auto-population is the common failure point; when multiple entitlements are active, pick rules explicitly via flow or entitlement lookup filters.
Code / config example:
// Called from an after-insert Asset handler (bulk-safe)
public static void createEntitlements {
List<Entitlement> ents = <Entitlement>();
(Asset a : assets) {
ents.add( (
Name = + a.Name, AccountId = a.AccountId, AssetId = a.Id,
SlaProcessId = slaProcessId, BusinessHoursId = bhId,
StartDate = Date.today(), EndDate = Date.today().addYears()));
}
insert ents;
}