Dialog

Options: Plugin, Workflow or Dialog

by C.R. Matín on June 22, 2011

Our guest blogger today is Gonzalo Ruiz who is a CRM consultant for Avanade Canada.

This post is inspired by a popular article by my ex coworker Humberto Lezama G. regarding when to use plugins or workflows for implementing custom logic in Microsoft Dynamics CRM 2011. I have expanded the matrix to add additional criteria and more details about how each plugin vs. workflow handle different types of requirements. Additionally, I have added the new “dialogs” as an alternative in the chart.

Criteria
Use Plugin
Use Workflow
Use Dialog
Needs custom logic to execute synchronously.
Plugins support synchronous execution.
Dialogs always execute synchronously.
The logic needs to be executed while offline
Only plugins are supported offline.
Needs elevation of privileges (impersonation)
In the plugin step, you can select the user under which the plugin will execute by setting the impersonating user id in the plugin step.
In some cases you can control under which user the workflow will execute by assigning the workflow to that user. See more details here.
Needs to execute on events other than assign, create, update and set state
Can be registered on a large list of sdk messages. See more details here.
The process/logic may take a long time to complete or will be a persistent process (multiple long running steps)
Workflows have no limit on the length of time they can take to complete execution. They can also persist (pause) and resume at a later date. Plugins have a time limit of a couple of minutes to complete (even asynchronous plugins).
Needs to execute asynchronously
Plugins support asynchronous execution
Workflows support asynchronous execution
End users will need to modify the process logic
Processes can be modified using the CRM process designer in the application and does not require IT administrators to re-compile and deploy a plugin assembly.
Child sub processes will be triggered
CRM processes support executing child processes
Needs to read configuration parameters for execution
You can make use of the configuration and secure configuration settings in the plugin step. These values will be passed to the plugin constructor and can be easily updated.
Dialogs cannot be configured with configuration parameters but they can retrieve configuration information from user responses / interactions.
Need to execute logic on-demand
Workflows and dialogs can be executed on-demand. Plugins can only be triggered as a result of a specified action to which the plugin step is configured.
Needs to roll back transaction in case of error (useful for validation)
Plugins can be registered in-transaction so they are able to roll-back the main operation if the plugin fails. Workflows are executed post-transaction so they cannot roll back the main operation.
The plugin/workflow logic is not possible to implement by using the CRM process designer
Plugins are written in .NET and this supports any action that can be achieved using the CRM SDK.
You can extend workflows/dialogs by creating a custom workflow activity which is also written in .NET calling any method from the CRM SDK. However, this is not supported in CRM Online yet.
Interaction with user is required to execute the custom logic
CRM dialogs support the execution of a process which dynamically takes input from question asked to the user.
Need custom logic to execute before the main operation
Only plugins can be registered to execute pre- main operation.
Need to gather data from the entity pre-image (image of the entity before the main operation)
You can register pre-images for plugin steps.
Pre-image is available only from custom workflow activities (not supported in CRM Online)
Need to gather data from the entity post-image (image of the entity after the main operation)
You can register post-images for plugin steps.
Post image is available from the process designer in the CRM application.
Needs to be packaged into a solution
Plugins and processes are solution aware
Need to use variables to store temporary data
Use the SharedVariables collection to store variables that can be passed to other plugins.
Use the SharedVariables collection to store variables that can be passed to other workflow steps. These variables do not survive persistence and can only be used from custom workflow activities. Not supported in CRM Online.
Dialog support variables of type string, int and float that can be passed from one step to another. For other types, SharedVariables can be used from custom workflow activity.

Cheers,

Gonzalo Ruiz

{ 0 comments }

Microsoft Dynamics CRM Online Demonstration Kit

by C.R. Matín on June 14, 2011

The Microsoft Dynamics CRM Product Management team is happy to announce the availability of the Microsoft Dynamics CRM Online Demonstration Kit.  This Kit was optimized to facilitate a stand-alone Microsoft Dynamics CRM Online environment.

Scenarios
Included in this Kit is more comprehensive data, Dashboards, Workflows and Dialogs illustrating core CRM capabilities in expanded scenarios.  Read on below to find detailed instructions on how to download and setup these assets.

