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 one account.
Fullcast policy rules are configured in the Salesforce instance. to create policy rules for BMA:
In Salesforce, navigate to Setup > Custom Metadata > Manage Records > Fullcast Policy Rules.
Click New and start creating the rules.
Figure 1. Managed Records Callout
Figure 2. New Button Callout
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 | AND, OR |
Literal | Field 2 on the Field 2 object(Account) to String value provided | AND, OR |
Tie Breaker | 2 best match accounts | MAX, MIN, EXIT |
Fuzzy Logic | Unsure data fields | AND, OR |
Field Compare Example

Figure 3. Field Compare
Literal example

Figure 4. Literal Example
Tie-Breaker Criteria
‘TIE BREAKER’ - Using the Field compare or Literal criteria if we get more than 1 Account, the TIE between the records has to be broken to find a single record.
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

Figure 5. Example Tie Breaker

Figure 6. Example Condition for Tie Breaker
The final account could be decided by the rules configured as shown.

Figure 7. BMA Logic
Single Rule (One order only)
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

Figure 8. Single Rule Example
Multiple Rule (Multiple order)
In the below setup we have 2 rules resulting in always one account as the output which is ensured by the Max condition.
Since it's based on two rules we have an order for that as 2

Figure 9. Multiple Rule Example
BMA Logic
If the rules don't create a single best-match account, the BMA logic will select the oldest created account.
Choose which operation to be performed from the drop-down menu for the field Operator. Use the below table to pick the correct operator based on the Field type being used in Field 1 and Field 2 in the rules.
Data Types | Operators Supported |
---|---|
PICKLIST | Not Equal To |
MULTIPICKLIST | Equals To, Contains All, Contains Any, |
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, |
DATE | Not Equals to |
DATETIME | Greater than, Greater than or equals to, |
Enter the number according to which the rule has to be executed. For example, if it has to be executed first then the order number is 1. If it has to be executed third, then the order number is 3, and likewise.
Module name carries the name of your choice. It is an optional field.
Click Save to trigger and call the policy rule whenever necessary.

Figure 10. Fullcast Policy Rules Edit
The below table gives an idea about the supported basic logical expressions and setup

Figure 11. Supported Basic Logical Expressions and Setup Table
Calling BMA from Flow Builder
Warning:
The flow builder must be created to sync the domain and call the BMA. To configure the flow builder, refer to the Configuring Flows for Motion Policies article.
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.
Figure 12. Example Flow Builder Configuration