The Membership element allows you to basically check to see if the AssignedTo field is assigned to any group which the current user is a member of.
Of course, you still need to use it in conjunction with a standard FieldRef check against the user's ID (which you can get using the <UserID/> element.
Below is the CAML query to return All Tasks Assigned to the Current User, including specific assignments, and where the task is assigned to a group that contains the current user (both AD Groups and SharePoint Groups).
I suppose theoretically this should also work with groups in custom Membership Providers .. but haven't tried it.
<Where>
<Or>
<Eq>
<FieldRef ID='Assigned To' />
<Value Type='Integer'><UserID/></Value>
</Eq>
<Membership Type='CurrentUserGroups'>
<FieldRef Name='AssignedTo' />
</Membership>";
</Or>
</Where>
Nice. Very useful nugget of knowledge.
ReplyDeletereally helped me out!
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteHi Hatch
ReplyDeleteI want check the current login user in the particular group. As i am not storing any values for current login users in the list.