In this scenario we need the ability to display a warning message on the Case entity if Active contracts exist for the Customer associated with the Case record.
The screenshot below shows an example of what the end-user would see if there were active contracts for the Customer 'Adventure Works (sample)'.
N52 Formula Manager Solution
The Formula Manager solution works like this,
- We create a formula that executes on the client-side when ever the Customer field on the Case entity changes and when the form first loads
- We use the FindCount() function to check if any active contracts exist
- And if so we display a warning message to the user as a Form notification
- Otherwise we show nothing
N52 Formula Manager Steps
- Create a new formula of type 'ClientSide - Perform Action'
- Set the Source Entity to 'Case'
- Set the Mode to 'Client-Side'
- Set the Source Property to 'Customer' on the desired forms & also select 'OnLoad'. (Use Ctrl key to multi-select)
- Copy & paste the formula below into the formula description field
- Click save
- On the Command Bar click 'N52 Commands - Publish Formula'
- You are ready to test
if( FindCount('contract', SetFindAnd('customerid', 'statecode') , SetFindAnd([incident.customerid], 2) , 'contractid', '0') > 0 , SetFormNotification('Active contracts exists for this customer', 'WARNING', 'msg'), ClearFormNotification('msg') )
Wizard - SetFormNotification
Did you know?
North52 TestShield ensures Quality at Speed
TestShield's automated tests run on the Dynamics 365 platform rather than in the browser allowing extreme speed.
For example, we can run 1100 tests with over 15,000 Asserts to verify a new release of the North52 Decision Suite, in less than 4 minutes!
It means that we can deliver quality releases at unprecedented speed. Before TestShield, testing a new release was very manual and time consuming.