Tested on: CRM 2015
In this problem, I want to add invigilators for the Exam Activity. There is Many to Many relation between Activity & Invigilators.
Here is the snapshot of relationship in CRM 2015
AssociateRequest request = new AssociateRequest{
Target = new EntityReference( "cms_courseactivity", CourseActivityGUID),
RelatedEntities = new EntityReferenceCollection {
new EntityReference("cms_invigilator",InvigilatorGuid)
},
Relationship = new Relationship("cms_cms_invigilator_cms_courseactivity")
};
GetCRMServices._service.Execute(request);