A new knowledge base article has been published on our support portal.
In this scenario we will demonstrate how to set up a Decision Table that uses the ClientSideFunction AddPreFilterLookup() to filter a lookup on an Opportunity record based on a variety of business rules.
For this article it is assumed that you have at least basic familiarity with Decision Tables and/or have read the following articles:
Note: We will not detail step-by-step instructions here on how to set up Conditions or Actions, please read the above articles if you need detailed configuration steps.
This company has its Sales Agents separated into 2 Positions:
- Senior Sales
- Junior Sales
Each Opportunity record has a new lookup field called Lead Sales Agent that we will apply the AddPreFilterLookup() to.
The following business rules must be implemented in the Decision Table :
Rule 1 If the Parent Account of the Opportunity has a credit hold applied then no Lead Sales Agent can be assigned.
Rule 2 Only Sales Agents in the same Territory as the Parent Account can be assigned to the Opportunity
Rule 3 If the Opportunity has a Rating of Hot then only a Senior Sales agent can be assigned, otherwise Rules 4,5 & 6 apply.
Rule 4 If the Parent Account is a Preferred Account and the Estimated Revenue of the Opportunity is over €500,000 then it must be assigned to a Senior Sales agent
Rule 5 If the Parent Account is a Standard Account and the Estimated Revenue of the Opportunity is over €1,000,000 then it must be assigned to a Senior Sales agent
Rule 6 All other Opportunities must be assigned to a Junior Sales agent.
N52 Formula Manager Solution
The Formula Manager solution works like this:
- A formula of type ClientSide – Perform Action is created on the Opportunity entity
- When the form loads the Decsion Table logic is executed and filters the Lead Sales Agent lookup view accordingly