Crm dynamics workflow

35
CRM Dynamics Workflow How to automatically populate the Quotes “Closed On” date through a workflow in Microsoft Dynamics CRM 2011. www.dynamic-crm.com

description

 

Transcript of Crm dynamics workflow

Page 1: Crm dynamics workflow

CRM Dynamics WorkflowHow to automatically populate the Quotes

“Closed On” date through a workflow in Microsoft Dynamics CRM 2011.

www.dynamic-crm.com

Page 2: Crm dynamics workflow

We recently received requirements to automatically populate the “Closed On” field of the Quote entity when the user wins, loses, or cancels a quote in MS Dynamics CRM 2011.

Sounds like an easy enough workflow right? Just throw together a quick CRM dynamics workflow to update the field when the status changes, right? Well, not quite…

www.dynamic-crm.com

Page 3: Crm dynamics workflow

It turns out there are a couple of things that need to happen before you can simply update the field.

The first thing we need to do is see if we are displaying the “Closed On” field on the form.

If the field exists on the CRM form and it is disabled, it will prevent us from using it in the workflow.

www.dynamic-crm.com

Page 4: Crm dynamics workflow

My recommendation is to add it to either the header or the footer if you want it to display .

Obviously we are setting it programmatically so there is no need for user interaction...

Alternatively, you can add some JavaScript to your form load event to disable the field.

www.dynamic-crm.com

Page 5: Crm dynamics workflow

However you will want to ensure that the “Read only” checkbox is not checked.

You will find this by going to the Customization view of the form, selecting the field, then click into its properties.

www.dynamic-crm.com

Page 6: Crm dynamics workflow

The steps below ensure that this workflow will work:

Determine the current status Set the records status to a changeable state Update the field with the current date Activate the record Set the record back to its original status.

www.dynamic-crm.com

Page 7: Crm dynamics workflow

There are a few different ways that we can handle this, but for the purpose of this article, we thought it best to keep it as straight forward as possible.

So let’s jump right into creating our CRM Dynamics workflow!

www.dynamic-crm.com

Page 8: Crm dynamics workflow

In MS CRM Dynamics 2011 click on the “Settings” link in the left hand navigation.

Under the Process Center grouping, click on the Processes link.

At the top left corner of the results grid, select the icon labeled “New” to launch the Create Process dialog.

www.dynamic-crm.com

Page 9: Crm dynamics workflow

Enter a name for your process, select “Quote” from the “Entity” drop down list, select “Workflow” as the “Category”, then click on the “OK” button.

(see image on next slide)

www.dynamic-crm.com

Page 10: Crm dynamics workflow

www.dynamic-crm.com

Page 11: Crm dynamics workflow

This will save the information and close the “Create Process” dialog window. The “Process” properties window will then open.

Here we can change the scope and set when or how we want the process to run for this workflow.

www.dynamic-crm.com

Page 12: Crm dynamics workflow

• Based on the requirements that we received for our purposes, we only want to start when the record status changes (see image below)

www.dynamic-crm.com

Page 13: Crm dynamics workflow

Now we are ready to add the details of our process. The first thing we want to do is verify that this quote is closed, more specifically that it is either marked as Won, Lost, or Cancelled.

To accomplish this follow Steps 1-9

www.dynamic-crm.com

Page 14: Crm dynamics workflow

Step 1

Click on the “Add Step” tool strip menu, and then choose “Check Condition”. Enter a good description value, and then click on the condition link. (see image below)

www.dynamic-crm.com

Page 15: Crm dynamics workflow

Step 2: Next, on the “Specify Condition” dialog

page you will want to hover over the “Select” link.

This will display the drop down list of entities.

Choose Quote entity under the Primary Entity heading. Once selected, this will enable the field list immediately to the right of the entity list.

www.dynamic-crm.com

Page 16: Crm dynamics workflow

Step 2 continued…

Select “Status Reason” from the field list. Next, the operator drop down list will

appear and from here choose the “Equals” selection. Now we need to enter our values to create this workflow.

Click on the button labeled with an ellipse to launch the “Select Values” dialog.

Then move the “Won” entry from the available values list to the selected values list, and then hit “OK”.

www.dynamic-crm.com

Page 17: Crm dynamics workflow

Step 3 Image

www.dynamic-crm.com

Page 18: Crm dynamics workflow

Step 3 Click directly on the text that reads “Select

this row and click Add Step”, and, you guessed it, click on “Add Step”.

Choose “Change Status”, enter a description, and ensure that “Quote” is selected from the “Change record status to:” drop down list, and then choose “In Progress” from the “Draft” group. (see next image)

www.dynamic-crm.com

Page 19: Crm dynamics workflow

