public void AddSecurityRoletoTeam(IOrganizationService service, Guid securityRoleId, Guid teamId) { service.Associate(Team.EntityLogicalName, teamId, new Relationship("teamroles_association"), new EntityReferenceCollection() { new EntityReference(Role.EntityLogicalName, securityRoleId) }); }
*Both Team and Security Role should be in the same Business Unit
Hope it helps!
very useful information, the post shared was very nice.
ReplyDeleteMicrosoft Dynamics AX Online Training
Thank you for providing.
ReplyDeleteD365 Finance and Operations Online Training