Invoking crmservice: CPU and memory peaking

The last few days i’ve been working on a WCF service which is using a few other services as sources. One of the source is the crmservice. Somehow when i was programming against the crmservice everything went smooth when i was testing it in the development server of Visual studio (Cassini). When i deployed the WCF service on a webserver in IIS the service was performing very poor. The CPU and the memory was rising sky high. It took me a while to figure it out, but a colleague of my pointed me to a very good post which was a start for solving my problem. I am not a CRM guru, so this post is maybe for some of you old news but you have to check this post of the CRM team. Down in the comments someone has a step by step description. You can find it here. Hopefuly you don’t have to spent to much time solving this issue.

Regards

Relations in CRM 4.0

Hi all,

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:

Primary entity Relation Secondary entity
Account 1:N CustomRelation
Account 1:N CustomRelation

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.

CRM relation

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.

CRM relation

In the screenshot below we see the same relationship but the parties are reversed. Micorsoft is the selected account and Party1 in the relationship.

CRM relation

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.

Kind Regards!