Create a Lead Routing Policy in Salesforce
Configuring flows for all the routing policies is mandatory.
- Log into Salesforce and select Setup.
- In the Quick Search bar, enter “Flow” and select “Flow.”
- Click New.
- Enter a process name in the Process Name field.
- Note: A unique API name is automatically generated.
- Add a description.
- Select the object for which the routing policy was created in Motion App from the start process with the dropdown list.
- Specify when to start the process (e.g., created, every time it is edited).
- Click Save.
- Add a decision to the process
- Add criteria to the decision.
- Define the conditions that determine which actions to take.
- Note: These conditions should align with the selection criteria defined in the Motion App routing policy.
- Create immediate actions for when the conditions are met or not met.
- Add an Apex action to the process.
- Set the Apex class to Policy Handler.
- Configure Apex variables as needed for the opportunity routing queue.
Parameters | Values | Description |
policyType | RoutingQueuePolicy | Irrespective of object the value will not change. |
recordid | Record Id | Eg: Account ID, Lead ID, Case ID, Contact ID, Opportunity ID. |
inputVal1 | Field name on the object which refers to the policy tag. | E.g.: ‘Type’ on Account ‘Lead Source’ for Lead. |
inputVal2 | Field name on object which refers to Skills. | Language |
inputVal3 | NULL/ExecuteBMA | Note: For package 2.162 and later. NULL - no action ExecuteBMA - helps in fetching the latest BMA record if the user has updated any fields in the Lead/Account record. |
inputVal4 | Tag Operator (i) WildCard (ii)Contains (iii)Default (iv)Startswith |
Only if we want to use the tag operator for features we need to provide a value or else we will have default tag functionality. |
inputVal5 | Mode of Execution (i)Asynchronous - ASync (ii)Synchronous - Sync |
How the policy should be executed in synchronous or asynchronous mode. Synchronous is the default. |
Note: The input values that are given above are just examples. The inputVal1 and inputVal2 depend upon your requirements and choice.