Building Business Processes in Dynamics CRM 2011: Installment 1

Charles Dickens published A Tale of Two Cities as a serial novel, 45 chapters in 31 weekly installments in 1859. Today I like to think he would have used the blog medium, so I’ll take a page out of his book and use a similar approach with my forthcoming book, Building Business Processes in Dynamics CRM 2011. Unlike Dickens, however, I won’t start at the beginning. This Installment 1 is actually from Chapter 7 of the book, which introduces Dialog Processes. Today’s installment is the first part of the chapter, and includes the following sections: This article is an excerpt from my upcoming book, Building Business Processes in Dynamics CRM 2011. All articles in the series:

 

  • Dialogs and Workflows Compared
  • Dialog Properties
  • Basic Constructs: Pages, and Prompt and Response Pairs
  • Creating a New Dialog, Step by Step

The book will be available for purchase on Lulu sometime in July, and I’ll get more information up shortly on packaging, pricing and so forth. In the meantime, I hope you like it. It’s not edited yet, so please provide feedback and help me improve the finished product. With the addition of Dialogs, it’s definitely a far longer book I write than I have ever written, so I want to make it a good one.

Dialogs and Workflows Compared

In Microsoft Dynamics CRM 2011, Workflows are quite similar to their slightly less evolved CRM 4.0 ancestors. But the tools you have to automate business processes are significantly improved compared to the previous version, thanks to the introduction of the new Dialog process. Semantically, workflows and dialogs are each considered a type of Business Process. While both dialogs and workflows allow you to automate business processes, in many ways they function quite differently:

  1. Table 1: Differences Between Dialogs and Workflows

    Dialogs  Workflows 
    Present a wizard-like UI, and always require user input to start and run to completion Always run in the background, and do not support user input
    Always run synchronously Always run asynchronously
    Cannot be triggered automatically; must be started by a user Can be started by a user, or triggered automatically
    Can query CRM data Cannot query CRM data
    Can call child dialogs and pass information to them Can call child workflows but cannot pass information 
    Can be run on one record at a time  Can be run on multiple records  

    Basically, what dialogs provide is the ability to create wizard-style processes inside Dynamics CRM, and with all the same great data awareness available in workflows. Think of dialogs as adding an information-gathering UI on top of the traditional workflow foundation: now, in addition to automating processes in the background, you can inform those processes with information collected from users in real time. Here are a few examples of what you can do with dialog processes:

  • Create guided selling or service processes, with a series of questions guiding representatives through otherwise complex sales/service processes.
  • Create wizard-style substitutes for traditional forms-based record creation.
  • Create your own customized replacements for lead conversion, case resolution, or any other process where information on one record functions as input for the creation of another.

Dialog Properties

Primarily because they cannot be triggered automatically, dialogs do not have much in the way of properties. Here is the Process Properties section of the designer for a dialog called “Dynamics CRM Upgrade Conversation”, for example:

  • Activate As

    Select Process if you want to activate the dialog for users to use; select Process Template if it is to be used as a template to create other dialogs.

  • Available to Run

    Normally you will select As an on-demand process. This simply means that the dialog will be available to run when a record of the type the dialog is written for (Contact in the previous figure) is either selected on a data grid, or when a form is opened.

    Dialogs can call child dialogs, and that’s what the As a child process option is for. The two options in this case are:

1. If only As a child process is selected, then the dialog will not display on the ribbon for a user to run it; in this case it can only be called by a parent dialog.

2. If both As an on-demand process and As a child process are selected, the dialog will be able to call itself recursively. A common use of this technique is to create a “looping” process. For example, a dialog might walk you through the process of creating a case record for an account, and after gathering information and creating the case, ask you if you’d like to create another record. If you respond yes, the dialog calls itself as a child process and walks through another case create dialog.

Basic Constructs: Pages, and Prompt/Response Pairs

