Sunday, July 5, 2009

CAML query and Sharepoint Groups

Task list is one of the most commonly used list in sharepoint. But I think it is missing a view in which someone can filter what tasks are either directly assigned him or any of the Active Directory Group/SharePoint Group he belongs to.

After some digging into CAML , I got the right CAML query for getting me exactly the same thing.



<Membership Type="CurrentUserGroups">
<FieldRef Name="AssignedTo"/>
<FieldRef Name="AssignedTo"></FieldRef>
<Value Type="Integer">
<FieldRef Name="Status"/>
<FieldRef Name="Priority"/>


Anonymous,  November 30, 2010 at 6:16 PM  

This is a gem, Sandeep. Thank-you!

nICk December 3, 2010 at 1:08 AM  

Hey this works like a charm...But the only problem is, it does not show any items to the Site Collection Administrator or any user from the owners group as they are not a part of any group. Ideally items from all groups should be visible to the SCA. It would have been better had there been a provision for this as well!