What’s covered in this kit:

  • Extensive Sample Data
  • 13 Dashboards
  • 17 Workflows
  • 2 Dialogs
  • 1 Web Resource (phone number auto-formatting jscript)
  • 1 Option Set (Timeframe drop-down list to use across entities)
  • 2 E-mail Templates

CRM Online Scenarios

Cheers,

Eric Boocock, Senior Technical Product Manager

 

The following files are included in the Kit and can be downloaded here:

  • CRM Solution (managed, unmanaged)
  • Sample Data
  • Demonstration Script
  • Demonstration Kit Overview

* For more details on managed vs. unmanaged solutions click here.
* Download the Sample Data and unzip the folder before starting the setup process.

Note: This data is based on US Dollar currency. If your currency is not US Dollar you must add the USD currency with the proper conversion rate to your base currency before proceeding.

image

Setup Process

Note: If you encounter any errors during the data import process address them before continuing to import additional entities as future dependencies may be compromised.

  1. Import the basic CRM Administrative data (Users, Sites, Queues, Subjects, Products, etc.) accepting all the Import Wizard default settings.
    • Workplace > Imports, click imagein the Ribbon
      • Import 1-Admin, once successful proceed,
      • Import 2-Admin, once successful proceed,
      • Import 3-Admin, once successful proceed,
  2. Import the CRM Solution
    • Settings > Solutions, click imagein the toolbar
      • Select Solution Package: Browse to the Solution CRM2011Scenarios_1_0_0_0, click Next,
      • Solution Information: click Next,
      • Import Options: Do NOT check the box to activate processes, click Next,
        (The data is properly formatted and if you activate the processes workflows will alter the data.) 
      • Importing Solution: click Publish All Customizations, click Close.
  3. Enable All Users
    • Settings > Administration > Users, change view to Disabled Users, Multi-select all Users and click image in the ribbon.
    • Confirm Users Activation: click OK
  4. Activate the following Sales Processes
    image
    • Settings > Processes, multi-select the processes and click image in the toolbar.
  5. Import Sales, Marketing & Service data (repeating step # 1 above)
    • Import 4-Marketing, once successful proceed,
    • Import 5-Sales, once successful proceed,
    • Import 6-Sales, once successful proceed,
    • Import 7-Service, once successful proceed,
  6. Import custom Data Map for Activities
    • Settings > Data Management > Data Maps, click image in the toolbar
    • Browse and select Activities_customized_PhoneCall (in Sample Data folder), click OK
  7. Import final data set – Activities (repeating step # 1 above except selecting the imported custom data map from previous step)
    • Upload Data File: Browse to and select Import 8-Activities, click Next
    • Review File Upload Summary: click Next
    • Select Data Map: Select the Customized Data Map Activities_customized_PhoneCall, click Next
      image
    • Accept remaining Import Wizard defaults to complete the import.
  8. Recalculate Goals
    • Sales > Goals, select Central Region Revenue and click image in the Ribbon. This will recalculate all the Goals.
  9. Activate all Processes
    • Settings > Processes, multi-select all workflows and click image in the toolbar
  10. Change Product Default Price Lists to Retail
    • Settings > Product Catalog > Products
      • Open Kit of Product A & B, Set Default Price List = Retail, click Save & Close
      • Open Product A (SKU JJ202), Set Default Price List = Retail, click Save & Close
      • Open Product B (SKU AX305), Set Default Price List = Retail, click Save & Close
  11. Run workflow to set Account Products Owned
      • Sales > Opportunities > Won Opportunities, multi-select all records, click  in the Ribbon, select Set Account Relationship Type…, click OK
  12. OPTIONAL:There are 10 Users included within the Sample Data. To login as one of these Users you must assign them a valid Windows Live ID and accept the invitation
    • Settings > Administration > Users, open User record
      • Click image in the Ribbon
      • Enter the new Windows Live ID, click Submit
      • Send new Invitation


{ 0 comments }

Dialogs: Using Variables and Input Arguments

February 15, 2011

The posts Dialogs Part 1 and Dialogs Part 2 talk about the new Dialogs feature in Microsoft Dynamics CRM 2011. Dialogs support the usage of Variables and Input Arguments. In this post, I will explain what they are and some tips on using them. The Dialo…

Read the full article →

Authoring Recursive Dialogs

February 10, 2011

The Dialog feature does not provide loop structure so you cannot do the same action or set of actions in a loop however there is a way to form a virtual loop for performing a set of actions. The way is to use a controlled recursive child Dialog having the desired set of actions being called from a parent Dialog. Here is the trick to do that.

The following hypothetical example will show you how to make Dialog calls recursive. Let us assume that we want to create a Dialog for Customer Service Executive who is creating a Case for her customer. What if she wants to create multiple cases in one call while not starting Dialog again and again and asking the similar set of questions for creating a Case. Here is the step by step method to achieve this. Once acquainted with the trick you can use the recursion for many other scenarios. One such scenario can be creating multiple Contract Lines for a Contract using Dialog Process in Microsoft Dynamics CRM 2011.

1. Create a child Dialog named “create case” for Account entity which ask the relevant things required to create a case. In the example below only Case’s Title is asked in prompt. You can ask for other attributes too by adding as many Add Prompt and Responses steps.

clip_image002

2. Now activate the Dialog and then deactivate without any change. Doing this will make your child Dialog available to be added as its own child, means now recursion is possible for the Dialogs.

3. To control the flow from entering into the infinite loop you can add a Prompt to ask if the customer wants to create another Case. If customer’s choice is yes then add a Link Child Dialog step. In the child Dialog lookup, you would be able to see the same “create case” dialog on which you are currently working. Select this as a child of its own and you got the way to make recursive call to Child Dialogs.

clip_image004

4. Add exit method to get out of recursion using Default Action step thorugh a Page showing Thanks to Customer for registering the Case. The final Dialog will look like below figure

clip_image006

5. Now you are ready to use this recursive Dialog from another Parent Dialog, but before that do not forget to activate this just created Child Dialog. The parent Dialog will look something like below figure.

clip_image008

So you have created a recursive Dialog. Let us test it by running it. Go to Account grid and run this Dialog for any Account record by clicking Start Dialg ribbon button in context to any Account record.

clip_image009

When you run the Dialog, the answer choice on page above of run Dialog will determine whether to recurs or exit.

In above example we saw the way to create recursion and way to exit from recursive loop. Hope this will help you to explore the power of recursive Dialogs in many ways to solve your practical scenarios.

Cheers

Ramesh Pandey

Read the full article →

Dialogs: Multiple tasks in one shot – Firing Asynchronous Workflows through Dialogs

February 8, 2011

This post provides a step by step guide on how to make use of Asynchronous Workflows through Dialogs (Interactive Workflows) depending on user responses and requirements. Here we will fire a system job (Asynchronous Workflow) by using the “Start …

Read the full article →

Welcome to the World of Dialogs – Part 2

February 7, 2011

This post is in continuation to the previous introductory post on Dialogs Part I. In this post, we’ll take you through an example of contact creation dialog and give you a basic introduction to data slugs, how to use them and also, how to use a data slug for Optionset values. This post also contains a brief introduction of the running dialog like tips, comments, next, previous etc.

So, let’s start with an example of how to create/author a basic dialog which takes input from the user and based on the inputs received, creates a contact in Microsoft Dynamics CRM 2011. We will be creating the Contact on outgoing/incoming Phone Calls. The Phone Call will be the context Entity.

Here is a screenshot of a running dialog:

clip_image002

Authoring Contact Creation Dialog

1. Go to Settings->Processes and click New.

2. A dialog will appear. Fill the details as shown below (Don’t forget to choose category as dialog):

clip_image003

Click Ok.

A new window will appear.

3. Click Add Step->Page as shown below:

clip_image004

4. Type page description as: Contact’s first, last and middle names

5. Add step->Prompt/Response and click on Set Properties, you will get a page to set the Prompt and Response properties.

6. Fill the required information as shown in the following figure(Response Type: Single Line, Data Type: Text):

clip_image005

And then click on Save and Close.

7. Add two more prompt/response steps in the similar way asking for Middle Name and Last Name. You can add these prompts on same page or on new pages if you want to take only one input at a time.

8. Then add a prompt/response step with response type as Option Set (picklist) and ask for gender of the contact as shown below. We’ll use the response of this prompt to fill the gender information (male/female) on contact form.

     a. Add 2 response values:

          i. Label – Male, Value – 1

          ii. Label – Female, Value – 2

(The values given here should match the exact Optionset values for that particular options taken by gender field of Contact Entity). For example: you want to fill the gender optionset of contact, the value of Male in that Optionset is 1 and that of female is 2. You can check for these values by going to Settings->Customizations-><Entity>-><Field> (Settings->Customizations->Contact->Gender in our case.))

clip_image006

9. Then add one more page and add prompt/response steps to get email address and mobile number in the similar fashion as done for the first page.

10. Now Add Step: Create Record – Choose entity as contact and click on Set Properties button. You will get Contact form to fill the desired values as shown in the following figure.

clip_image007

11. Click on First Name Text Box and choose First Name from local values on form assistant as shown above.

Note: Response Values will be available as Local Values in form assistant

12. Click Add and then click ok.

13. A data slug will be inserted in First Name field (highlighted in yellow color). Data Slugs are the dynamic values which are replaced with actual values while the Dialog run is in progress. In this case, it’ll be replaced by the values filled by the user while running dialog for the response of First Name Prompt.

14. Do the similar steps for Middle Name, Last Name, Mobile Phone and E-mail in the same form.

15. Now, click on the gender field in contact form. In look for, choose gender (Label of the gender prompt) and choose Response option set value below and click add. A data slug will be inserted as shown below (encircled one):

clip_image008

Once you are done with setting all the dynamic values the final Contact Form will look as shown below:

clip_image009

16. Click on Save and Close.

17. Add Page with title "Contact has been created".

18. Add step prompt/response and click on Set Properties.

19. In prompt text, write "A contact has been created for" and then add first name, middle name and last name data slugs.

An important point to note here is that you need to add these values one by one otherwise all the Response Values would be replaced in same field. What you need to avoid is shown in next figure.

 clip_image010

If you add all these items in one field, this will mean that if first name is null, then the middle name will be used and if that is also null, then the last name will be used. So, if you want to display all three, then add them separately.

Your final Dialog, you just authored will look like this:

clip_image011

20. Now it’s time to Activate and test it. Click Activate and close the Dialog definition page.

Running Contact Creation Dialog

Contact center sales person will open his phone call activity and click on the "Start Dialog" button present in Process section of ribbon.

Then he’ll choose the contact creation dialog from the lookup.

On clicking ok, dialog will start running. He’ll ask the questions from the customer as mentioned in the dialog and fill the corresponding responses.

Here is a screenshot of the contact creation dialog in action:

clip_image012

To navigate to the next page, Next button has to be clicked.

Similarly if you want to go back to the previous page, you’ll have to click the previous button.

But it should be kept in mind that if you are going to the previous page, then data in your current page will not be persisted.

To cancel the dialog at any moment, cancel button will have to be clicked.

Summary of what has been done till now as a part of this dialog can also be viewed using the summary button. Clicking on this button will open the corresponding process session record which contains all such details.

Similarly notes can be taken in the comments section while running the dialog. For example, in the above screenshot, we have added the comment that customer doesn’t have an email address.

Tip area shows tips corresponding to the highlighted prompt which aids Sales Person in filling the response. This area is collapsible too in case it seems unnecessary. If you click on the arrow present at the top right of this area, then tip area will get collapsed and the wizard will look like this:

clip_image013

Highlighted pane on the right can be clicked to show tips again.

After clicking Finish button in the last step, go to Sales->Contacts.

You’ll notice the following entry (which has been created by the dialog which was just run):

image

In this way, Contact center Sales Person was able to create a contact very easily.

If dialogs are used, then user doesn’t have to go to various grids and create/update/assign various records by himself. He’ll just run the dialog, fill the entries and everything will be done in the background. It also guides user how to interact with the customers and hence, can be used for self help as well as assisted learning.

Watch out for more advanced posts on dialogs which will be published pretty soon.

Manish Arora

Read the full article →

Welcome to the World of Dialogs – Part 1

February 2, 2011

The Dialog is a brand new feature built on top of Windows Workflow Foundation 4 in Microsoft CRM 2011. Before I delve into details of power, the Dialogs provide, this is important to let you know that now the Workflows and Dialogs are collectively know…

Read the full article →