Create a Lead Routing Policy in Salesforce


Configuring flows for all the routing policies is mandatory.

  1. Log into Salesforce and select Setup. 
  2. In the Quick Search bar, enter “Flow” and select “Flow.” 
  3. Click New. 
  4. Enter a process name in the Process Name field.
  5. Note: A unique API name is automatically generated. 
  6. Add a description. 
  7. Select the object for which the routing policy was created in Motion App from the start process with the dropdown list. 
  8. Specify when to start the process (e.g., created, every time it is edited). 
  9. Click Save. 
  10. Add a decision to the process
  11. Add criteria to the decision. 
  12. Define the conditions that determine which actions to take. 
  13. Note: These conditions should align with the selection criteria defined in the Motion App routing policy. 
  14. Create immediate actions for when the conditions are met or not met. 
  15. Add an Apex action to the process. 
  16. Set the Apex class to Policy Handler. 
  17. 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.

Additional Resources

Navigate to the routing policy

Configure the routing policy

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us