Am using the following fetchxml for retrieve the user based on team Id.
<fetch version = '1.0' output-format='xml-platform' mapping='logical' distinct='true' >
<entity name = 'systemuser' >
<attribute name='systemuserid' />
<order descending = 'false' attribute='fullname' />
<link-entity name = 'teammembership' intersect='true' visible='false' to='systemuserid' from='systemuserid' >
<link-entity name = 'team' to='teamid' from='teamid' alias='ab' >
<filter type = 'and' >
<condition attribute='teamid' operator='eq' uitype='team' value = '" + teamId + @"' />
</filter>
</link-entity>
</link-entity>
</entity>
</fetch>
But I need to check the user whether leave on today or not.if the user is leave means we need to exclude and return the remaining users.
The user will apply leave in crm security->users->Workhours->timeoff
If the user was set today timeoff then we need to exclude from the fetchxml result.