Step 3 continued…

www.dynamic-crm.com

Page 20: Crm dynamics workflow

Step 4 Select “Update Record” from the “Add Step”

tool strip menu.

Enter a description and ensure that “Quote” is selected in the Drop down list for the entity to update.

Clicking on the “Set Properties” button will open the Process form with all of the available fields.

www.dynamic-crm.com

Page 21: Crm dynamics workflow

If you already have the “Closed on” field within the Quote Form, ensure that you actually read the second paragraph of this post. *Otherwise you will be left scratching your head when you try to set the value of the field.

www.dynamic-crm.com

Page 22: Crm dynamics workflow

Step 5 From our process, we want to locate the “Closed

On” field on the form so we can update its value.

Once located, click on the field as if you were going to manually type a value into the textbox, to ensure it has focus.

Under the Form Assistant at the right hand side of the screen, you will want to choose Process from the “Look for:” drop down list. This should be the last entry under the “Local Values” heading.

www.dynamic-crm.com

Page 23: Crm dynamics workflow

Step 5 continued… Ensure that “Execution Time” is selected in

the drop down list directly under the “Look For:” list, and then click on the “Add” button. Finally hit the “OK” button to set the dynamic value into the “Closed On” field.

See next image

www.dynamic-crm.com

Page 24: Crm dynamics workflow

Step 5 image

www.dynamic-crm.com

Page 25: Crm dynamics workflow

Steps 6-8 Step 6: Click on the “Save and Close” icon, in the

top left hand corner of the window, to return to the main process window.

Step 7: Click on “Change Status” from the “Add Step” menu, and ensure that we are now choosing the “Open” status from the “Active” group.

Step 8: Click on “Change Status” from the “Add Step” menu, and ensure that we are now setting the “Won” status from the “Won” group.

www.dynamic-crm.com

Page 26: Crm dynamics workflow

Step 9 Click on the “Add Step” tool strip menu

again, this time choose “Stop Workflow”. Enter a description and leave the default status of “Succeeded”.

Now your CRM dynamics workflow from steps 1 through 9 should look similar to the following:

(see image)

www.dynamic-crm.com

Page 27: Crm dynamics workflow

Now we can repeat steps 1 through 9 for both the “Lost” and “Canceled” statuses. *Obviously make sure we swap out the “Won” status in both steps number 2 and number 8 with the appropriate status value.

www.dynamic-crm.com

Page 28: Crm dynamics workflow

You may also choose to use a “Conditional Branch” instead of the “Check Condition” outlined in step 1.

Before we finish up and activate the process for this workflow, it is not a bad idea to add another step as a default action to our initial conditional statement.

www.dynamic-crm.com

Page 29: Crm dynamics workflow

This will simply ensure that, if our CRM dynamics workflow fires off because the status is something other than what we care about, we have full execution.

This also helps identify workflows from within the System Jobs within your Microsoft Dynamics CRM site.

www.dynamic-crm.com

Page 30: Crm dynamics workflow

To complete this default action, we will first click directly on a line in our process that reads “If Quote: Status Reason equals […] then:” Choose “Default Action” from the “Add Step” tool strip menu.

Click to highlight the “Select this row and click Add Step” row.

Click on the “Add Step” menu, and then select “Stop Workflow”.

We can set a description and set the status value to “Canceled”.

www.dynamic-crm.com

Page 31: Crm dynamics workflow

Again, this will allow us to view the progress of CRM dynamics workflows to determine which ones were canceled because they did not meet our criteria, and which ones executed successfully because they did meet our criteria.

www.dynamic-crm.com

Page 32: Crm dynamics workflow

Hit the green “Activate” icon and that’s all there is too it!

Sure it is not as simple as we would like, but this will fulfill our requirements without us having to write code to create this crm dynamics workflow.

Happy coding!

www.dynamic-crm.com

Page 33: Crm dynamics workflow

FREE Download of Script Author!

Would you like to customize MS Dynamics CRM 2011 forms without having to read, write, or debug code?

Oh, and in about half the time it normally takes?

Then…… Download “Script Author” for FREE!

www.dynamic-crm.com

Page 34: Crm dynamics workflow

What is Script Author? Script Author is Dynamic-CRM’s javascript

generator that generates scripts in formatted, readable code for MS Dynamics CRM 2011.

Script Author works with existing customizations, there is no intricate syntax to memorize and it requires NO programming knowledge!

www.dynamic-crm.com

Page 35: Crm dynamics workflow

Stay Ahead of Competition…

Download your FREE version of Script Author.

When you are ready to push your customizations to your CRM environment, then purchase your license key(s)!

Happy coding!

www.dynamic-crm.com