Monthly Archives: December 2011

Multi-Column Sorting Views in Dynamics CRM 2011

Views within Microsoft Dynamics CRM 2011, by default, support up to two pre-defined sortable columns, which are selected when the view is defined.

However, it is possible to manually sort any View on multiple columns using a combination of your mouse and keyboard.

Let’s walk through the process:

Here is a view of some Contact sample data which has been sorted by the Contact’s full name. 


We would like to re-sort this View by address information.

Step 1: Click Address 1: State/Province

The view will be sorted by the State/Province:


Also notice that the background color of the column is now grey and an arrow has been placed on the right-side of the column header.

A arrow pointing up indicates that the column is sorted in Ascending order, an arrow pointing down indicates that the column is sorted in Descending order.

Note: If the full text of the column header is not displayed, then the arrow will not be displayed either. You must expand the width of the column to show both.


Step 2: Hold down the Shift Key, then click City

Again we have an arrow on the right-side of the column header and column shading to indicate this is a sort column.



Step 3: Hold down the Shift Key, then Click ZIP/Postal Code

Will result in all three columns being sorted:



Sorting in Descending Order

If you wish to sort a column in Descending order, just perform the shift-click on that column and you will see the results resorted, like this:



Additional Notes:

  • The order that you choose your columns is important with the first selected column controlling any additional sub-sorts – so make sure you start with the most important column first.
  • The selected sort order will disappear and be replaced with the default sort order as defined by the View definition, should you leave the View.
  • I don’t actually know the maximum number of sort columns because, quite frankly, I ran out of columns during my tests.  But, it is at least 7.

Refreshing a CRM View

In case you didn’t know, there is a refresh button built into the display of each and every View within CRM.

If you look in the upper-right corner of the View, you’ll see two circular-green arrows:


Clicking this button will refresh the contents of the grid.

There is one caveat, however: If you have altered the layout of the grid using the Grid Designer, the changes will not be reflected in the active View layout.

For that to take effect, you must refresh your page using F5.

1 Be careful changing the full name format within Dynamics CRM

One of the settings that is available to a Dynamics CRM administrator is the ability to change the format of the full name.  The options can be seen below:




I’ve seen a few customers change the the format from the default, First Name Last Name, to Last Name, First Name.  This allows you to Contacts and Leads sorted by last name.

The Issues

This is very effective, but here are some issues:

  • when performing a quick search ( typing in a name in the search box at the top of a view ), you must enter the full name as Last Name, First Name, instead of First Name Last Name. For example: Smith, Bob instead of Bob Smith.  This is usually counter intuitive to most users.


  • Mail Merge operations can no longer use Full Name as a field. You must use the First Name and Last Name fields.  Otherwise, the person’s name will be displayed in reverse order.


Those are just a couple of things to keep in mind when you start changing the default system settings.

Please let me know if you have any comments or have found additional issues.

Dynamics CRM: There is a whole lot of clicking going on

People new to Dynamics CRM are sometimes a little confused, and sometimes baffled, by the user interface. The most important thing to remember is that Dynamics CRM is a web application, even though there are times when it doesn’t look or act like a web application.

Since it is a web application, we get all of the goodness that is a hyper-linked system built-in.  Let’s take a quick tour of some of the clickiy-ness that is Dynamics CRM 2011.


Grids and Views

Let’s take a look at a system view showing a list of system users:


At a basic level, anything with an underline is a hyperlink to another record.

Note: Sometimes you need to hover your mouse over the field to get the hyperlink underline to appear.



  • If you would like to open Mark Harrington’s user record you can either click once on Mark Harrison’s name or double-click on the entire row.
  • If you would like to review the East Territory, simply click on the word East and that record will open.
  • Likewise, to review Mark’s manager, Lori Penor, just click once on her name.

Selecting Multiple Records

Occasionally you need to perform an action on multiple records within a CRM view.  This can be done in one of two ways:

  1. Checking the box on the left side of the record.
  2. Holding the Ctrl key down and single-clicking with the mouse to select the desired records.

You may also select or deselect all of the records on the page by checking the box on the title bar of the View:


Note: Keep in mind that not all CRM operations allow you to select multiple records before performing the operation.



When you have a CRM record open, you get more of a feel for what is a hyperlink and what is not. In this sample below, any data entry field that is blue and underscored, is a hyperlink. Clicking the link will open that record in a new window.





Lookups are the data entry fields that have the magnifying glass on the right side of the edit box.:


Clicking that icon will cause a dialog to be displayed that will allow you to select one or more values, depending on the field in question. Here is a single selection dialog:



In the single-selection dialog, you may select an item in one of the following ways:

  • Double-clicking the item’s record.
  • Checking the checkbox beside the record, then clicking OK.
  • Clicking the primary field’s hyperlink once.
    • In this case, the Name field contains the hyperlink.
    • To select Retail, just click Retail.

Here is a multiple-selection lookup:



For a multiple-selection lookup, the following actions are available:

  • Clicking the hyperlink ( Full Name in this case ) will add that record to the selected records list at the bottom of the lookup dialog.
  • Checking the checkboxes beside an item then clicking the Add button will add the record to the selected records list.
  • In the selected records list, clicking an item and clicking the remove button will remove it.
  • Using a combination of the mouse and the Shift or Ctrl keys will select multiple items, checking their selection checkbox in the process.
  • Using the checkboxes to select multiple items then clicking the OK button will automatically add the selected items to the lookup field, like this:





Well, that’s a quick tour of some of the ways that the hyperlinked system that is Dynamics CRM 2011.  Let me know if I’ve missed anything.

CRM 2011: Changes to the way things are deleted

It is worth nothing that there was a major change in the way that Dynamics CRM handles the deletion of records.

In CRM 4.0, records were merely "marked" for deletion when the user deleted the record. An automated process would occur once every 24 hours to physically remove the records from the database.

In CRM 2011, when you delete a record, it is removed immediately, with no post-processing required.

I make note of this because with CRM 4.0, it was possible to "save" a record from being physically deleted by resetting the record’s DeletionStateCode field manually using SQL.  This was an unsupported action but was sometimes used by administrators in an emergency.

That option is no longer available.  However, there is a free tool to perform this action available here:

CRM Codex – Record Recovery

More information about the technique can be found here:

Recover your deleted CRM data and recreate them using CRM API