While creating a milestone in entitlement process we specify warning and violation time statically. I have a custom date field in Case. The milestone should enter in warning state only when the current day is 1 day before that custom date field. And milestone should enter in violation state when the current day is 1 day past the custom date. So, I need to specify the warning and violation time dynamically. How to do this dynamically?
Best Answer
If I can understand your question correctly, the milestone duration (in minutes) will be based on the difference of Custom Datetime field and current system date.
So, you need to create a apex class which
implements
Support.MilestoneTriggerTimeCalculator and here you will calculate the duration of that milestone.Specify the apex class name selecting the lookup field in the milestone configuration as follows:
The Warning and Violation is easy to configure. Specify 1 day before and 1 day after respectively in those sections.