다음을 통해 공유


OrganizationServiceProxy.Associate Method

Definition

Creates a link between records.

public:
 virtual void Associate(System::String ^ entityName, Guid entityId, Microsoft::Xrm::Sdk::Relationship ^ relationship, Microsoft::Xrm::Sdk::EntityReferenceCollection ^ relatedEntities);
public void Associate (string entityName, Guid entityId, Microsoft.Xrm.Sdk.Relationship relationship, Microsoft.Xrm.Sdk.EntityReferenceCollection relatedEntities);
abstract member Associate : string * Guid * Microsoft.Xrm.Sdk.Relationship * Microsoft.Xrm.Sdk.EntityReferenceCollection -> unit
override this.Associate : string * Guid * Microsoft.Xrm.Sdk.Relationship * Microsoft.Xrm.Sdk.EntityReferenceCollection -> unit
Public Sub Associate (entityName As String, entityId As Guid, relationship As Relationship, relatedEntities As EntityReferenceCollection)

Parameters

entityName
String

The logical name of the entity specified in the entityId parameter.

entityId
Guid

The ID of the record to which the related records will be associated.

relationship
Relationship

The name of the relationship to be used to create the link.

relatedEntities
EntityReferenceCollection

A collection of entity references (references to records) to be associated.

Implements

Remarks

The core implementation of the Associate method. For more information, see IOrganizationService.Associate(String, Guid, Relationship, EntityReferenceCollection).

For more information about the exceptions that can be thrown when calling OrganizationServiceProxy methods, see Handle exceptions in your code.

Applies to