Tuesday 13 April 2010

Use [Me] in CAML query when user is part of group

[Me] keyword does not work when user is part of a sharepoint group and that group is assigned to any item or list. Here is the way to make it work
<Where>
                <Or>
                                <Membership Type="CurrentUserGroups">
                                                <FieldRef Name="AssignedTo"/>
                                </Membership>
                <Eq>
                                <FieldRef Name='AssignedTo'/>
                                <Value Type='Integer'>
                                                <UserID Type='Integer'/>
                                </Value>
                </Eq>
                </Or>
</Where>

No comments:

Post a Comment