Scenario Overview

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

Formula : 

IfTrue(  [phonecall.statuscode] =  1   ,
          MultipleClientSide(  SetClientSideField('actualstart',
                                          LocalDateTime()) ))  

, 'true|false')

Did you know?

You can easily copy/clone test data in TestShield

Once you have set up test data with TestShield it is easy to create a copy/clone and make changes. It is centrally stored so that all users creating tests can use the test data in their tests. This approach dramatically reduces the time it takes to create tests, enabling teams to deliver Dynamics 365 projects faster and at less cost.

Learn more about TestShield