Last active
August 30, 2023 20:42
-
-
Save MitchMilam/e0e8388971a81b023684 to your computer and use it in GitHub Desktop.
IsTeamMember method for Dynamics CRM .Net developers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static bool IsTeamMember(IOrganizationService service, Guid userId, Guid teamId) | |
{ | |
var request = new RetrieveTeamsSystemUserRequest | |
{ | |
EntityId = userId, | |
ColumnSet = new ColumnSet() | |
}; | |
var response = (RetrieveTeamsSystemUserResponse)service.Execute(request); | |
return response.EntityCollection.Entities.Any(entity => entity.Id == teamId); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment