Saturday, August 27, 2011

MSCRM 2011: Creating a Dialog Process

In Microsoft Dynamics CRM 2011, there is now a new process that can be defined called a Dialog.

Dialogs present a wizard-like UI and always require user input to start and run to completion. They always run synchronously. They cannot be triggered automatically. They must be started by a user. They can be run on one record at a time and can call child dialogs and pass information to them.

Dialogs provide the ability to create wizard-style processes inside Dynamics CRM. 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.

The basic constructs of the new Dynamics CRM 2011 dialog processes are 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. 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.

In the example below we 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.

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:

a. In the Process Name field, type Create Case for Account.
b. In the Entity drop-down, select Account.
c. In the Category drop-down, select Dialog.
d. In the Type section, select the New blank process option.

4. Click OK. The Process Design form opens.

Note: There is no Options for Automatic Workflows section. This is because dialogs must be started by a user. 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.

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:

a. In the Statement Label field, type Case Title.
b. In the Prompt Text field, type Enter a title for the case.
c. 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:

a. In the Statement Label field, type Case Description.
b. In the Prompt Text field, type Enter a description for the case.
c. In the Response Type drop-down, select Multiple Lines (Text Only).

7. Click Save and Close. You will return to the Step Editor.

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 Case 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).
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! Go to a specific Account record and select Run Dialog.

No comments: