Answered by:
Creating a Custom view with a related entity

Question
-
I'm fairly new to CRM, but I'm looking for a way to create a view that includes
an attribute from a related entity. Let me clarify this a bit:
In our implementation each contact can belong to many organizations and
each organization can have many contacts. So here we have a many-to-many
relationship with contacts and organizations. What I want to be able to do
is to create a view that lists some attributes from the contact entity(this is simple)
but on that view I want also include the 1st organization name from the entity
organizations. For example our contact Mr. John Doe can belong to OrgWow, OrgBit and OrgSas,
The view should then list the name of the contact and if we take our example it should be
Mr |John Doe|OrgWow|
In our situation this is an important requirement so that our end-users can sort on the column
organization so that they can easily browse through the contacts sorted by organization.
I really have no idea on how to accomplish this but any help or advice is greatly appreciated.Friday, March 20, 2009 11:29 AM
Answers
-
Cire -
You are correct - from the contact (or any entity in CRM) you can display attributes from entities that have a N:1 relationship to the current object - i.e. since the contact only has one 'owner' you can show attributes from the owner - or since the contact only has one parent company, you can show attributes from the owner -
In the case of 1:N relationships, such as your case where the relationship is between a contact and multiple organizations, CRM does not support pulling attributes from those child entities into the parent. -
One possible solution for you might be the same as I implemented on my most recent project.
We wanted a relationship between our accounts form and multiple industries, but we wanted one to be the primary industry. - So we added two relationships - the first was a 'primary industry' field/relationship (N:1) from the account to our custom "industries" entity - and a second relationship to the 'industries' (1:N) as 'related industries' for all other industries. - (we also added some customization to ensure that the 'primary' industry was automatically added to the 'other industries' to simplify some searching / reporting.)
Hope that helps.
Scott Sewell, CustomerEffective | http:\\blog.CustomerEffective.com | Twitter:@ScottSewell- Proposed as answer by Scott Sewell, Hitachi SolutionsModerator Friday, March 20, 2009 2:42 PM
- Edited by Scott Sewell, Hitachi SolutionsModerator Friday, March 20, 2009 2:44 PM edited for clarity.
- Marked as answer by Ronald LemmenModerator Friday, March 20, 2009 9:13 PM
Friday, March 20, 2009 2:42 PMModerator -
As Scott indicated, it is not possible to include attributes from many to many relationships. Something that you could look into, is to use the parent company attriubte to store the most important (or just the first) company. This attribute can be used in the views.
If you dont want your users to use the parentaccount attribute, then you could look into using plugins to automatically fill this attribute based on additions and removal of related accounts.
Hope this helps,
Ronald Lemmen
Microsoft Dynamics CRM MVP
http://www.ronaldlemmen.com- Marked as answer by Ronald LemmenModerator Friday, March 20, 2009 9:14 PM
Friday, March 20, 2009 9:13 PMModerator
All replies
-
If you open a View (Customize entity - Views/Form), and you add a column, you will see in the top of the column selection screen a combo box where you can select from related entities.
Then you must concider how you structure your data to be able to use this "out-of-the-box" feature to meet your requirements.Friday, March 20, 2009 11:59 AM -
Morten,
Yes I know that, but the related entity is not displayed in the drop-down list.
Thanks
Friday, March 20, 2009 12:37 PM -
Cire -
You are correct - from the contact (or any entity in CRM) you can display attributes from entities that have a N:1 relationship to the current object - i.e. since the contact only has one 'owner' you can show attributes from the owner - or since the contact only has one parent company, you can show attributes from the owner -
In the case of 1:N relationships, such as your case where the relationship is between a contact and multiple organizations, CRM does not support pulling attributes from those child entities into the parent. -
One possible solution for you might be the same as I implemented on my most recent project.
We wanted a relationship between our accounts form and multiple industries, but we wanted one to be the primary industry. - So we added two relationships - the first was a 'primary industry' field/relationship (N:1) from the account to our custom "industries" entity - and a second relationship to the 'industries' (1:N) as 'related industries' for all other industries. - (we also added some customization to ensure that the 'primary' industry was automatically added to the 'other industries' to simplify some searching / reporting.)
Hope that helps.
Scott Sewell, CustomerEffective | http:\\blog.CustomerEffective.com | Twitter:@ScottSewell- Proposed as answer by Scott Sewell, Hitachi SolutionsModerator Friday, March 20, 2009 2:42 PM
- Edited by Scott Sewell, Hitachi SolutionsModerator Friday, March 20, 2009 2:44 PM edited for clarity.
- Marked as answer by Ronald LemmenModerator Friday, March 20, 2009 9:13 PM
Friday, March 20, 2009 2:42 PMModerator -
As Scott indicated, it is not possible to include attributes from many to many relationships. Something that you could look into, is to use the parent company attriubte to store the most important (or just the first) company. This attribute can be used in the views.
If you dont want your users to use the parentaccount attribute, then you could look into using plugins to automatically fill this attribute based on additions and removal of related accounts.
Hope this helps,
Ronald Lemmen
Microsoft Dynamics CRM MVP
http://www.ronaldlemmen.com- Marked as answer by Ronald LemmenModerator Friday, March 20, 2009 9:14 PM
Friday, March 20, 2009 9:13 PMModerator