Search code examples
javascriptc#asp.net-mvcdynamics-crmdynamics-crm-online

How do we allow multiple selections for a single field in Dynamics CRM?


We needed to have multiple values selection for a custom entity Tagging. Hence, we successfully configured a many-to-many relationship between Project and Tagging entities:

m to m relationship between Project and Tagging entities

However, for this entity Tagging, we're unable to select multiple values in Project form:

You can select only 1 row

Any option on server side C# or js is fine.

How do we allow multiple selections for a single field in Dynamics CRM?


Solution

  • Not possible out of the box (or) using C# (or) using JS as many to many in the background uses a intersect table to hold data. Any related Tagging entities will therefore show up under the record's sub navigation.

    Very good workaround would be to use a html web resource prompt and get the selections from the user (using a custom multi-select control) or checkboxes. You can then use CRM Actions to pass the data to a custom workflow activity which would then associate the Project with the Tagging entity.

    You could also write the selected values to a new field on the form as a comma delimited text and wire up a plugin on change of the field to create/update/delete related Tagging entities.

    Use Associate/Disassociate to associate projects and tagging records.