I have a task to create a custom grid view of users not in a specific team. I created the fetch according to team (entity) not equal to my specific team but I didn't get the wanted results after recheck I changed it from team to Queue and still no good results, is there an option to get the needed results using Fetch
In Dynamics 2016 you cannot do this using FetchXml.
In Dynamics 365 this is possible. It would look like this:
<fetch attribute="teamid" operator="eq" value="00000000-0000-0000-0000-000000000000" >
<entity name="systemuser" >
<attribute name="fullname" />
<filter>
<condition entityname="teammembership" attribute="teamid" operator="null" />
</filter>
<link-entity name="teammembership" from="systemuserid" to="systemuserid" link-type="outer" >
<attribute name="teamid" />
<filter>
<condition attribute="teamid" operator="eq" value="4212a8d9-4893-eb11-b1ac-000d3adb2ab1" />
</filter>
</link-entity>
</entity>
</fetch>
The condition doing the trick here is <condition entityname="teammembership" attribute="teamid" operator="null" />
, where you specify the entity that is the right part in the left outer join.
As said, you cannot do this in Dynamics 2016, so you have no other option than executing the query above without its first filter and do the filtering on the resultset returned by the query.