Monday, 2 May 2011

CRM 2011 - Mobile Express


If you’ve worked with Mobile Express in CRM 4.0, then you’re probably used to navigating to Settings –> Customization –> Customize Mobile Express.  In CRM 2011 the navigation has changed so that Mobile Express configuration exists within each entity.
For example, if you want to enable Accounts for Mobile Express, go to Settings –> Customization –> Customize the System –> click on the Account entity, and make sure that the checkbox for Mobile Express is checked:
image
Then, navigate to Forms underneath the entity and find the mobile form:
image
Open the form and select the fields you want to appear within Mobile Express and remove unnecessary ones. 
image
Publish your changes and test on your mobile device by entering the URL of your organization with a “/m” after the URL (example: http://crm/AdventureWorksCycle/main.aspx/m)

Dynamic Queries in CRM 2011 Dialog Processes


Dialog processes give you an important new way to create flexible, interactive business processes in Dynamics CRM 2011. In this article I provide a quick review of the new functionality they support and contrast them with the traditionalworkflow process, which are still available and function much the same as they did in the previous version. After reviewing the basics, I cover something that might seem a little confusing at first, but that turns out to be important: how you can create queries of Dynamics CRM data within your dialogs, and how you can make one query dynamically dependent on the results of a previous one.

Backgrounder

In Dynamics CRM 2011, workflows work much the same as they did in the 4.0 version. But now, in addition to workflows, an important new kind of business process has been added: Dialogs can do many of the same things as workflows, but they are different in several important ways. The following table contrasts these two different kinds of processes (which incidentally, are each considered a specific kind of Processand exposed that way in the UI):
Workflows Dialogs 
Asynchronous Synchronous 
Can be triggered by events or run on-demandCannot be triggered by events; always run on-demand
Never require user interaction to completeAlways require user interaction to complete
Can be run on multiple recordsCan only be run on one record at a time
Cannot build interactive queries of CRM data CAN build interactive queries of CRM data

The most fundamental way dialogs differ from workflows is in their support for a user interface; in the design environment it’s the Page that provides the basic container for the UI. In fact, you cannot save a dialog process without at least one page.
In turn, the page is a container for one or more Prompt and Response pairs. Together, pages and prompt/response pairs provide the UI and allow you to create a wizard-style experience for your users. For example, Figure 1 displays, in the design environment, a very basic dialog process.
Figure 1: An Interactive Dialog Process in the Design Environment


Figure 2 shows what that will look like this to a user running the dialog process:
Figure 2: The User Experience for a Basic Dialog

Although this dialog process will run, it doesn’t do much other than illustrate the basic Page and Prompt and Response components. But even in the most basic dialog process you can tell there are some significant differences between dialogs and workflows. For example, here’s a side-by-side comparison of the options available from the Add Step menus in, respectively, the workflow design environment and the dialogdesigner:
Figure 3: Add Step Drop-Down Menu for WorkflowsFigure 4: Add Step Drop-Down Menu for Dialogs

You can develop some intuition on the differences between workflows and dialogs from this comparison: for example, notice that dialogs don’t have the Wait Condition and Parallel Wait Branch conditional constructs that workflows do. This ties back to the fact that dialogs always run synchronously and always require a user to interact with them through to completion. You couldn’t very well add a six-month wait condition in a dialog and expect a user to sit around and wait for it!

Querying CRM Data in a Dialog Process

But the topic of this article is what you can do in dialogs that you cannot in workflows. We already reviewed the Page and Prompt and Response constructs for the UI, but what I want to focus on here is the Query CRM Data action. You can use this to allow users to select, in one of the Prompt/Response pairs, from a list built from a query. For example, you might create a dialog process as a substitute for the standard form experience in creating a case record. Instead of filling in a form, you walk a customer through a series of prompts, record the responses, and after the dialog finishes, the rest of the process creates the appropriate records. One of the prompts might be “What’s the name of your company?”, for which you can use Query CRM Data to build a query of accounts, allow the user to select from a list of accounts eligible to open a case, and then create a case record attached to the selected account.
I’ll illustrate this with an example. Suppose cases are opened for accounts, and for accounts with “Preferred Customer” in the category field, cases get routed to a special queue. Here’s an Advanced Find view that will return all Preferred Customer accounts:

Now we’ll see how to build a dialog that presents the user with a list of accounts based on that query, allows the selection of an account, and creates an appropriate case record for the selected account. In this example, we’ll assume that a phone call kicks off the case intake process, and base the dialog on the phone call entity. Follow these steps to …
  1. Create a new process (click Settings, then click Processes, and then clickNew)
  2. Give it a name, select Case in the Entity drop-down, select Dialog in theCategory drop-down, select New Blank Process in the Type section, and then click OK.
  3. When the process design window opens, click where it says Select this row and click Add Step, click the Add Step drop-down list, and select Query CRM Data.
  4. Then click the set Properties button and you’ll see the Define Query dialog
  5. You can see that this is just a specialized version of Advanced Find, so selectAccount in the Look for drop-down.
  6. Next you can take a couple of different approaches. If you don’t mind building your query on the fly, you can simply build it here; on the other hand, if you’ve saved it as a view, you can select it in the Use Saved View list. In the end, it amounts to the same thing, as you can see in the following figure:

  7. Click Find to verify the query works as expected, and then click Back to Query when you’re satisfied.
  8. As you will see shortly, the Statement Label is important, so I’ll be careful and give mine a good name, say, “Preferred Accounts”, then click Save and Close.
    Now it’s time to build the UI for the dialog process, starting first by adding a Page, which will be the container for the Prompt and Response pairs:
  9. Click Add Step and select Page from the list.
  10. Provide a name for the page, and then click the line below it. Now click Add Stepagain and this time select Prompt and Response.
  11. Click Set Properties and you’ll see the Prompt and Response dialog. Following this example, set the following properties:
    1. Statement Label: “Selected Account”
    2. Prompt Text: “Which Account are you with?”
    3. Response Type: Option Set
    4. Data Type: Text
    5. Provide Values: Query CRM Data
    6. After selecting that, you’ll see that Query Variables lights up, and you can select the Query built previously (hence the importance of good naming!). Select at least one field to return by checking in one of the columns, and when finished you should see something like this:
    7. Click Save and Close.
  12. Now the query’s built, and the dialog can do something with the value contained in Selected Account, which functions like a variable.
Since this article is about using queries in dialog processes, I’ll take a shortcut and build out the rest of the simple version of our case creation dialog. The simple version will ask another question, and then use the information gathered to create a case record, with the Selected Account entered in the Customer field. Here’s what the rest of the dialog looks like:

Figure 5: Dialog to Create Case Record

If you click the Set Properties button I highlighted in the figure, you’ll see the Create Case dialog. Use Dynamic Values to create a subject/topic, fill in the Customer field with the Selected Account (from the dialog), and fill in the Description field:
Figure 6: Create Case Record with Dynamic Values

Finally, refer back to Figure 5 and notice that records are routed to queues differently in CRM 2011 than they were in CRM 4.0, using the Create action to create a newQueue Item record.




Building Dynamic Queries

OK, that’s all well and good, but how do dynamic queries work? To continue the case-creation scenario, consider the following requirements:
  • Case records created using this process will be associated with the selected account entered in the Customer field. You saw this in the previous section.
  • The case form will be customized to add a lookup field to the Contactrecord type. The dialog process will construct a query to allow the selection of contacts associated with the selected account record. This is thedynamic query, so-called because it will be constructed dynamically within the dialog process, using the value selected for account (in the first query) as a parameter for the dynamic (second) query.
Because the second (dynamic) query depends on the account selected from the first query, dialogs like this one always have a characteristic structure:
The Gather Information stage will be structured like this:
  1. Construct the first query with Query CRM Data
  2. Insert a Page.
    1. The Page contains at least one Prompt and Response, and the label of the Prompt and Response will be used later in the dynamic query,
  3. Immediately after the Page created in step 2, insert another Query CRM Data. This will be the dynamic query. In the current example, it will have a name such as “Contacts for Selected Account”.
  4. After the dynamic query, insert another Page.
    1. This page will contain (at least) one more Prompt and Response, which will allow the user to select one of the contacts associated with the previously selected account.
The Post-Dialog Processing stage will use the information gathered to do whatever the process is supposed to do.
The following figure illustrates this structure for the current example:

The first query is the same as the one in the previous example. The first Prompt and Response allows the user to select an account, and stores the selection in theSelected Account variable. The second query is the dynamic one, and constructing it is the tricky part. Assume for now that all you have is the first part: the query for preferred customers and the prompt and response allowing a user to select one:

Follow these steps to create the dynamic query (Contacts for Selected Account in the example):
  1. Click Add Step, and select Query CRM Data.
  2. Click Set Properties and select Contacts in the Look for drop down.
  3. Select Parent Customer from the list of fields, and then in the second column, select Begins With.
  4. In the third column, enter a placeholder value – anything you want, since you’ll delete it in a minute. For example:

  5. Now, click the Modify Query Variables tab. Until I learned this trick I always wondered what that tab was for! You’ll see something like this, which is the FetchXML you may have been hearing about lately:

  6. Finally, delete the placeholder text, and select Selected Account in the Local Values section of the Look for drop-down, and then be sure to select Account Name, click the Add button, and then OK. After jumping through those hoops, hopefully it should look like this:

  7. Finally (this time I really mean it!), provide a good name for the Statement Label, like this:


    It takes a few steps to get it done, but at this point you can see that Variable1 is a parameter in the FetchXML, and that the value of the Account Name gets substituted into it at runtime, filtering the list of contacts appropriately.
I recorded a video that demonstrates how to make dynamic queries in CRM 2011 dialog processes. It’s in the customization section on the Trick Bag Video page.

Summing Up

Seeing as how you got this far, the least I can do is summarize the most important points:
  • This is a general technique, and can be used any time a value selected from one query can be used to filter another.
  • The FetchXML used here is the same as that used in custom SSRS reports for Dynamics CRM Online, so skills developed in one application will pay off in the other.
  • If you liked this, you’ll love the updated edition of my workflows book, coming soon with comprehensive coverage of workflow and dialog processes in Dynamics CRM 2011!

Friday, 29 April 2011

IME Mode in CRM


IME Mode in MSCRM attribute settings

When you create a new attribute for a MSCRM entity or open an exisitng one to see it's characteristics like data type, min-max values and schema name, you would have seen a property called IME mode.

An Input Method Editor (IME) lets you to enter and edit Chinese, Japanese, and Korean characters. These Asian writing systems have more characters than can be encoded for a regular keyboard. The IMEs for these languages use sequences of base characters that describe an individual character or group of characters to enter a larger set of characters. Base characters can be component letters from Hangul syllables, phonetic components for Japanese kanji characters, or various combinations for Chinese characters. You can use the IME mode option to quickly enter these characters and symbols into text boxes, avoiding the manual switch to IME mode that would otherwise be required.
Input Method Editors have two principle states, inactive and active. The inactive mode behaves like a regular keyboard and uses a limited set of characters. The active mode accepts Chinese, Japanese, or Korean characters.
The following IME modes are available:
  • auto (default)
    The IME mode is not affected with this choice.
  • active
    All characters are entered in the IME mode, but you can still deactivate it. For name-related fields and addresses, the default is active for detailed forms.
  • inactive
    All characters are entered without using the IME mode, but you can still activate it. For datetime type fields, the default is inactive for detailed forms.
  • disabled
    The IME mode is disabled, and you cannot activate it. For number type fields (money, int, float), the default is inactive for detailed forms.

CRM 2011 Dashboards

Following is the Demonstration on CRM 2011 Dashboards.

1) Open CRM. Click New in Dashboard Ribbon.

