OrganizationServiceProxy.Associate(String, Guid, Relationship, EntityReferenceCollection) OrganizationServiceProxy.Associate(String, Guid, Relationship, EntityReferenceCollection) OrganizationServiceProxy.Associate(String, Guid, Relationship, EntityReferenceCollection) 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

Parameters

entityName
String String String

Type: String. The logical name of the entity specified in the entityId parameter.

entityId
Guid Guid Guid

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

relationship
Relationship Relationship Relationship

Type: Relationship. The name of the relationship to be used to create the link.

relatedEntities
EntityReferenceCollection EntityReferenceCollection EntityReferenceCollection

Type: 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