Filtered Lookups in CRM 2011

Roshan Mehta, 26 January 2011

There have been many occasions where CRM users have asked for filtered lookups. What are filtered lookups you ask? Let’s say you have an entity with a lookup field to Account and another lookup field to Contact. You want to be able to select an Account from the first lookup, and then choose a Contact belonging to the selected Account. But hang on, why is CRM showing you all Contacts in the system?

Gone are the days of having to use a combination of developer genius, magic, and a little bit of help from the man upstairs to perform the task of creating filtered lookups in your CRM system. With Microsoft Dynamics CRM 4.0, this is not impossible, but also not such an easy task as it requires a bit of JavaScript coding. Luckily, with the built-in customization features of CRM 2011, you are able to create your own filtered lookups without any developer knowledge. Here’s an example.

Filtered Lookups in CRM 2011

Firstly, here I have a list of Contacts in my CRM system representing two different Accounts –a couple of colleagues at Magnetism Bus Charters, and the rest are representative of our favourite ice cream store. Frosty Stevens and his team have hired a bus to promote their ice cream in a few cities around the country, so I have created a new Trip Request record detailing their trip.

Filtered Lookups in CRM 2011

I have selected Frosty’s Ice Cream Store as the Client, and now I want to select who the contact will be to discuss the bus charter. Clicking on the lookup displays the following window.

Filtered Lookups in CRM 2011

Notice how only contacts from Frosty’s Ice Cream Store have been displayed. I can display all contacts in the system simply by unchecking Filter by related Parent Customer. So how did we achieve this? Simple!

Here I have navigated to the customizations area and have selected the Trip Request form. I then double-click on the Client Contact field to view its properties. Scroll down to where you see Related Records Filtering.

Filtered Lookups in CRM 2011

This section allows you to perform filtering based on any of the lookups that are present on the form. It also allows you to specify whether users are able to turn off the filter when the lookup window is displayed (i.e. by unchecking Filter by related Parent Customer as discussed above).

There you have it. A simple way to implement a powerful feature in CRM 2011.