2) Choose your Dashboard Layout and Click on Create

3) Add you Data to Dashboard. In this Demo we will add 3 Charts
    and 1 List.

4) Click on the Chart Icon in the First Section and choose
    the following Fields.

5) In the Second Section , add a chart again with the
     following details :-

6) Add one more chard for Leads by Source

7) Add a list displaying All the Leads

8) Save and Close then Browse your Dashboard

9) See your Dashboard


CRM 2011 - Call Java Script in Workflows


Microsoft CRM 4 lacks call scripting features and customer especially call center customer will have to buy 3rd party add-ons like TK Dialogues, custom ASPX pages etc. to fulfill this requirement.
However, Microsoft CRM 2011 provides call scripting out of the box using processes. Processes are now used in place of workflows. Microsoft has categorized processes in Workflows and Dialogs. Workflows are same old workflows but dialogs can be utilized in various ways i.e. Call Scripting, Approval Processes, User Feedback Process and many more as CRM 2011 gets introduced in various industry sectors.
In this post, we will discuss processes from two perspectives. One is related to designing a process and other is execution of processes. Processes are located in Settings -> Process Center in navigation pane as shown below:
Microsoft CRM 2011 provides a designer tool for designing processes and this designer tool is very much similar to workflow designer but much more capabilities as compared to workflow designer. Now you have the options to prompt and get user input into process.
For the sake of clarification, lets design a script for call center representative to ask first name and last name of customer  whenever takes a call from customer.
This script will be designed to execute on phone call activity as shown in the category attribute.
Now we will add a page and then add two prompt and response steps for first name and last name and one prompt and response step for email.
We have almost designed are very simple Call script that will ask standardize our response when a call is received from customer. It will first ask for first name & last name. Then will ask for customer email address. Here we can specify as many steps as required to implement you call scripting needs and you can utilize the values gathered through this script to send emails. Create records as cases, contacts, activities, service activities etc.
Let’s Activate [published/unpublished is renamed as activated/deactivated] this process and Execute from Phone call activity. You can see from below screen that there are no more clicks involved to create a phone call activity. It’s pretty quick and easy. Thanks Microsoft for this consideration.
Now let’s execute the Call Scripting from phone call start Dialog as shown below:
Select the specific Dialog and click OK.
Click Finish at end of the process to and an email will be created.
and sent to customer upon completion of the process.

