MergeRequest 클래스
Contains the data that’s needed to merge the information from two entity records of the same type.
네임스페이스: Microsoft.Crm.Sdk.Messages
어셈블리: Microsoft.Crm.Sdk.Proxy(Microsoft.Crm.Sdk.Proxy.dll에 있음)
구문
‘선언
<DataContractAttribute(Namespace:="https://schemas.microsoft.com/crm/2011/Contracts")> _
Public NotInheritable Class MergeRequest
Inherits OrganizationRequest
[DataContractAttribute(Namespace="https://schemas.microsoft.com/crm/2011/Contracts")]
public sealed class MergeRequest : OrganizationRequest
예제
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);
설명
Message Availability
이 메시지가 작동하려면 호출자가 서버에 연결되어야 합니다.
Usage
Pass an instance of this class to the Execute method, which returns an instance of the MergeResponse class.
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.
Supported Entities
다음 표에서는 이 메시지를 지원하는 기본 엔터티를 보여 줍니다. 나열된 엔터티에 대해 이 메시지를 사용할 수 있으려면 호출자가 서버에 연결되어야 합니다.
Entity |
---|
account |
contact |
lead |
incident |
For a description of how actions on a parent record affect child records, see Entity Relationship Behavior.
Merge incidents
The behavior of merge for incidents is different from merging accounts, contacts, or leads in the following ways:
The UpdateContent property is not used.
For other entities this property may be used to transfer selected values from the subordinate record to the target record. When merging incidents the value of this property is ignored.
Merge is performed in the security context of the user.
Merge operations for other entities are performed with a system user security context. Because incident merge operations are performed in the security context of the user, the user must have the security privileges to perform any of the actions, such as re-parenting related records, that are performed by the merge operation.
If the user merging records doesn’t have privileges for all the actions contained within the merge operation, the merge operation will fail and roll back to the original state.
상속 계층
System.Object
Microsoft.Xrm.Sdk.OrganizationRequest
Microsoft.Crm.Sdk.Messages.MergeRequest
스레드 보안
이 형식의 공용 정적(Visual Basic에서는 Shared) 구성원은 스레드로부터 안전합니다. 인스턴스 구성원은 스레드로부터 안전하지 않을 수 있습니다.
플랫폼
Development Platforms
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Target Platforms
Windows Server 2008,Windows Server 2012,Windows 7
Change History
참고 항목
참조
MergeRequest 구성원
Microsoft.Crm.Sdk.Messages 네임스페이스
MergeResponse
기타 리소스
Merge 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.
© 2015 Microsoft. All rights reserved.