Microsoft Dynamics 365 Partner

Steve Mordue

Subscribe to Steve Mordue: eMailAlertsEmail Alerts
Get Steve Mordue: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Related Topics: Microsoft Developer, CIO/CTO Update

Blog Feed Post

Dynamics CRM 2013 – Feature Dive – Multi Select Option List

Forceworks Dynamics CRM 2013 – Feature Dive – Multi Select Option List

So you probably found this post as a result of a search for “Microsoft Dynamics CRM Multi Select Option List”, or something similar. Well, I have bad news and good news. This feature is still not a part of the 2013 release, but there is a workaround. No, not that Javascript hack that you found in all the other search results, that’s just gonna break on upgrade. No, its not that Dialog Box trick that seems like a goofy, non-intuitive way to do it. There is a fairly simple way to do this, that is intuitive, and does not use any foreign code that might break later.

Recently we were tasked with a migration from Salesforce.com to Dynamics CRM Online. Migrations can be challenging for a lot of reasons, but one of them is the fact that Salesforce.com has a multi-select “Picklist” field type. Microsoft’s “Option List” does not have a multi-select capability. But we had to migrate this multi select field over so we had to figure it out. The Javascript hack that is out there would not work for two reasons, first I do not condone “un-supported” methods and I know it will eventually break, and also we could not map to it properly even if we wanted to use it. Instead we used some in-built functionality that you can see yourself if you look at the Opportunities form. In the default installation, on the right hand side is a box called “Competitors”.  This is simply a related lookup of another entity, but allows for the selection and display of multiple competitors. Many of you by now have figured out my “Super Secret” solution. But for the rest of you, here is how it is done:

Two steps: Create a new entity and populate it with your options and add the relationship to the entity you need, then display it on the form where you want it. Let’s take it step by step. Note, I will be showing this in the new CRM 2013 Online, but the same method will work in 2011 or on-premise deployments.

Step One

The first step is to create an entity for your list. You must have the System Administrator or System Customizer role to perform this task.

1. Go to Settings/Customize/Customize the System, click on Entities and then New and you will be presented with the dialog below. Create a display name and a plural name for this “list” and tick the “Settings” area to display so you can access this later for adding items, then click Save and the dialog box will refresh.

1

Now click “Fields” in the left sidebar and scroll down to “new name” and double-click it. New entities are created with a default name, this step is optional but it makes sense to use a relevant name

2

Edit the Display Name label to whatever your list items are called and Save and Close.
3

Back in the Entity Dialog click “N:N Relationships” in the sidebar and click New. Select the entity you want this list to appear in, (I chose Opportunities ) and Save and Close. (Note you can add additional N:N relationships to use this list in other entities, like a global list)

6

Click Save and Close, and Publish all Customizations

Step Two

Go back to, in my case, the Opportunities entity, click Forms and double-click the Default Opportunity form, or whichever form you want to add the list to:

5

In the form designer, click in the form block where you want the list to appear, then on the Insert tab click to add a Sub-Grid.

8

Create a name, a label, select the list entity, uncheck chart and click Set, Save and Publish

9

Here you can see the block was added to the form, as you may know you can resize and drag this anywhere you want.

13

Now let’s take a look at our completed Opportunity Form. You can click the image to enlarge.

15

12Clicking the “+” gives you not only the option to select multiple items that you created earlier in the list, but you can also add new items on the fly which will then be a part of this list.

Summary

In my opinion this is much more powerful than a simple multi-select list as each item in the list can be clicked to take you to that item’s information. While I only created an item name, I could have added more fields to the item entity to provide whatever additional information I wanted.

The best thing about this method is that it is “future-proof”, we have not introduced any third-party or foreign code so this will upgrade seamlessly.

In our Salesforce migration we were even able to map a Salesforce.com picklist to this related list lookup with no issues.

Feel free to give me your thoughts on this method in the comments below.

Read the original blog entry...