In this scenario you are using the out of the box Phone Call entity and you have a business requirement that when a user opens a Phone Call record that you populate the 'Actual Start' date with the current date and time. This needs to happen in real-time with no user interaction.
North52 Decision Suite Solution
The North52 Decision Suite solution works like this,
- We create a formula that can hook into the 'OnLoad' event for a form belonging to the Phone Call entity
- When the user opens the form the formula will execute
- If the Phone Call Status is set to Open it will set the Actual Start field on the form to the current datetime
North52 Decision Suite Steps
The following set of steps will set this formula up for you.
- Create a new formula of type ClientSide - Perform Action
- Set the Source Entity to Phone Call
- Set the Mode to Client Side
- Set the Source Property to OnLoad for the desired form
- If the Decision Table editior is not displayed, click on the Command dropdown and select Toggle Editor
- Select cell A4 directly under the Condition column in the Decision Table.
- Open up the Source tab and search for 'Status'
- Click on Status Reason
- Click underneath this (cell A4) and go to the Source tab again.
- Expand Status Reason and select Open
- Next go to the Action column.
- Search the Source tab for 'actual start'
- Select Actual Start
- Now select cell B4 underneath Actual Start.
- Go to the Function tab and search for 'localdatetime'
- Select LocalDateTime()
- Click Save
- Click N52 Commands in the command bar and then choose the Publish Formula item
- You are now ready to test.
Note : you may need to add the Actual Start field to the Phonecall form as it is no longer default
DecisionTable( IfTrue( [phonecall.statuscode] = 1 , MultipleClientSide( SetClientSideField('actualstart', LocalDateTime()) )) , 'true|false')
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!