Many to Many Relationships and Advanced Find
Bill Goergen

Microsoft Dynamics Vertical

Inetium can implement a CRM solution that fits your business needs.

Learn More >>

Inetium is the go to partner for Microsoft SharePoint consulting services.

Learn more >>

Syndication

One of the coolest things about MS CRM v4.0 is how easy it is to establish relationships between entities.    Creating Many-to-One (N-1)  or One-to-Many (1-N) relationships is a snap and allows users to link entities together in all sorts of neat and creative ways.  Creating these relationships creates a Look-Up field to the secondary entity that allows easy visibility to important information found on other entities.  There are a lot of blog posts about how to create and use relationships in CRM so I won’t re-hash that here.   Follow this link for a good post found on the Microsoft Dynamics Team blog site.

http://blogs.msdn.com/crm/archive/2008/02/14/crm-4-0-relationships-explained.aspx

Many-to-Many relationships (N-N) are especially cool.   In the v3.0 days you had to be a bit creative to create a Many to Many relationship, but with v4.0 the system automatically creates a “hidden” entity that allows for the creation of these relationships with very little effort.  

Many-to-Many relationships allow visibility into these relationships from both directions.  That is, you can easily associate and display how many “A” records are associated with “B”, and how many “B” records are associated with each “A”.  As the name implies, there can be many “A’s” associated with many “B’s” and vice versa.

There is one quirk of Many-to-Many relationships that we ran into with a new deployment recently that users and those who configure MS CRM should be aware of.     Above I commented that MS CRM creates a hidden entity to enable the creation of these N-N relationships.    Well, as the actual data from these relationships are stored in this “hidden” entity, the information housed in them is not searchable via Advanced Find. 

In this instance we were associating Contacts with a custom entity called “Buildings” via Many-to-Many relationship. 

From the application side this worked great.    We could always view which Contacts were associated with which Building from the Building record, and, which Building was associated with which Contacts from the Contact record.  Exactly what we needed.

However, when we went to write a query in Advanced Find to view this information, CRM does not present the option of retrieving data from the hidden entity that actually stores the data.   We were forced to come up with a bit of a work around to get the data we were looking for into Excel. 

This issue may not present itself every day, but knowing this to be the case can save everyone some time and energy when you are trying to write an Advanced Find query against an entity that is “hidden” by design.


Posted 05-07-2009 9:50 AM by bgoergen
Inetium, LLC. Site Information