JavaScript Libraries in CRM 2011


In Microsoft Dynamics CRM 4, it is a very tedious task for system customizers to manage and track JavaScript. System Customizers/Developers have to write JavaScript on every event handler on the form. But Microsoft Dynamics CRM 2011 provides JavaScript libraries that can be utilized on events and forms across the solution. Now common JavaScript functions can be written at one centralized JavaScript file and utilized across solution.
Moreover, multiple JavaScript libraries can be created. For example, one common library for general CRM Service calls and one common library for UI manipulation and so on.
Let’s create a very simple JavaScript library and create a function to hide/show a tab/section on the form. JavaScript libraries are added as web resources in solution as shown below:

Now let’s create a JavaScript Common Library by adding a web resource in the solution. Then attach a JavaScript file this web resource.

Now let’s open the file in Text Editor available in web resource to add a function to show/hide a section/tab on form.

Microsoft Dynamics CRM 2011 provides new xrmPage model to access UI and data at client side. Here is a snapshot of the hierarchy.

Now let’s go to the account form in solution and then go to form properties to set JavaScript library and function to execute on form load event handler as shown below:

Now let’s add library from solution library.

Now let’s call the HideShowSection function in JavaScript Library by selecting appropriate JS library and typing the right function.  Enable the event handler by setting Enable flag to true. Also pass parameter to function by comma separated list of parameters i.e. 1, false which in turn sets tab 1 to visible false.

You can see that Details tab is now hidden and alert.

Thursday, 28 April 2011

CRM 4.0 Installation

Following is the Installation Procedure for CRM 4.0 :-

Start the Setup.exe

Choose weather you want to upgrade the setup or not
Type the Product Key
This message will come if you are using a Trial Key
 Click on I Accept the licence agreement
 Click on Install Prerequisites

 Choose Installation Type (Typical for Single Computer & Custom for Multiple Machines )
 Type the Name of SQL Server Instance
 Type the Organization name and Choose the Base Currency


 Choose the Website for CRM
 Type the Report Server url
 Choose the Organizational Unit (OU)
 Type the User Account (this account will be the System Administrator in CRM)
 Type the Name of Machine Hosting the Email Router




Installation Complete