I have recently done some dialog work and I thought I would note down a dialog example whilst I could remember it.
You can watch the video below, where I go through the steps of creating the Dialog shown in this blog
If you thought workflows are quite quirky then dialog’s are like that except ten times more quirky and in some ways they are so unlike other things in CRM, in terms of how they work that you will be left scratching your head as to what you should be doing.
Hopefully this blog post will help you get to grips with dialog’s.
The first thing you need to understand is all the definititions
The CRM 2011 wiki is a good place to start
http://social.technet.microsoft.com/wiki/contents/articles/13136.dynamics-crm-2011-dialogs.aspx
This is also a good blog post about dialogs
http://msdynamicscrmblog.wordpress.com/2013/12/02/dialogs-in-dynamics-crm-2013/
I will simply things in this blog because most of it you will be able to understand if you done some workflows (and everyone has done some workflows) so it’s really the dialog specific stuff we need to focus on here.
Page
A page is a page in the dialog and in that page you can have lot of prompt and responces
Prompt and response
Prompt and response is where you present the user a prompt/question and you can decide how they respond e.g.
- Response Type – can be of the following data types:
- None
- Single Line – Text, Integer, or Float
- Option Set (radio buttons) – Text, Integer, or Float
- Options Set (picklist) – Text, Integer, or Float
- Options Set (picklist) – Text, Integer, or Float
- Date and Time
- Date Only
- Lookup – Can reference any entity type and related their related lookups
You can have multiple prompt and responses on a page.
You can also do the all the workflow stuff like Check condition, update record, start child workflow etc. below is a picture of what you can do, I have highlighted the differences between workflows
One thing which is different in Dialog’s is Query CRM Data and it is quite an unusual piece of functionality. In this simple dialog I will create a dialog which updates case records associated with an account record.
Which brings me onto another difference between workflows and dialog’s. Dialog’s can only be triggered on one record, if you select more than one record the dialog button is hidden. Unlike workflows which you can run on multiple selected records.
The dialog in my example will run on the account entity
QueryCRM which returns a list of cases with the account reference equal to the account record where the dialog was triggered.
I will prompt and response
OptionSet – with the values for case origin optionset on the case
Text – capture text for the description field on the case
below you can see all the choices
The screen shot below shows the CRM query. Notice you have to select an account in the query and then go to the modify query variables, select the account and copy over the variable for account.
Below is a screen shot of the prompt and response for the Case Origin. You have to recreate the labels and the values in the dialog choices.
Makes sure you select the data type as integer so you can use this value to change the OptionSet
below is the dialog showing using the values collect from the Query CRM. You put the records(select cases) in the prompt and then you can show the query records in an optionset which the user can select one a case associated with the account from.
Finally I use the selected case and update the origin and description fields with responses collected earlier.
So there you go there is a simple CRM 2013 plugin using some of the core dialog functionality.
Dialog’s offer a very useful tool in CRM and they work pretty well but they take some getting use to and there are definitely a few tricks you have to learn.