Skip to content

Significance of Secondary Entity in Plugin Registration Tool

While using the Plugin Registration tool in Dynamics CRM, we might have rarely or even never used the ‘Secondary Entity’ field and almost always assigned it as ‘none’, but there are some scenarios where this field comes into play.

Significance of Secondary Entity in Plugin Registration Tool – Image 01
Significance of Secondary Entity in Plugin Registration Tool – Image 01

When is ‘Secondary Entity’ required

The following 2 messages require the ‘Secondary Entity’ to be specified while registering a step in Plugin registration:

  • SetRelated
  • RemoveRelated

These two methods were extensively used in Dynamics CRM 4.0, but they were deprecated from Dynamics CRM 2011 onwards; although you can still use them in 2011 and 2013.

What are the supported ‘Secondary Entities’

Following is the table depicting the out-of-the-box ‘Primary Entity’ and ‘Secondary Entity’ that are supported for both ‘SetRelated’ and ‘RemoveRelated’ messages:

Primary Entity Secondary Entity Supported Relationships
Invoice Contact contactinvoices_association
Lead Account accountleads_association
Lead Contact contactleads_association
Opportunity Account opportunity_customer_accounts
Opportunity Contact opportunity_customer_contacts
Opportunity Competitor opportunitycompetitors_associationor
Product Lead leadproduct_association
Product Competitor competitorproduct_association
Quote Contact contactquotes_association
SalesLiterature Competitor competitorsalesliterature_association
SalesLiterature Product productsalesliterature_association
SalesOrder Contact contactorders_association

You can also find this entire list in the Dynamics CRM SDK, which can be downloaded from here

What does ‘SetRelated’ and ‘RemovedRelated’ do

These two messages are basically triggered when a primary entity record is associated/dissociated with/from the secondary entity record via the relationships supported, details of which are mentioned above. So, if you’re planning to execute some business logic on association of the above mentioned entities, you can register the plugin against the ‘SetRelated’ message. The ‘RemoveRelated’ works for dissociation of the entity records from each other.

Significance of Secondary Entity in Plugin Registration Tool – Image 02
Significance of Secondary Entity in Plugin Registration Tool – Image 02
Significance of Secondary Entity in Plugin Registration Tool – Image 03
Significance of Secondary Entity in Plugin Registration Tool – Image 03

From Dynamics CRM 2011 onwards, the ‘SetRelated’ and ‘RemoveRelated’ have been succeeded by the ‘Associate’ and ‘Disassociate’ messages respectively.

Published inDynamics CRM 2011News & Features Dynamics CRM 2011

Have something to add?

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Loading Facebook Comments ...
Loading Disqus Comments ...

No Trackbacks.