Plugin on Merge message in CRM

Hi,
 
Recently, we had a to write a plugin on merge message in CRM. We need to perform some activity based on merged records(Master and Subordinate).
 
Here is the C# code to get the Master and Subordinate entity reference in the plugin code.
 
if (pluginContext.InputParameters.Contains(“Target”) && pluginContext.InputParameters[“Target”] is EntityReference)
{
       EntityReference entityReferenceMaster = (EntityReference)pluginContext.InputParameters[“Target”];
       Guid guidSubOrdinate = (Guid)pluginContext.InputParameters[“SubordinateId”];

       // Get Master record information. Specify the attributes which you want to retrieve

       Entity entMasterAccount = crmService.Retrieve(“account”, entityReferenceMaster.Id, new ColumnSet(new string[] {  }));

       // Get Subordinate record information. Specify the attributes which you want to retrieve
       Entity entOrphanAccount = crmService.Retrieve(“account”, guidSubOrdinate, new ColumnSet(new string[] { }));
}

Hope this helps


Happy CRM’ing
Gopinath

2 thoughts on “Plugin on Merge message in CRM

  1. Anonymous January 13, 2016 / 10:56 am

    The Best CRM Software are all effective and tough making sure that your business gets the necessary demand all fulfilled thereby taking into count all features necessary for your management. The website is professionally designed making sure business owners can get the basic task completed within simple and effective ways. The online CRM software is worth enough for use and can be bought by any business from genuine service providers.

    Like

  2. kailash October 4, 2018 / 4:12 am

    Thank you very much for this post. I was looking exactly for this !!! Good work !!

    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