Hi,
I want to deploy a Pre or Post Create plugin on the entity team.
The plugin must assign a role to the team.
I tried :
collectionReference.Add(new EntityReference("role", idRole));
_service.Associate(team.LogicalName, team.Id, new Relationship("teamroles_association"), collectionReference);
but i am getting a "Generic SQL Error"
I also tried to directly create the N:N association entity with :
Entity teamrole = new Entity();
teamrole.LogicalName = "teamroles";
teamrole["teamid"] = new EntityReference("team", team.Id);
teamrole["roleid"] = new EntityReference("role", idRole);
_service.Create(teamrole);
But then i get a The 'Create' method does not support entities of type 'teamroles'
Is there a way to assign the role at the creation of the team?
Thanks in advance