function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sudipta DebSudipta Deb 

Automate the process of associating Entitlements with new cases

I would like to understand how to automate the process of attaching entitlements to a newly created cases. Say for example - If I have two entitlements for Account A. First entitlement is for High Priority Cases and Second entitlement is for Low Priority Cases. I have different milestones setup accordingly. Now when a new case will be logged into the system, how to make sure proper entitlement will be associated with the case automatically. For example - if the new case is having priority high, first entitlement should be associated, whereas if the new case is having priority low, second entitlement should be associated.

Now I know that I can write a trigger to do that. But the problem that I am facing how to compare the conditions setup on Entitlement process with the case properties. If you have done anything like that before, any help will be highly appreciated. Thanks.
sharathchandra thukkanisharathchandra thukkani
We have a field called "EntitlementId" on case object when you enable entitlement process you see this field.

So you can prepare a custom setting metioning Account Name, Case Priority, EntitlementId

So in the case before trigger you can query for EntitelmentId from the custom setting based on your case priority and account name and assign it to EntitlementId.

Let me know if you face any issue.