Contains the data that is needed to merge the information from two entity records of the same type. Namespace: Microsoft.Crm.Sdk.Messages
Assembly: Microsoft.Crm.Sdk.Proxy (in Microsoft.Crm.Sdk.Proxy.dll)
The following example shows how to use this message. For this sample to work correctly, you must be connected to the server to get an IOrganizationService interface. For the complete sample, see the link later in this topic.
// Create the target for the request. EntityReference target = new EntityReference(); // Id is the GUID of the account that is being merged into. // LogicalName is the type of the entity being merged to, as a string target.Id = _account1Id; target.LogicalName = Account.EntityLogicalName; // Create the request. MergeRequest merge = new MergeRequest(); // SubordinateId is the GUID of the account merging. merge.SubordinateId = _account2Id; merge.Target = target; merge.PerformParentingChecks = false; Console.WriteLine("\nMerging account2 into account1 and adding " + "\"test\" as Address 1 Line 1"); // Create another account to hold new data to merge into the entity. // If you use the subordinate account object, its data will be merged. Account updateContent = new Account(); updateContent.Address1_Line1 = "test"; // Set the content you want updated on the merged account merge.UpdateContent = updateContent; // Execute the request. MergeResponse merged = (MergeResponse)_serviceProxy.Execute(merge);
For this message to work, the caller must be connected to the server.
Privileges and Access Rights
To perform this action, the caller must have privileges and access rights on the specified entity in the SubordinateId property and privileges on the entity that is referred to in the Target property.
For a complete list of the required privileges, see Merge Privileges.
The following table shows the default entities that support this message. For the listed entities, the caller must be connected to the server for this message to be available.
For a description of how actions on a parent record affect child records, see Entity Relationship Behavior.
Development PlatformsWindows Server 2008
Target PlatformsWindows Server 2008, Windows 7 (All Versions), Windows Vista (All Versions)
Other ResourcesMerge Privileges
Sample: Merge Two Records
Customer Entities (Account, Contact)
Lead Entity Messages and Methods
How Role-Based Security Can Be Used to Control Access to Entities In CRM
How Instance-Based Security Can Be Used to Control Access to Entity Instances (Records) In CRM
Send comments about this topic to Microsoft.
© 2013 Microsoft Corporation. All rights reserved.