IOrganizationServiceDisassociate Method

 

Updated: November 29, 2016

Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online

Deletes a link between records.

Namespace:   Microsoft.Xrm.Sdk
Assembly:  Microsoft.Xrm.Sdk (in Microsoft.Xrm.Sdk.dll)

No code example is currently available or this language may not be supported.

Parameters

entityName
Type:

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

entityId
Type:

Type: Guid. The ID of the record from which the related records are disassociated.

relationship
Type:

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

relatedEntities
Type:

Type: EntityReferenceCollection. A collection of entity references (references to records) to be disassociated.

Message Availability

This message works regardless whether the caller is connected to the server or offline.

Privileges and Access Rights

To perform this action, the caller must have privileges on the entity that is specified in the entityName parameter and access rights on the records that are specified in the entityId and relatedEntities parameters. For a list of the required privileges, see Delete message privileges.

Notes for Callers

This method removes multiple associations in one transaction between the record that is specified by the entityId parameter and each record in the relatedEntities parameter for the relationship that is specified in the relationship parameter.

For a one-to-many relationship, this method clears the in the related record to the value of entityId.

For a many-to-many relationship, this method deletes a record in the intersect table for the relationship. The intersect table name is defined in the property for the relationship. You need this when you query for the records. However, you need the relationship name to set the property. This name is defined in the property for the relationship.

For more information about the exceptions that can be thrown when this method is called, see Handle exceptions in your code.

Supported Entities

You can use this method to disassociate any records that participate in a relationship, including records for custom entities.

The following example demonstrates how to use the Disassociate method to remove an association or link between records (early bound).

No code example is currently available or this language may not be supported.

The following example demonstrates how to use the Disassociate method to remove an association or link between records (late bound).

No code example is currently available or this language may not be supported.
Return to top

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright

Community Additions

ADD
Show: