This documentation is archived and is not being maintained.

DisassociateEntities Message (CrmService)

Dynamics
banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

Works for all deployment typesWorks online and offline

Removes a link between two entity instances in a many to many relationship.

The relevant classes are specified in the following table.

TypeClass
RequestDisassociateEntities
ResponseDisassociateEntities
EntityAny two entities that participate in a many tomany relationship

Remarks

To use this message, pass an instance of the DisassociateEntities class as the request parameter in the Execute method.

To perform this action, the caller must have access rights on the entity instances. For a list of required privileges, see DisassociateEntities Privileges.

Example

[C#]
// Set up the CRM Service.
CrmAuthenticationToken token = new CrmAuthenticationToken();
// You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.
token.AuthenticationType = 0; 
token.OrganizationName = "AdventureWorksCycle";
 
CrmService service = new CrmService();
service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Create a request.
DisassociateEntitiesRequest request = new DisassociateEntitiesRequest();

// Assign the request a moniker for both entities that need to be disassociated.
request.Moniker1 = new Moniker();
request.Moniker1.Id = new Guid("B050F053-6968-DC11-BB3A-0003FFBAD37A");
request.Moniker1.Name = EntityName.lead.ToString();

request.Moniker2 = new Moniker();
request.Moniker2.Id = new Guid("1DCDEE97-35BB-44BE-8353-58BC36592656");
request.Moniker2.Name = EntityName.contact.ToString();

// Set the relationship name that associates the two entities.
request.RelationshipName = "contactleads_association";

// Execute the request.
DisassociateEntitiesResponse response = (DisassociateEntitiesResponse)service.Execute(request);

See Also

Concepts

Reference


© 2010 Microsoft Corporation. All rights reserved.


Show: