Thursday, 2 March 2017

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

In many Interviews you might have been asked the Question "what is the Use of secondary entity in the 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 required.

Secondary Entity use when you have to trigger plugin or retrieve record from Intersect Entity having records of Entities having N:N Relationship.

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.
Following is the table shows the out-of-the-box ‘Primary Entity’ and ‘Secondary Entity’ that are supported for both ‘SetRelated’ and ‘RemoveRelated’ messages:
Primary EntitySecondary EntitySupported Relationships
InvoiceContactcontactinvoices_association
LeadAccountaccountleads_association
LeadContactcontactleads_association
OpportunityAccountopportunity_customer_accounts
OpportunityContactopportunity_customer_contacts
OpportunityCompetitoropportunitycompetitors_associationor
ProductLeadleadproduct_association
ProductCompetitorcompetitorproduct_association
QuoteContactcontactquotes_association
SalesLiteratureCompetitorcompetitorsalesliterature_association
SalesLiteratureProductproductsalesliterature_association
SalesOrderContactcontactorders_association
the above information also available in the CRM SDK.

Thanks for reading.. :)

No comments:

Post a Comment