web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :

CRM 2011/ 2013 Add Security Role to Team Programmatically C#

Aileen Gusni Profile Picture Aileen Gusni 44,524
To assign security to a Team in CRM 2011 or CRM 2013, you can use this code:
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!

This was originally posted here.

Comments

*This post is locked for comments