I have a custom list definition where I have defined a view with BaseViewID = 1 (AllItems.aspx)

  <View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">
    <Toolbar Type="Standard" />
    <XslLink Default="TRUE">main.xsl</XslLink>
    <RowLimit Paged="TRUE">30</RowLimit>
      <FieldRef Name="Attachments"></FieldRef>
      <FieldRef Name="LinkTitle"></FieldRef>
      <FieldRef Name="Field1"></FieldRef>
      <FieldRef Name="Field2"></FieldRef>
      <FieldRef Name="Field3"></FieldRef>
        <FieldRef Name="ID"></FieldRef>
      <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
      <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />

I would like to customize this view by adding a query element. The query must return only items posted by users belonging to the group of the current user.

For example: user1 and user 2 are part of Group A while user 3 is part of Group B. If every user add an item both user1 and user 2 see two items while user3 only see one item.

Is it possible to define a query to achieve this result? if not, what are the options I can investigate?

Thanks very much


I have followed the steps described in this post but unfortunately does not work

  • Reread your question, and realized I misunderstood it the first time. My answer will not work. I believe something custom will need to be done. Are you able to use custom solutions? – wjervis Jul 2 '14 at 14:17
  • Yes. It depends what do you mean by custom solution. Actually I have a Visual studio project which create a WSP. I also have a custom list definition inside a custom site definition – Lorenzo Jul 2 '14 at 14:32
  • You can do a less code intensive solution, creating a view per group, using the <Membership> element in CAML. Or you can do an App (or wsp, if you don't mind using deprecated solutions). – wjervis Jul 2 '14 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.