Topic: ‘Workflow’

 
 

Using Workflow to Set the Primary Contact

By in Dynamics CRM, Workflow on Friday, January 9th, 2009

Sometimes an Account may not have a primary contact associated with it, and it’s difficult to know exactly who to contact when you need to get in touch with an Account. Workflow can take away the manual task of actually associating a primary contact each time a new Account is created. Follow these steps to create a workflow to automatically set the primary contact of an Account:

1. Navigate to Settings on the left-hand side of your screen, and then click on Workflows. Click on New to create a new workflow. In the Workflow Name area, type in Set Primary Contact. Choose Contact as the entity in question, and leave the Type as New blank workflow.

2. When the Workflow box opens, keep the default settings for Scope and Start When. Click on the area that says Select this row and click Add Step.

3. Type in a description for the check condition that you are using. In this case we want to check and see if the parent account has a primary contact. After you have typed in a description, click on the blue hyperlink that says <condition> (click to configure).

4. Once the new window opens up, you need to specify the workflow condition. Choose Parent Customer (Account) as the first selection. Next, find Primary Contact, and lastly select Does Not Contain Data. This means that we are checking to make sure that the parent customer does not have a primary contact already. Click Save and Close.

5. Select the second row of the If statement and click Add Step. Select the option Update Record.

6. Type in a description for the Update Record condition. For this one, we are going to Set the Primary Contact of the Parent Account. Click on the button that says Set Properties.

7. When the window opens, the Account form will be visible. Select the field that says Primary Contact.” The Form Assistant should be visible on the right-hand side of the window. If it isn’t there, click on the small button with an arrow pointing to the right.

8. Make sure that the form assistant is visible on the right-hand side of the window. The Operator and Look For values are defaulted in the form assistant. Click on the Add button, and then click OK. This will place {Contact(Contact)} in the Primary Contact field. Click Save and Close.

9. After you have saved your workflow, remember to publish it by clicking the Publish button on the toolbar at the top of the workflow window.

10. In order to test the accuracy and effectiveness of your newly created workflow, create a brand new Contact for an existing Account that has no Primary Contact. On the Contact form, fill in the field that says Parent Customer. Save the contact, and then open the Accounts listview and open the Account. You may need to wait a few minutes to make sure that the workflow has had enough time to process. When you open the Account, the Primary Contact should be populated for you with the Contact that you created.

11. If the Primary Contact has not shown up in the Account form yet (and you’ve waited a little bit), navigate to the Workflow section of the Contact form. This will allow you to visualize the progress of the workflow you have created. If it does not say Succeeded, you may need to refresh the listview or even give it some more time.

 

Workflows Not Firing, Microsoft CRM Asynchronous Processing Service Stopping

By in Asynchronous Service, Dynamics CRM, Workflow on Tuesday, December 23rd, 2008

I recently promoted a couple of new workflows, but they were not firing correctly. My first thought was the Asynchronous Service was stopped or may need restarting. My assumption was correct; the Asynchronous service on the CRM application server had stopped. 

I restarted the service and tried the workflow again, but it still did not fire. Turns out the Asynchronous service had shut down again so I take a look at the event log and the following error was repeated multiple times.

Open the image below in a new window and maximize to view:

Host Image

After researching the problem, I stumbled across this KB Article

Based on the information in this article, I checked the Servers table in the MSCRM_Config database and the SQL Server Name did not match the name returned by the Select @@SERVERNAME statement. So, I corrected the Server Name in the Servers table to match the SQL Server Name (Case Sensitivity). I then restarted the Asynchronous Service and workflows fired correctly and the above error did not appear in logs.

 

Updating Fields When a Case Gets Resolved

By in Dynamics CRM, Workflow on Monday, November 17th, 2008

I recently had a request to add two new fields to the Case form: Closed By and Closed On. In addition, when a Case gets resolved, they want the two new fields to be automatically populated. The values of the Modified By and Modified On fields contain the data we need to populate the two new fields. So all we need to do is copy them when a Case is resolved.

It sounded easy enough. So I created my workflow to do just that. When the Record Status changes, I set the Closed By and Closed On fields equal to the Modified By and Modified On values. Upon running the workflow, the fields never updated. The reason is that resolving the Case marks all fields on the form as read only.

The solution I came up with was to first check if the Case was Resolved and to check and see if the Closed By and Closed On fields were blank. Then change the Case back to In Progress, set my values, and change the status back to Resolved.

Here is a screenshot of the workflow:

 

Creating a CRM 4.0 Workflow to Monitor Lead Follow-Up

By in Dynamics CRM, Workflow on Wednesday, July 2nd, 2008

