I have a requirement. On opportunity there is a field Min Term (months) and a closedate field(standard).
Need to create a check box field "Opp 50% expired". It will be auto-ticked when closedate + minTerm/2 > today.
I tried to achieve by creating the formula field but found that we can't add months to a date.
Tried to use some custom formula but they also do not work in all scenarios.
Can we do this using apex ?
Thanks in advance
Best Answer
While I think this could be done with code relatively easy, I think you can do this without code as well. Here is something you might want to explore:
Create a new formula field called "50% date field. (mt__c is the name of the min term field)
Create a new Workflow rule on Opportunity object to automatically check the checkbox 0 hours after that formula date.
Create a field update to check the checkbox "Opp 50% expired"; This should happen 0 hours after the formularized 50% date field.
You'll probably need to extend this, or create another workflow rule, to handle the case of when the we're already passed the midpoint of the min term + the close date. That should be considerably easier than this workflow rule.
Best of luck!
-Wes