Debugging · Dynamics CRM 2011 · Plugin

CRM 2011: Plugin Context Depth for Associate One to Many (1:M) Relationship

Scenario:
Entity X has one to many relationship with Entity Y. So in entity Y there is a lookup field new_xId. Users can edit Y record to assign new_xId or add Y from X subgrid.

In this case because field new_xId always get changed, we added a plugin to update message of entity Y. We expected the context depth will be 1 when the association happens.

It is 2.

After alot of head scratching why Plugin Context Depth is 2; we found out that it is only 2 when associating Y records from X subgrid, but it is 1 when editing record Y individually.

Our conclusion is that Associate 1:M event actually fires an update event. Keep this in mind when designing plugin.

Cheers – Sy

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s