Dynamics CRM 2011 dialog processes contain one or more pages, which provide the visual experience for the user. Each page can contain multiple sets of prompts and responses. Prompts and responses always go together, so I often refer to them as prompt/response pairs. Pages, and prompt/response pairs, are the most fundamental difference between workflow and dialog processes: they present the user interface and gather the information that the rest of the dialog process can use to do whatever it needs to do.

One way to appreciate the fundamental rules presented in Table 1 is to consider the following rule:

Dialogs must contain at least one page, and at least one prompt/response pair.

For example, you can create a new dialog without any pages or prompt/response pairs, and you can save it. But if you try to activate a dialog like that, you will see the following scary dialog with a very clear message:  

Let’s walk through an example to illustrate these basic dialog constructs. The following figure shows the experience of the user running a dialog. Dialog pages are displayed one at a time, just like steps in a wizard. The page shown here has two prompt/response pairs, with the second one selected. Notice the Tip on the right side of the form.

The following figure shows the same dialog, but this time in the design environment:

Here you see the design environment, with the Process Properties section collapsed immediately above the Step Editor. This will be familiar to anybody with CRM 4.0 workflow experience – about the only obvious difference is that wherever in CRM 4.0 the word workflow would have appeared you now see process.

But as you will see, when you start designing your first dialog process and click the Add Step drop-down list, there are lots of new actions you will not recognize from your workflow experience! Let’s go through the process now of creating a simple dialog to start learning how they work.

Creating a New Dialog Process

In this exercise you will create a simple dialog to create a case record. The dialog process will be written for the Account entity, with the goal of simplifying the process of creating a new case record for an account that already exists in your Dynamics CRM. This kind of dialog process is in the category described above as “wizard-style substitutes for traditional forms-based record creation”. Note: unless otherwise noted, all of the step by step procedures in this chapter assume you are using the Dynamics CRM 2011 web client and have the System Administrator security role.

Step by Step: Create a New Dialog

  1. Click Settings on the site map, and then click Processes in the Process Center section.
  2. Immediately above the Processes grid, click New.
  3. In the Create Process dialog, provide the following information:
    1. In the Process Name field, type Create Case for Account.
    2. In the Entity drop-down, select Account.
    3. In the Category drop-down, select Dialog.
    4. In the Type section, select the New blank process option.

     

  4. Click OK. The Process Design form opens.

Your new dialog has been created, although of course it will not do anything yet. Again, a comparison with workflow processes will help to sharpen your understanding:

  • For example, notice that unlike the workflow process designer, there is no Options for Automatic Workflows section. As mentioned previously, this is because dialogs must be started by a user.
  • Also, notice that the As an on-demand process option is selected by default. If you de-select that option, and save and close the dialog…you will notice when you open it again that it’s been selected again. This is because if you haven’t selected the As a child process option, a dialog must be available as an on-demand process. We will come back to this point a little bit later!

Now let’s make the dialog do something. The next exercise picks up where the previous one left off, and illustrates how to add the basic Page and Prompt/Response components.

Step by Step: Adding Pages, Prompts and Responses

  1. In the Step Editor, click the line that says “Select this row and click Add Step“.
  2. Click the Add Step drop-down, and select Page. A Page component will be added.

     

  3. With the cursor on the highlighted “Select this row and click Add Step” line, click the Add Step drop-down, and this time select Prompt and Response.

     

  4. Click Set Properties. The Define Prompt and Response dialog appears. Provide the following information:
    1. In the Statement Label field, type Case Title.
    2. In the Prompt Text field, type Enter a title for the case.
    3. In the Response Type drop-down, select Single Line.

  5. After entering the information, click Save and Close. The dialog closes and you return to the Step Editor. Notice that the text you entered in the Prompt Text field is automatically added in the Description field for the step. You can change it in either the Define Prompt and Response dialog or the Step Editor.
  6. Click Add Step, and select Prompt and Response again. This time, provide the following information in the Define Prompt and Response dialog:
    1. In the Statement Label field, type Case Description.
    2. In the Prompt Text field, type Enter a description for the case.
    3. In the Response Type drop-down, select Multiple Lines (Text Only).
  7. Click Save and Close. You will return to the Step Editor, which should look like this:

