Posts

Showing posts with the label retrieve

Merge Action in Plugin

  Introduction- In this blog we will understand the Action Merge from a Plugin (SDK message) perspective. Problem Statement: 1) We want to retrieve data once the Merge is performed on two records. 2) We want to merge 2 records using a plugin (C# code). Solution: For the first statement, We shall be triggering a plugin on the message "Merge". While using the plugin registration tool, select message as Merge. Below code is to be used-   if ( context . InputParameters . Contains ( "Target" ) && context . InputParameters . Contains [ "Target" ] is EntityReference ) {     EntityReference Master = ( EntityReference ) context . InputParameters [ "Target" ];     Guid duplicate = ( Guid ) context . InputParameters [ "SubordinateId" ];  } For the second problem statement, we will invoke/ use the Merge method. Below is the code-       var target = new EntityReference ();       target . Id = Recordid ; //master recor...