Significance of Secondary Entity in Plugin Registration Tool while Registering Plug-In in MSCRM

\”Secondary Entity use when you have to trigger plugin or retrieve record from Intersect Entity(contactleads) having records of Entities(Contact and Lead) having N:N Relationship\”

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.

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,

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.
From Dynamics CRM 2011 onwards, the ‘SetRelated’ and ‘RemoveRelated’ have been succeeded by the ‘Associate’ and ‘Disassociate’ messages respectively.


Published by arpitpowerguide

My name is Arpit Shrivastava, who is a Microsoft MVP in the Business Applications category. I am a Microsoft Dynamics 365 and Power Platform enthusiast person who is having a passion for researching and learning new things and acquiring immense knowledge. I am providing consistent help, support, and sharing my knowledge through various Social Media Channels along with my Personal Blog, Microsoft Community, conducting online training and attending various 365 Saturday Events worldwide and sharing the best Solutions to the readers helping them achieve their goals and objectives in Customer Relationship Space.

3 thoughts on “Significance of Secondary Entity in Plugin Registration Tool while Registering Plug-In in MSCRM

  1. Helps you with your all question like : How to Track Android PhoneHow To Restore Your Apps And Settings On A New Android PhoneBest Android Messaging AppsWhat Is Cached Data & What Are The Ways To Clear Cache Data On Android

    Like

  2. Special thanks to (hackingsetting50@gmail.com) for exposing my cheating husband. Right with me i got a lot of evidences and proofs that shows that my husband is a fuck boy and as well a cheater ranging from his text messages, call logs, whats-app messages, deleted messages and many more, All thanks to (hackingsetting50@gmail.com), if not for him i will never know what has been going on for a long time. Contact him now and thank me later.

    Like

  3. Special thanks to (hackingsetting50@gmail.com) for exposing my cheating husband. Right with me i got a lot of evidences and proofs that shows that my husband is a fuck boy and as well a cheater ranging from his text messages, call logs, whats-app messages, deleted messages and many more, All thanks to (hackingsetting50@gmail.com), if not for him i will never know what has been going on for a long time. Contact him now and thank me later.

    Like

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: