How does Best Match Account work?
IN THIS ARTICLE
Creating Fullcast Policy Rules for Best Match Account
Criteria and Condition Setting
Calling BMA from Process Builder
The best match account process is a filtering mechanism based on the rules configured in a specific order to get a record (lead/opportunity/cases/contact) to match to one account.
Creating Fullcast Policy Rules for Best Match Account
- Log in to the Salesforce account.
- Click on the Setup and search for Custom Metadata types
- Click on Manage Records against Fullcast Policy Rules.
Click New and start creating the rules.
- Enter label name which must begin with a letter and use only alphanumeric characters and underscores. The name cannot end with an underscore or have two consecutive underscores.
- The Fullcast Policy Rules Name is automatically picked which is the unique name used by the API and managed packages.
- Pick Criteria and Condition fields from the drop-down menu available.
- String field needs to be updated only if the Criteria field picked is LITERAL.
- Field 1 Object is Lead or Contact which needs to be compared with the Account.
- Field 1 is the API field of the Field 1 object which needs to be compared API field of the Account.
- Field 2 Object should always be Account which is compared with Field 1 object.
- Field 2 is the API field of Field 2 Account which is compared with the API field of the Field 1 object.
Criteria and Condition Setting
Criteria | Fields Compared | Conditions Supported |
Field Compare | Field 1 on the Field 1 Object (Eg. Lead/Contact) to Field 2 on the Field 2 Object (which should always be an account) |
AND, OR |
Literal | Field 2 on the Field 2 object(Account) to String value provided on the Custom Metadata. |
AND, OR |
Tie Breaker | 2 best match accounts | MAX, MIN, EXIT |
Fuzzy Logic | Unsure data fields | AND, OR |
Field Compare Example
Literal example
Tie-Breaker Criteria
- More than one tie-breaker criteria could be used.
- MIN is used to order the records in ascending order.
- MAX is used to order the records in descending order.
- EXIT is used if the user does not want to choose any from the tied (similar) records, instead prefers a null value for the BMA.
Tie-breaker Example
The final account could be decided by the rules configured as shown.
- In the below setup we have 3 rules resulting in always one account as the output which is ensured by the Max condition.
- Since it's based on a single rule we have order for all of them as 1
Multiple Rule (Multiple order)
BMA Logic
If the rules don't create a single best match account, the BMA logic will select the oldest created account.
Data Types | Operators Supported |
PICKLIST |
Not Equal To |
MULTIPICKLIST |
Equals To, Contains All, Contains Any, Does not contain |
URL |
Not Equal To |
STRING |
Equals To |
EMAIL |
Contains All, Contains Any, Does not contain |
BOOLEAN |
Not Equals To, Equals to |
CURRENCY |
Not Equal To |
PERCENT |
Equals To |
DOUBLE |
Greater than, Greater than or equals to, Less than, Less than or equal to |
DATE |
Not Equals to |
DATETIME |
Greater than, Greater than or equals to, Less than, Less than or equal to, Equals to |
The below table gives an idea about the supported basic logical expressions and setup
Calling BMA from Flow Builder
The process builder needs to be created in order to sync the domain and call the BMA.
Configure the flow builder by following the link.
The apex variables for BMA is as follows:
- RecordID : Use field reference in the type to select AccountID
- PolicyType: Set the Type to string with value "CleanDomain" (case sensitive)
- If inputVal1 is Yes, it will call clean domain functionality.
- If inputVal1 is No, it will not call clean domain functionality.
- If inputVal2 is Yes, it will execute BMA functionality.
If inputVal2 is No, it will not execute BMA functionality.