At this point, you could save the dialog, activate it, and run it. It would run, and you could see how the Page and Prompt and Response components combine to provide the user interface for the dialog…but it still wouldn’t create a case record, so let’s do one more exercise, picking up where we left off, to finish off and add that functionality.

Step by Step: Creating a Record with Information Gathered in a Dialog Process

  1. Click on the Page step, and click inside the text box, where it says “Type a description here”.
  2. Type Gather basic information.
  3. Make sure the Page step is still selected (the entire Page block should be highlighted in blue), then click Add Step and select Create Record.
  4. Click the drop-down to the right of Create and select Case.

  5. Click Set Properties. The Process form editor opens.
  6. With the cursor in the Title field, click the Look for drop-down in the Dynamic Values section of the Form Assistant, and select Case Title in the Local Values section of the list.
  7. Click the Add button in the Dynamic Values section.

     

  8. Click OK. The Title field is populated with Response Text(Case Title), which when the dialog runs will contain the text the user entered when prompted for Case Title.

     

  9. Click inside the Customer field. In the Look for drop-down, select Account, which is the primary entity for the dialog process. Notice that Account is automatically populated to the second drop-down list. Remember we are selecting a value for the Customer lookup field on the Case form, and the only values that can be entered are account or contact lookups.
  10. Click the Add button.

     

  11. Click OK. The Customer field is populated with Account(Account). This is process design notation for “the account field (from the account entity)”.
  12. Click inside the Description field. In the Look for drop-down, select Case Description in the Local Values section, and then click Add.
  13. Click OK. The Description field is populated with Response Text(Case Description), and the Process form editor should look like this:

     

  14. Click Save and Close to return to the Step Editor.
  15. Click inside the Create action’s Description field, and type New Case.

     

  16. Click Save and Close, to return to the Processes grid. With the Create Case for Account dialog selected, click Activate.

  17. In the Process Activate Confirmation dialog, click OK, and your new dialog is ready to run!

6 Comments »

  1. Building Business Processes in Dynamics CRM 2011: Installment 1 » Veille CRM Said,

    June 21, 2011 @ 12:38 pm

    [...] Follow this link: Building Business Processes in Dynamics CRM 2011: Installment 1 [...]

  2. Building Business Processes in Dynamics CRM 2011: Installment 2 Said,

    June 21, 2011 @ 5:12 pm

    [...] of the serialized version of my upcoming book, Building Business Processes in Dynamics CRM 2011. In Installment 1, I compared dialogs and workflows, discussed dialog properties, and introduced the most fundamental [...]

  3. Building Business Processes in Dynamics CRM 2011: Installment 2 - Richard Knudson’s Microsoft Dynamics CRM Trick Bag - CRM Technical Blogs - Microsoft Dynamics Community Said,

    June 21, 2011 @ 5:24 pm

    [...] of the serialized version of my upcoming book, Building Business Processes in Dynamics CRM 2011. In Installment 1, I compared dialogs and workflows, discussed dialog properties, and introduced the most fundamental [...]

  4. Building Business Processes in Dynamics CRM 2011: Installment 3 Said,

    June 27, 2011 @ 11:50 am

    [...] Installment #1 [...]

  5. Building Business Processes in Dynamics CRM 2011: Installment 6 Said,

    July 27, 2011 @ 8:12 am

    [...] Installment #1: Introduction to Dialog Processes [...]

  6. Usman Ahmed Said,

    March 1, 2012 @ 10:14 am

    Can you please tell me how to change entity for process once it is created? by mistake i created a process dialog for case but it should be for contact.

Leave a Comment