I am working on a project where i am implementing CRM 4.0. One of the demands of our customer is that they want to create relationships between Account entities and they want to store some additional information about this relationship. They want to add a startdate and an enddate attribute to the relationship entity. Well the relationship entity which is delivered out-of-the-box doesn’t give us any options the extend the entity with extra attributes. This means that we have to create our own relationship entity. Well in our situation we want to create N:N relation between the Account entities, which means we have to make the following relations:
We have to add this type of relation twice otherwise we can’t make a N:N relation between Accounts. So far so good, what does this mean for our CRM interface. In the left menu you will see a link to Customrelationship Entity twice. This is something you don’t want.
The first link will show us the relationships where the selected Account is the primary entity in the relation and the second link will show us the relationships where the selected account is the secundary entity in the relation. So if we implement it in this way we don’t have an single view of all the relationships from one Account.
My Colleague Ronald Lemmen told me that this should be fixed with building a plugin. The plugin will be responsible for created a relationship the other way around. For example:
Organization A –> Organization B: this relationship is made in CRM.
Organization B –> Organization A: this relationship is made by the plugin.
This solution will result in 2 relationships between the same entities. CRM itself is using the same solution. See below. In the first screenshot we see that Avanade is the selected Account. Avanade is also Party1 in the relationship with Microsoft.
In the screenshot below we see the same relationship but the parties are reversed. Micorsoft is the selected account and Party1 in the relationship.
Now that we create a reversed relationship with our plugin we are able to remove one link in the menu (see first screenshot). This can be done in the screen where you add your relations between entities. I hope that this post will help other developers who are running into the same problem.