In our example, a customer wishes to know the number of business hours which have elapsed from when a case was created to when a response was made.
We shall use a North52 function called GetDifferenceWorkingTime() to calculate it. We will then save it in a custom field called Business Hours Elapsed.
Note : You will need to create a custom field called new_businesshourselapsed for this example.
N52 Formula Manager Solution
The Formula Manager solution works like this:
- Whenever the field Follow Up By is updated on the Case entity, the formula is triggered
- The formula will calculate the time elapsed between the Creation On date/time of the case and the Follow Up Bydate/time
- It will then update a custom field called Business Hours Elapsed with this calculation.
N52 Formula Manager Steps
The following set of steps assumes you are just using the out of the box Dynamics CRM setup. But its easy to enhance if you have extra fields/requirements.
- Create a new formula of type 'Save - Perform Action'
- Set the Event field to 'Create & Update'
- Set the Source Entity to 'Case'
- Set the Source Entity Property to 'Follow Up By'
- Copy and paste the formula below into the formula description field and click Save
- You are ready to test
UpdateRecord('incident', [incident.incidentid], SetAttribute('new_businesshourselapsed', GetDifferenceWorkingTime([incident.createdon], [incident.followupby], 'false', '09:00', '17:00', 'h')) )
Wizard - GetDifferenceWorkingTime
Please see below the wizard you can use to create the GetDifferenceWorkingTime() function call used in this formula.
Note : Setting Business Calendar to True will ensure the formula takes into account non-working weekdays (such as Christmas , New Year's day etc) that have been set up in the Business Closures Calendar: Settings > Business Managment > Business Closures.
Did you know?
xCache helps you manage environment specific configuration
North52's Decision Suite component xCache allows you to set up environment specific data to allow you to use different values for different instances. Your advanced business rules logic could be the same, however you need to use specific reference values for a particular instance.
For example, credentials for a web service used in your Formula - you will likely use different keys/URLs for your Dev, Test and Production instances. Store these in xCache and let the North52 business rules engine apply the correct ones at runtime!