Tip #47: Simple multi-select lists in CRM 2013

There is no out of the box support for multi-select pick lists in Dynamics CRM but since the latest UI improvements in CRM2013 you can use a standard N:N Relationship with form sub-grid to get a most respectable multiple selection form field.

For example, if we wanted a ‘Languages Spoken’ pick list on a Contact Form:

  1. Create a custom entity (e.g. Language)
  2. Create a custom N:N relationship (E.g. Language->Contact)
  3. Edit the ‘Active Languages’ view and remove the created on field – leaving just the name field. This is so that we only see the language name in the inline sub-grid control.
  4. Edit the Contact form and insert a sub-grid selecting ‘Languages’ as the entity, also set ‘Show Label on form. The key is to insert it into a single column section so that it looks like it is a form field.

You will then get a nice control that allows you to add languages by typing in the inline lookup control:

Multi-select lists in CRM 2013

This beauty of this approach over other more bespoke ones is that it is fully supported and the data is searchable from within Advanced Find. Often the simplest solutions are the best!

Tipped to the jar by Scott “The Ribbon Man” Durow

21 thoughts on “Tip #47: Simple multi-select lists in CRM 2013

  1. pit says:

    thx for this tip,but.. one question….
    am i right, that we can not have predefined entries?
    i mean, normally a picklist has its values, which are not editable for a standard user and if i use n:n relationship, there are no predefined entries,or??

    thx pit

    • You’re quite right, it’s not an exact replacement in terms of UI experience. Sounds like you expected multi-select listbox or set of checkboxes.

      However, from functionality point of view, your “predefined entries” are the exactly related entity records, the only difference being is that they are not visible and to “check the box” you need to associate a record. The user is limited to the content of Language entity in the example above. Take away create permission on that entity and user will only be able to add/remove Languages Spoken but not to create new languages. So while UI is a bit different, functionality is exactly the same as multi-select lists.

  2. Dave G. says:

    This works very well and I like the usage. Question: How do you import a large set of data to prepopulate these choices? Continuing with your example, if I already have a set of people and the languages they speak, I can import the people into Contacts, but how do I populate the set of languages for each person and associate those with the appropriate Contact records?

    Thx

  3. Scott Durow says:

    Dave,
    Your choices fall broadly into two categories:

    1. Use a Tool
    Tools such as Scribe or Simego Data Studio allow you to create N:N relationships.

    You could also use Andrii’s importer tool – a33ik.blogspot.co.uk/2012/07/n-to-n-importexport-webresource.html

    If you have SSIS skills you could also use KingswaySoft’s SSIS toolkit that supports N:N relationships – http://www.kingswaysoft.com/products/ssis-integration-toolkit-for-microsoft-dynamics-crm

    2. Write Code
    Using the SDK WebServices you can easily call the Associate method to create N:N relationships – http://msdn.microsoft.com/en-us/library/gg309247.aspx

    Another options is to create a custom entity to represent the intersect (manual N:N entity) – then create a plugin that fires on create of this entity and performs the associate automatically. You can then import these custom records using the standard import and then delete them after the plugin has fired.

    Hope this helps,
    Scott

  4. Venkata Ravi says:

    To achieve this through JavaScript check below post

    http: //mscrmtutorials.blogspot.in/2014/04/multi-select-checkbox-in-ms-crm-2011.html

  5. Shaun says:

    This is exactly what i need but the issue is that it isn’t searchable in advanced find as you’ve described from what I can see, and that’s something that is very important to what I’m trying to do. Any ideas?

    • Paul Boiano says:

      I agree Shaun. From my testing of this solution, the big drawback seems to continue to be that I can’t easily filter on a Contact’s languages spoken in the AF filter. Scott…do you know of a way to do this. Your post indicated that it is searchable. I am on the latest release of 2015 including the May service release. The Searchable property is set to yes in the relationship definition but nowhere is it found in the Related Fields in the Filter Selections of AF.
      Thanks,
      Paul

      • satya says:

        I agree with Paul, the issue is we can’t search the entity record associated with a multiselected field. The solution works fine, but has quite a few limitations..
        1. We need to save the entity record before we get can add the multi-select item.
        2. Reporting limitations
        3. Ability to search

        BR/Satya

    • Rose says:

      Has anyone found an answer to the Sorting and Filtering of records? e.g. view all “English” and “French” speaking contacts?

  6. Raj says:

    I don’t think this will work for a Appointment Activity entity. I tried and could not see the Appointment Activity in the drop down. Is there any other alternative?

    Thanks !

    • Raj,

      this is using N:N relationships. Where do you have an N:N relationship to Appointment Activity?

      George

      • Raj says:

        Yes, we want to have it for Appointment Activity.

        We have a entity as Strategies. When a Marketer has a Appointment Activity then we also want the marketer to list what strategy / strategies the appointment was about (it could be one or many)? The Appointment activity does not allow N:N relationship.

        Thanks !

  7. anju says:

    Has anyone found an answer to the Sorting and Filtering of records? e.g. view all “English” and “French” speaking contacts?

  8. Caitlin Knox says:

    I too am looking to leverage the values added in reporting and specifically, populating Marketing Lists. What I’m currently trying is adding additional fields that would populate ‘Yes’ or ‘No’ using Business Rules. For example, if the subgrid contains ‘Office Closure’ then update value of ‘Office Closure – Notice’ to Yes. I then create the dynamic Marketing Lists to pull in the Contacts who have that ‘Office Closure – Notice’ marked yes. Logically it seems like it would work- but for some reason the Business Rule is failing. I’ve tried making the condition ‘equals’ and ‘contains’ with no luck. Opened a ticket with Microsoft to see if they have any suggestions.

    • Teresa says:

      Caitlin, If you find a way to make this work, please post it here! I’m simply looking to create a dynamic marketing list based on the values from my new subgrid. Thank you!

  9. Avey says:

    Has anyone found a solution to searching and filtering records associated in a sub-grid? i.e. what Anju asked earlier?

  10. Andrew says:

    To make the relationship appear in advanced find change the Display Option field on the relationship to Use Plural Name – then save and publish all. Languages will now appear on related entities list.

    I think I can attribute this to Gonzalo Ruiz..

Leave a Reply

Your email address will not be published. Required fields are marked *