Share via


CRUDExtentions.CreateEntityAssociation Method

Definition

Associates one Entity to another where an M2M Relationship Exists.

public static bool CreateEntityAssociation (this Microsoft.PowerPlatform.Dataverse.Client.ServiceClient serviceClient, string entityName1, Guid entity1Id, string entityName2, Guid entity2Id, string relationshipName, Guid batchId = default, bool bypassPluginExecution = false);
static member CreateEntityAssociation : Microsoft.PowerPlatform.Dataverse.Client.ServiceClient * string * Guid * string * Guid * string * Guid * bool -> bool
<Extension()>
Public Function CreateEntityAssociation (serviceClient As ServiceClient, entityName1 As String, entity1Id As Guid, entityName2 As String, entity2Id As Guid, relationshipName As String, Optional batchId As Guid = Nothing, Optional bypassPluginExecution As Boolean = false) As Boolean

Parameters

serviceClient
ServiceClient

ServiceClient

entityName1
String

Entity on one side of the relationship

entity1Id
Guid

The Id of the record on the first side of the relationship

entityName2
String

Entity on the second side of the relationship

entity2Id
Guid

The Id of the record on the second side of the relationship

relationshipName
String

Relationship name between the 2 entities

batchId
Guid

Optional: if set to a valid GUID, generated by the Create Batch Request Method, will assigned the request to the batch for later execution, on fail, runs the request immediately

bypassPluginExecution
Boolean

Adds the bypass plugin behavior to this request. Note: this will only apply if the caller has the prvBypassPlugins permission to bypass plugins. If its attempted without the permission the request will fault.

Returns

true on success, false on fail

Applies to