OrganizationService.Disassociate Method (String, Guid, Relationship, EntityReferenceCollection)
Applies To: Dynamics CRM 2013
Deletes a link between records. (Developer Extensions)
Namespace: Microsoft.Xrm.Client.Services
Assembly: Microsoft.Xrm.Client (in Microsoft.Xrm.Client.dll)
Syntax
public virtual void Disassociate(
string entityName,
Guid entityId,
Relationship relationship,
EntityReferenceCollection relatedEntities
)
public:
virtual void Disassociate(
String^ entityName,
Guid entityId,
Relationship^ relationship,
EntityReferenceCollection^ relatedEntities
)
abstract Disassociate :
entityName:string *
entityId:Guid *
relationship:Relationship *
relatedEntities:EntityReferenceCollection -> unit
override Disassociate :
entityName:string *
entityId:Guid *
relationship:Relationship *
relatedEntities:EntityReferenceCollection -> unit
Public Overridable Sub Disassociate (
entityName As String,
entityId As Guid,
relationship As Relationship,
relatedEntities As EntityReferenceCollection
)
Parameters
entityName
Type: System.StringType: String. The logical name of the entity that is specified in the entityId parameter.
entityId
Type: System.GuidType: Guid. The ID of the record from which the related records are disassociated.
relationship
Type: Microsoft.Xrm.Sdk.RelationshipType: Relationship. The name of the relationship to be used to remove the link.
relatedEntities
Type: Microsoft.Xrm.Sdk.EntityReferenceCollectionType: EntityReferenceCollection. A collection of entity references (references to records) to be disassociated.
Implements
IOrganizationService.Disassociate(String, Guid, Relationship, EntityReferenceCollection)
Remarks
This is a wrapper for the IOrganizationService. Disassociate Method.
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 ReferencingAttribute 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 IntersectEntityName 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.
See Also
OrganizationService Class
Microsoft.Xrm.Client.Services Namespace
Access entity relationships (Dynamics CRM 2013)
Developer extensions context object model (Dynamics CRM 2013)
Developer extensions for Microsoft Dynamics CRM 2013
Return to top