Scenario Overview
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)'.
North52 Decision Suite Solution
The North52 Decision Suite 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
North52 Decision Suite 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
Formula
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
Please see below the wizard you can use to create the SetFormNotification() function call used in this formula.