Looking for PowerObjects? Don’t worry, you’re in the right place! We’ve been part of HCL for several years, and we’ve now taken the final step in our acquisition journey: moving our website to the HCL domain. Nothing else is changing – we are still fanatically focused on Microsoft Business Applications!

PowerObjects Blog 

for Microsoft Business Applications

How to Use Dependent Lookups for Dynamics CRM 2013/2015/2016 Like a Pro

Post Author: Joe D365 |

Have you been looking for a way to filter the available options in one lookup field based upon the value of another lookup field? This can be done easily in Microsoft Dynamics CRM 2013, 2015 and 2016 without any custom code, and in today's blog, we will show you how! Let's begin!

Let's walk through the necessary steps using two fields to classify your Accounts as an example. We'll use Class and Sub-Class as the fields. For this example, we've created a new entity for each of these fields.

The Sub-Class entity contains the name of the Sub-Class as well as a lookup to the "parent" Class record. This relationship will allow us to filter the list of available Sub-Classes based on the selected Class.

The Class entity has only a single field to store the name of the Class. We've added a sub-grid to display only the list of Sub-Classes that are valid for this Class.

For the example below of Retail, once we add these fields to the Account form and modify the properties of the Sub-Class field, the user will only be able to choose one of the Available Sub-Classes listed, when Retail is selected as the Class on the Account form.

Now that we have the entities and some sample data in place, we'll need to create these new fields on the Account entity and add them to the Account form.

This is how the new lookups look on the CRM form:

Next, we'll configure the Sub-Class field properties so that only the Available Sub-Classes are options.

Note: Be sure to publish your customizations once you are finished.

You should now see the desired behavior on the Account record. If you populate a value for Class, you'll notice how only the Available Sub-Classes can be be selected as an option.

This is technically all that needs to be done, however, you should also put a Business Rule in place to prevent a user from selecting a Sub-Class unless the Class field is populated.

In the Account entity, navigate to Customize the System, select Business Rules, and then click New.

The Business Rule below will meet this need.

In the red box below, we are saying that if the Class is blank, we lock the Sub-Class field. This will make it Read Only.

In addition, we need to clear the Sub-Class field. We do this to ensure that a user cannot change the value of the Class and leave an invalid Sub-Class populated.

In the blue box, we are saying that if Class is populated, we unlock the field so the user is able to populate it.

That's all for the blog today! Want to learn more about Dynamics CRM 2016? Register for our CRM 2016 Boot Camp in Minneapolis, MN.

Happy CRM'ing!

By Joe D365
Joe D365 is a Microsoft Dynamics 365 superhero who runs on pure Dynamics adrenaline. As the face of PowerObjects, Joe D365’s mission is to reveal innovative ways to use Dynamics 365 and bring the application to more businesses and organizations around the world.

3 comments on “How to Use Dependent Lookups for Dynamics CRM 2013/2015/2016 Like a Pro”

  1. Thank for this write up JoeCRM, this is much easier than coding dependent option sets! Question, if the sub or tertiary lookup is a duplicate of a parent, how can that be handled with out multiple entries? We are looking to use this for creating a support case. For example a user would select CRMContactAdd then provide the data to have a contact added, or CRMAccountAdd then provide the data to have an account added. Do I just have to have 2 Add records in the tertiary type entity? I would prefer just having Add once, since with our build out we are going to have 5 or 6 different Add records under different primaries and subs.

  2. Thanks Joe this is very useful, one question I am not seeing the same behavior of dependent lookup if the fields are used in business process flow?
    Omar Sharif

  3. Hi Joe, Can you also add a business rule that changes which options are displayed for selection in a field based on what was selected in a previous field? I have been able to set a default selection in a second field based on what was selected in a previous field but haven't found a way to change what options are available for selection in a second field based on what was selected in the first field. Thanks for any insight!

PowerObjects Recommends