Assign leads to regional salespeople using a workflow
Published: May 18, 2007
If your organization has regional salespeople, assigning new leads to the correct owner can be a repetitive, tedious task for your sales manager. Instead of doing this manually, you can create a workflow rule that assigns new leads to salespeople in Microsoft Dynamics CRM based on specific criteria, such as geographic region. You can also create a workflow sub-process that generates a follow-up phone call activity for the lead, and then notifies the lead’s new owner that they’ve been assigned the lead and the corresponding phone call activity.
There are 5 steps to using a workflow:
1.
Create the workflow rule.
2.
Define what you want the workflow rule to do.
3.
Add more actions to your workflow.
4.
Activate the workflow rule.
5.
Monitor instances of the workflow.
When you’ve finished creating the workflow in this article, when a new lead is created, the workflow will:
•
Assign the lead to a new owner based on the ZIP Code in the lead.
•
Create a follow-up activity for the new owner to telephone the lead.
•
Send an e-mail notification to the new owner that lets the owner know that the lead has been assigned to him or her and that there is a new phone call activity to complete.
Tip
Although the workflow rule in this article relies specifically on U.S. ZIP Codes in the ZIP/Postal Code field, you can use similar workflow logic to reassign leads based on any of the address fields in new lead records. For example, you could reassign leads based on geographic information such as the telephone area code, county, state or province, or country.
Workflow logic depends on what entity you want the workflow to act on and which event triggers the workflow. Therefore, before you can define the logic for your lead assignment workflow, you must create an empty workflow rule.
Important
You must create workflow rules, workflow templates, and sales processes using the Workflow Manager tool. Workflow Manager is a separate application that must be installed on the server that is running Microsoft Dynamics CRM 3.0.
1.
On the computer that is running Microsoft Dynamics CRM 3.0, start Workflow Manager. Click Start, point to All Programs, point to Microsoft CRM, and then click Workflow Manager.
2.
In the Log On dialog box, verify that the URL displayed in the Target Microsoft CRM server box is correct, and then click OK.
3.
In the Entity Type list, click Lead.
4.
On the File menu, click New.
5.
In the Name box, type the name that you want to use for the workflow rule.
6.
In the Description box, type a description for the workflow rule. (Descriptions are optional.)
7.
Verify that “Create” appears in the Event list.
8.
Click Next and continue with the steps that are described in the next section.
Now that you’ve created the empty workflow, you must define the conditions for the workflow, and each action you want the system to perform when these conditions are met. For this example, the workflow will assign new leads to Microsoft Dynamics CRM users based on the first number in the ZIP Code listed in the address for the lead.
Each workflow must include at least one action. However, most of your workflows will probably include at least one condition (an if statement) and a corresponding action (a then statement). Workflows can also include additional logic, such as an alternative set of conditions (else if statements) and their actions (then), or conditions and actions nested within other then statements.
For this example, the primary condition and action will assign leads on the West Coast of the United States (with ZIP Codes that begin with a 9) to one salesperson. Alternative conditions will assign leads in the Central and Eastern regions to a second and third salesperson.
1.
Under Common Tasks, click Insert Condition, and then click Check conditions.
2.
Click <<add conditions here>>, click Insert Condition again, and then click Check entity condition.
3.
In the Create Condition dialog box, in the Field list, scroll to the bottom and click ZIP/Postal Code.
4.
In the next field, click begin with.
5.
Click the browse button next to the last field, and in the Select Value dialog box, in the Value field, type 9, and then click OK. Click OK again to close the Create Condition dialog box.
6.
Click <<add actions here>>, click Insert Action, and then click Assign entity.
7.
In the Assign Entity dialog box, click User, click the Lookup button next to the Assign to field, and use the Look Up Records dialog box to find the person to whom you want to assign the new leads.
8.
Double-click the person’s name to move them to the Selected box, and then click OK. Click OK again to close the Assign Entity dialog box.
9.
To add more conditions, you must add an Else if element to your workflow logic. Click the first If in your workflow rule, click Insert Condition, and then click Else if.
10.
Repeat steps 2 through 9 for each additional condition you want to add. For example, you could create Else if elements for the first digit of each U.S. ZIP Code.
When you’ve finished creating the workflow logic, it will resemble this:
Assigning the lead to a new owner may not be enough for your business. You could also create a follow-up phone call activity and let the new owner know by sending the owner an e-mail message. By developing this workflow logic as a sub-process, you can call the same logic from each then statement in your original workflow, without having to repeat the logic.
1.
In Workflow Manager, in the Entity Type list, click Lead.
2.
On the File menu, click New.
3.
Fill in the Name (such as “Qualification Phone Call”) and Description fields.
4.
In the Event list, click Manual, and then click Next.
5.
Under Common Tasks, click Insert Action, and then click Create activity.
6.
In the Create Activity dialog box, in the Type list, click Phone Call.
7.
Fill out the Subject, Description, Priority, and Due fields with the information that you want to include, and then click Create Activity.
Tip
You can use data fields to display dynamic information in the subject and description. For example, in the
Description field, you could include the first and last name of the lead, and the lead’s phone number (if available). Click the Data Field Values button to open the Data Field Values dialog box and configure one or more data fields.
8.
Click the Phone Call line you created in the previous steps, click Insert Action again, and then click Send e-mail.
9.
Select a template from the Template list, or fill out the Subject, Description, and Priority fields with the information that you want to include in the e-mail notification messages.
Tip
You can also use data fields in e-mail messages.
10.
Click Create E-mail.
When you’ve finished creating the logic for your workflow sub-process, it will resemble this:
11.
Click Save. You must now add this sub-process to your original workflow rule.
12.
Open your lead assignment workflow rule.
13.
Click the Assign to line within your first then statement, and under Common Tasks, click Insert Action, and then click Run subprocess.
14.
In the Run Subprocess dialog box, select the sub-process you just created, and then click OK.
15.
Repeat steps 13 and 14 for each then statement.
After you add the sub-process to your original workflow, it will resemble this (notice the new Exec lines in the workflow logic):
Although the workflow now includes logic that defines when it performs its actions, you must also explicitly activate it.
1.
In Workflow Manager, in the Entity Type list, click Lead, and in the View list, click Rule.
2.
Select the workflow rule that you created earlier in this article.
3.
On the Standard toolbar, click Activate.
The status of the workflow rule in the list changes to Active.
Note
You cannot edit an active workflow rule. You must deactivate the workflow rule if you want to change its logic. Any current instances of the workflow rule are not affected by the changes. Only new instances that are created after you make the changes are affected when the process is triggered.
With the workflow active, you can use Workflow Monitor to check on the status of instances of the workflow started by the workflow rule. Using Workflow Monitor, you can make sure that the workflow rule is running as expected.
Note
You may have to remind your users that they must include a ZIP Code/postal code in new lead records, or you could customize the Lead entity to make the ZIP/Postal Code field required.
1.
To start Workflow Monitor, click Start, point to All Programs, point to Microsoft CRM, and then click Workflow Monitor.
2.
In the Log On dialog box, verify that the URL displayed in the Target Microsoft CRM server box is correct, and then click OK.
3.
Click the Log tab and in the Type list, click Lead.
Each instance of the workflow process appears on the Log tab. You can see whether the workflow process has been completed. Double-click a workflow process to open details about each step in the workflow.