Skip to content

Instantly share code, notes, and snippets.

@MitchMilam
Last active August 30, 2023 20:42
Show Gist options
  • Save MitchMilam/e0e8388971a81b023684 to your computer and use it in GitHub Desktop.
Save MitchMilam/e0e8388971a81b023684 to your computer and use it in GitHub Desktop.
IsTeamMember method for Dynamics CRM .Net developers
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