A N:N (many-to-many) relationship is used to link many records from one entity to many records of another.
Each side of the relationship will display the various records that are associated with each other as a result through a subgrid.
Behind the scenes, D365 creates a relationship entity that links the records together. This relationship entity cannot be edited, so no additional fields/information can be tracked for the relationship.
The most common N:N relationships are records associated with a marketing list. Accounts, Contacts, and Leads can be on multiple marketing lists and each marketing list can have multiple Accounts, Contacts, or Leads associated to it.
No other information can be collected about that relationship, just the name of the record and the marketing list it is associated to. Using Contacts as an example, when looking at a Contact related marketing list, it shows a sub-grid of Contacts associated to it.
Then, if you look at a Contact record, you can see a sub-grid of all marketing lists it is associated to it.
There are many uses cases where an N:N relationship may make sense:
Listing skills of a Contact
Products/Product Categories sold to an Account
To set up or alter N:N Relationships in Microsoft Dynamics 365/CRM, follow these simple steps …
Open your solution explorer
Navigate to Components, then Entities, and expandEntitytitiy you want to work with
Click on N:N Relationships
To edit existing relationships, select the relationship you want to work with via the Actions Toolbar and click “Actions” > “Edit”. If you’re adding a new relationship, however, click “New Many-to-Many Relationship”
For new relationships, under “Current Entity” > “Display Option”, select one of these options:
“Do Not Display”
“Use Custom Label”
“Use Plural Name”
Under “Other Entity”, select the other entity from the “Entity Name” list
Under “Relationship Definition”, confirm your “Name” and “Relationship Entity Name”. Keep in mind that each of these values must be unique and specific to each N:N: Relationship.
When you’re ready, select “Save and Close” to close your N:N Relationship form in Dynamics.
Finally, when you’re done with customizations, publish them.
If you’re publishing an edit, do so by clicking on the Home tab, then click “Save Group” and “Publish”.
To publish every unpublished component at once, click “Publish All Customizations”.
Learn more about Relationships in Microsoft Dynamics 365/CRM when you catch-up and click replay on our December Microsoft Dynamics 365/CRM user group webinar, “Best Practices for the Advanced Admin”.