How your organization decides to manage your lead flow is unique to each business. Below is just an example on how this process can work. We are not trying to say this is the best way – or the only way – but just an example. We LOVE the new workflow in v4 and our good friend Ben Vollmer and IBIS had some fun building out some other cool things. You can read about that on his blog here.

So your organization just imported a bunch of leads. Those leads cost money. The people that screamed for those leads will definitely follow up in a timely manner, right? I’ll say sometimes.

While people have the best intentions, they are busy. How can the organization keep track as to whether or not the leads are being pursued? The answer is WORKFLOW.

Here is a little background for this scenario. The leads come in and are imported by marketing and assigned to the marketing person. The leads are then reassigned manually to various reps. Due to this process, our workflow will fire on Record Assigned. Once a lead is assigned, we would like to notify certain CRM users if the modified date does not change in the next two days.

This looks simple enough, especially since we can have the workflow sit in timeout for an allotted period of time.

When creating this workflow, there was one thing that had me hung up. That was how to compare any time values to the current time to determine elapsed time. The secret turned out to be the Workflow: Execution value. Workflow: Execution value represents the time that part of the workflow is running which is fairly close to right now.

Here are the step by step instructions.

1. Open the CRM web client, click Settings in the lower left hand corner, and select Workflow in the top left hand side of the screen.

2. Click New. Give your Workflow a descriptive name, select the Entity it will run against, and leave the radio button set to New Workflow. Then, click OK.

clip_image002

3. On the workflow page, change the scope to Organization so the workflow will run against all leads and set the “Start when” value to “Record is assigned”.

clip_image004

4. Select the row with the label “Select this row and click Add Step” and click the “Add Step” button. From the list, select “Wait Condition”.

5. Enter a Description for the step and click <condition> (click to configure).

clip_image006

6. In the first picklist, select “Workflow”. Click “Select” and pick “Timeout”. Click the next “Select” and pick “Equals”. To enter a value, we will be using the Form Assistant pane to the right. We would like to wait 2 days from assignment so we will select “2” for days, “After” instead of Before, “Workflow” from the Look For picklist, and then click on “Execution Time”. Once you click on Execution Time, you will see the value populated for you. Click Save and Close. Your workflow should now look like this.

clip_image008

7. Select the next row, click “Add Step”, and choose “Check Condition”. We will now check if the Lead has not been Qualified or Disqualified. To make this easier we will check that the Lead Status does not equal “Open”.

8. In the first picklist, select “Lead”. Click “Select” and pick “Status”. Click the next “Select” and pick “Does not Equal”. Click the […] button and choose “Open”. Click Save and Close. Your workflow should now look like this.

clip_image010

9. If the lead is not open we want to stop the workflow. Click the line below the If statement and click Add Step. Select Stop Workflow and select “Canceled” from the picklist.

clip_image012

10. Select the If statement line, click the Add Step button and select Conditional Branch.

clip_image014

11. Now we need to set the condition on the “Otherwise, if” line. Click the <condition> field.

12. In the first picklist, select “Lead”. Click “Select” and pick “Modified On”. Click the next “Select” and pick “Is Less Than”. To enter a value, we will be using the Form Assistant pane to the right. Since the Modified On date got changed when the lead was reassigned, we can check if the Modified On date is less than 1 day 23 hours and 59 minutes. Select “1” for days, “23” for hours, “59” for minutes, “Before”, “Workflow” from the Look For picklist, and then click on “Execution Time”. Once you click on Execution Time, you will see the value populated for you. Click Save and Close. Your workflow should now look like this.

clip_image016

13. Select the next row, click “Add Step”, and choose “Send E-mail”.

14. Click the “Set Properties” button to fill in the appropriate fields on the email that will be sent out. The Regarding field already has a link to the related lead. I typically have the email sent from an administrator account. The recipient can be the rep, the rep’s manager, CRM users, etc. I don’t want to go into details on how to use Dynamic Values but they are pretty useful.

15. Please note that you need not fill in every field. Once you are done, click “Save and Close”. You workflow should now look like this.

clip_image018

16. Now all that is left to do is to save it and publish it. You will notice on the toolbar that you can publish from here. I made it a habit to save the workflow first, then I publish it.

17. Click “Save and Close” and then with your new workflow selected, click “Publish”.

18. Your workflow is now active and will fire whenever a Lead is assigned to another user.

Some Additional Notes:

When checking the lead modified on field against the workflow execution time, I chose not to use Less Than or Equal To 2 days because I wanted to leave a little wiggle room for latency in the workflow process running. It is possible that it would work but I figured that the odds on a rep getting the reassigned lead, calling the lead, and saving changes to the record in under 1 minute was slim to none.

 
Page 2 of 212