Set UP Milestones | trailhead Screen Reader Instructions
Learning Objectives
After completing this unit, you’ll be able to:
- Define required steps (milestones) for your support team to follow when resolving a customer case.
- Create a timeline of milestones applicable to customer cases.
- Set up automatic actions to notify your support team when a step needs to be completed.
Create a Milestone
Roberto, Ursa Major’s COO, decides to consult with Ada Balewa, product support specialist, to figure out Ursa Major’s customer support strategy. During their meeting, they outline Ursa Major’s new Happy Customer Policy: all high-priority cases must be closed within 16 business hours, and all medium- and low- priority cases must be closed within 32 business hours. They let Maria in on the plan, and she sets up an entitlement process (also known as a customizable timeline of support steps) that enforces the new policy.
First, Maria creates a "master" milestone that she can add to as many entitlement processes as she wants. Remember, milestones represent required steps in your support process.
- From Setup, enter Milestones in the search box, then select Milestones under Entitlement Management.
- Click New Milestone.
- Name your milestone Resolution Time, and enter a description so the support team knows what the milestone is tracking: The time given to resolve a customer’s issue. The countdown starts when the case is created and ends when the case Status is changed to Closed.
- For Recurrence Type, select No Recurrence. This means that the milestone only occurs once per case. Just so you know, there are two other possible recurrence types
- Independent milestones occur whenever the milestone criteria are met on the case.
- Sequential milestones occur on repeat when the milestone criteria are met on the case.
- Click Save.
Now any time Maria wants to see a list of master milestones for Ursa Major, she can enter Milestones in the Setup search box, then select Milestones under Entitlement Management.
Create an Entitlement Process
Now that Maria has created a master milestone, it’s time for her to add it to an entitlement process. That’s where she adds the specifics, like case resolution time for high-priority cases.
Maria creates an entitlement process that represents Ursa Major’s standard support terms.
- From Setup, enter Entitlement Processes in the search box, then select Entitlement Processes under Entitlement Management.
- Click New Entitlement Process.
- If you encounter a dropdown for choose a Type, select Case.
- Name your process Standard Support, and enter the description: The default support process for customers.
- Don’t select the Active checkbox. We activate the process after we add milestone actions to it.
- If you’d like, select a business hours option.
Tip: Business hours let you specify the hours when your support team is available to serve customers. If you don’t set any, your org defaults to 24/7 business hours.
- Leave the other fields as is, and click Save.
Woohoo! Maria has set up Ursa Major’s Standard Support process, which she can apply to customers’ entitlements. However, her process doesn’t have any milestones. Not a problem! She can fix that by adding the master milestone she created.
Add a Milestone to an Entitlement Process
An entitlement process needs milestones to represent required support steps, otherwise it’s just an empty framework. Maria adds her Resolution Time milestone so agents know how much time they have to resolve cases according to Ursa Major’s standard support process. Let’s see how she does it.
- Navigate to the detail page of the Standard Support entitlement process you created. From Setup, enter Entitlement Processes in the search box and select Entitlement Processes. Then, in the table of available entitlement processes, click the link for Standard Support.
- Under the Milestones heading, click New.
- For Milestone Name, choose the Resolution Time milestone you created at the beginning of this unit.
- Time Trigger (Minutes) is the number of minutes that agents have to complete the milestone—in other words, how long they have to resolve the case. Let’s revisit the terms of Ursa Major’s Happy Customer policy:
- All high-priority cases must be closed within 16 business hours.
- All medium- and low-priority cases must be closed within 32 business hours.
First, let’s tackle the high-priority case resolution limit. Enter 960 (that’s 16 hours x 60 minutes).
- Leave the Apex Class checkbox deselected. (This option lets you use Apex classes to calculate the time trigger dynamically. For now, let’s stick with the basics.)
- Leave the Start Time and Business Hours fields as is.
- For Order, enter 1.
- Leave the Criteria field as is, and select the criteria that must be met for the milestone to count down: Case: Priority equals High.
- Click Save.
- Now, let’s set up the same milestone for your medium- and low-priority cases.
- Under the Milestones heading, click New.
- For Milestone Name, choose the Resolution Time milestone again.
- Since medium- and low-priority cases must be closed within 32 hours, enter 1920 in the Time Trigger (Minutes) field.
- Leave the Apex Class checkbox deselected.
- Leave the Start Time and Business Hours fields as is.
- For Order, enter 2.
- Leave the Criteria field as is, and enter the criteria that must be met for the milestone to count down: Case: Priority equals Medium, Low.
- Click Save.
Nicely done! Now Ursa Major’s entitlement process “knows” that high-priority cases must be resolved within 16 hours, and that medium- and low-priority cases must be resolved within 32 hours. Next, Maria adds a workflow action to notify agents when an open case is getting close to the resolution time limit.
Add a Milestone Action
Now that Maria has done a stellar job adding required steps to Ursa Major’s standard support process, she’s ready to do more. To keep agents in the know, she adds a milestone workflow action that warns agents when an open high-priority case is approaching the resolution time limit.
- Navigate to the detail page of the Standard Support entitlement process you created. From Setup, enter Entitlement Processes in the search box and select Entitlement Processes. Then click Standard Support.
- Under the Milestone heading, click the name of your milestone for high-priority cases.
- Under the Actions heading, locate the area for Warning Actions. Click the Add Time Trigger button below it.
- Enter 2 and select Hours so agents are notified 2 hours before the Resolution Time milestone expires.
- Click Save.
- Under the Actions heading, locate the area for Warning Actions, and find your new time trigger. Click Add Workflow Action. This is located directly above the Add Time Trigger button and may announce to the screen reader as text rather than a button.
- A list of actions appears, though your screen reader focus may jump to the top of the page. Navigate back down to this section and click the link for New Email Alert.
- Enter a description: 2 hour warning before milestone expires.
- Use the Email Template lookup to select the Support: Case Response template.
- In the Recipient Type dropdown, select Owner, then choose Case Owner from the Available Recipients list. Use the Add link to move it to the Selected Recipients list.
- Leave the remaining fields as is, and click Save. Now, case owners of high-priority cases receive a warning email 2 hours before the 16-hour resolution time limit is reached.
Maria celebrates her hard work—she’s in the home stretch!
Activate the Entitlement Process
Maria has set up an awesome entitlement process that reflects Ursa Major’s Happy Customer policy. Now it’s time for her to switch it on so she can apply it to customer entitlements.
- Navigate to the entitlement process.
- From Setup, enter Entitlement Processes in the search box, then select Entitlement Processes.
- Locate the Inactive Processes heading. From the table below, click the name of the process: Standard Support.
- Click the Edit button.
- Select the Active checkbox, and click Save.
Apply the Entitlement Process to an Entitlement
Now that Maria’s entitlement process is ready for business, she can apply it to any customer entitlements she wants. This means that cases created from the entitlement follow the steps in that entitlement process. She starts by applying her entitlement process to the Standard Phone Support entitlement she created for DreamHouse Realty.
- In the App Launcher, type Entitlements in the search bar, then select Entitlements.
- Select the Standard Phone Support entitlement.
- Edit the entitlement. In the Entitlement Process field, use the lookup to select the Standard Support process.
- Click Save.
Create a Case Trigger for Entitlements
Without using an Apex trigger, entitlements aren’t automatically added to new cases. When a case’s Entitlement field is empty, this sample trigger checks whether the case contact has an active entitlement. If the contact has an active entitlement, the entitlement is added to the case. So Maria gets to work adding a basic trigger for cases.
- From the Object Manager in Setup, enter Case in the Quick Find box, then select Case.
- Select the Triggers tab.
- Click New Trigger.
- Delete the blank trigger. Then copy and paste this code sample into the page. Note that there is a bug in Google Chrome which hides the edit field from screen reader access. The code editor is visible in Firefox and other non-chromium browsers.
trigger DefaultEntitlement on Case (Before Insert, Before Update) {
Set<Id> contactIds = new Set<Id>();
Set<Id> acctIds = new Set<Id>();
for (Case c : Trigger.new) {
contactIds.add(c.ContactId);
acctIds.add(c.AccountId);
}
List <EntitlementContact> entlContacts =
[Select e.EntitlementId,e.ContactId,e.Entitlement.AssetId
From EntitlementContact e
Where e.ContactId in :contactIds
And e.Entitlement.EndDate >= Today
And e.Entitlement.StartDate <= Today];
if(entlContacts.isEmpty()==false){
for(Case c : Trigger.new){
if(c.EntitlementId == null && c.ContactId != null){
for(EntitlementContact ec:entlContacts){
if(ec.ContactId==c.ContactId){
c.EntitlementId = ec.EntitlementId;
if(c.AssetId==null && ec.Entitlement.AssetId!=null)
c.AssetId=ec.Entitlement.AssetId;
break;
}
}
}
}
} else{
List <Entitlement> entls = [Select e.StartDate, e.Id, e.EndDate,
e.AccountId, e.AssetId
From Entitlement e
Where e.AccountId in :acctIds And e.EndDate >= Today
And e.StartDate <= Today];
if(entls.isEmpty()==false){
for(Case c : Trigger.new){
if(c.EntitlementId == null && c.AccountId != null){
for(Entitlement e:entls){
if(e.AccountId==c.AccountId){
c.EntitlementId = e.Id;
if(c.AssetId==null && e.AssetId!=null)
c.AssetId=e.AssetId;
break;
}
}
}
}
}
}
}
- Click Save.
Now, DreamHouse Realty’s cases automatically follow Ursa Major’s Standard Support process. That means Ursa Major’s support team sees the Resolution Time milestone counting down on the case.
Resources
Click to return to the unit on Trailhead.