In this business scenario you have a requirement that whenever a user opens an Account record or a user changes the category of a customer that you check the value of outstanding Invoices for that customer. And if the value is more than 50k then display a form level notification to the user stating not to create any more Orders for this customer.
This is a sensitive requirement for the customer & so the query to find the sum of outstanding Invoices needs to be run in real-time, which is the default for North52 formulas..
North52 Decision Suite Solution
The North52 Decision Suite solution works like this,
- We create a formula of type 'ClientSide - Perform Action' for the Account entity
- This formula will be executed for the OnLoad event of the form & for the OnChange event of the Category field.
- The formula itself will run a query against the Invoice entity to Sum all the oustanding Invoices for the current customer.
- If the value exceeds 50k then a Form Level Notification will be shown to the end user.
North52 Decision Suite Steps
- Create a new formula of type 'ClientSide - Perform Action'
- Set the Source Entity to 'Account'
- Set the Source Property to 'OnLoad & Category' for the desired form and\or forms. (Use the Ctrl key to multi-select)
- Copy & paste the formula below into the formula description field & click save
- Next click N52 Commands on the command bar & choose the 'Publish Formula' menu option.
- You are ready to test
if( ([account.accountcategorycode] = 2 and FindSum('invoice',
'totalamount','0',true) > 50000),
SetFormNotification(This standard customer is over the 50k invoice limit.
DO NOT CREATE ANY ORDERS !!!, WARNING, msg1),
Wizard - FindSum
Did you know?
TestShield enables effective test data management
Test data can be easily created from existing records in your system, generating a 'snapshot' of data that represents a valid (or invalid) scenario. This can be easily manipluated and variations created in the Test Data editor to cover valid or invalid test scenarios. Sensitive data can be masked, changed or removed.
The saved test data is then available to be used when creating your automated tests. It can be reused many times over avoiding repeated effort and maximizing the value of the work done.