Mscrm C# code for associate and disassociate:
#region Associate
AssociateRequest associatePracticeGroup = new AssociateRequest
{
Target = new EntityReference("lrl_practicegroup", practiceGroupId),
RelatedEntities = new EntityReferenceCollection
{
new EntityReference("account", parentAccountId)
},
Relationship = new Relationship("lrl_lrl_practicegroup_account")
};
// Execute the request.
service.Execute(associatePracticeGrou
#endregion
#region DisAssociate
DisassociateRequest disassociatePracticeGroup = new DisassociateRequest
{
Target = new EntityReference("lrl_practicegroup", practiceGroupId),
RelatedEntities = new EntityReferenceCollection
{
new EntityReference("account", parentAccountId)
},
Relationship = new Relationship("lrl_lrl_practicegroup_account")
};
// Execute the request.
service.Execute(disassociatePracticeGroup);
#endregion
No comments:
Post a Comment