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
Praveen MuppriPraveen Muppri 

How to select a default entitlement

Hello All,

We are setting up entitlements within our organization. The requirement is to have a standard SLA for all the accounts and contacts. I have contacted SFDC and they have provided this trigger which will select and set a default entitlement from a contact or account. The trigger is in this link.

https://developer.salesforce.com/page/Default_Entitlement_on_Case_with_Triggers#Trigger_on_Case

However, i need help to add a variable in this trigger which select a default entitlement even if there is nothing on a contact or a account. Basically all new cases created will have a default entitlement set. Can somebody please help? Thank you for your assistance in advance.

Praveen Muppri
Bradley DelauneBradley Delaune
Praveen,
I'd be happy to help!  How do you expect to indicate the default Entitlement?  Do you have a checkbox field that marks the Entitlement as the default (this may cause problems if more than one is selected as default)?  Do you want to add the ID of the Entitlement in a Custom Setting?  Let me know how you expect to programmatically determine the default entitlement.
Praveen MuppriPraveen Muppri
Hello Bradley,

Thank you for your assistance, your help at this time is truly appreciated. As you know, the requirement is if there is no entiltlement on a contact or an account pick up an entitlement.  I think entitlement ID will do the trick. The idea is if there a entitlement on contact or an account pick it or choose the entiltlement which has been specified as default. I hope this helps, again thank you for all the assistance and help.
Bradley DelauneBradley Delaune
Praveen,
What is your experience with Custom Settings?  I think it would be best to store the entitlement ID in a custom setting so that you can update it properly in every org (including production) without modifying code.

Create a Custom Setting (Hierarchical) with one field named "Default Entitlement" that is an 18-character long text field.  Once you build that, we can talk about how to structure the code to add this functionality.  Let me know how it goes.
Praveen MuppriPraveen Muppri
Hello Bradley, i do not have much experience with custom setting. I will try this and get back. I has more hoping if trigger would do the trick. However, i will try this.
Praveen Muppri 5Praveen Muppri 5
Hello Bradley, i have created a custom setting and with that one  field named "Default Entitlement" and its API name is "Default_Entitlement__c". Please let me know what to do next. Thank you.