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.
N52 Formula Manager Solution
The Formula Manager 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
N52 Formula Manager 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')