Notifications
Announcements
No record found.
Hi Guys,
Our project now has a requirement that need to retrieve security roles for a team, but I didn't find a existing method of Microsoft to implement this function. Do you know how to retrieve all of security roles of a team using C#. Thanks a lot.
Thanks,
Stone
Hi,
You can use this fetchXml to retrieve security roles for a team.
Similarly, with C# code using a Query Expression:
// Define Condition Values (YOUR TEAM ID) var QErole_teamroles_teamid = "6b8ae021-c966-eb11-a812-000d3a3b6b72"; // Instantiate QueryExpression QErole var QErole = new QueryExpression("role"); // Add all columns to QErole.ColumnSet QErole.ColumnSet.AllColumns = true; // Add link-entity QErole_teamroles var QErole_teamroles = QErole.AddLink("teamroles", "roleid", "roleid"); // Define filter QErole_teamroles.LinkCriteria QErole_teamroles.LinkCriteria.AddCondition("teamid", ConditionOperator.Equal, QErole_teamroles_teamid); var roles = service.RetrieveMultiple(QErole); foreach (var role in roles.Entities) { //Your Logic }
Hi Amri,
This is a good idea, thanks.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 170 Super User 2025 Season 2
#ManoVerse 61
Gerardo RenterÃa Ga... 52 Most Valuable Professional