Well , fortunately business rules can help if you need to perform some simple calculation on a form based on field values too. Lets get into action.
So lets create a business role.
- Add a new condition to check if Est. Closed date contains data AND the new field(date difference) doesn’t not contains data.
please note that if we don’t check the second condition the business rule will run every time and set the value to date difference on every on load even if date difference has been set last time :
- Now once we are done with condition , lets add the action to it “set field value”. and from right side select the field = “date difference” , Type = “Formula”, other field = “Est Closed Date” , Operator = “-“, Type = “Value” , Days = “10”. Take a look at reference below:
- now lets apply , save , Activate the business rule.
- Lets open a record a with estimated closed date and see it in action 🙂
- the date difference field has been set to 10 days before the est close date which is 24-02-2017.
There you go , it was simple example but i am sure you can perform some more complex calculation and not on just date fields but on currency and other fields.
Hope this helps!