In the workspace of the meeting, all program items from the list are programmatically

I want to get all the items from a specific list in the repeating workspace of the meeting. I tried to execute the following CAML:

<Query>
   <Where>
      <IsNotNull>
         <FieldRef Name='ID' />
      </IsNotNull>
   </Where>
</Query>

But it only displays data for the upcoming meeting.

However, when I open the list, from the action menu I can choose to display data from all collections. It makes me think it is possible. I know that I can convert the list to series items so that they appear in all meetings, but that’s not what I want.

+3
source share
2 answers

Yeehaaw!

, ! SPQuery MeetingInstanceId, (, 20090615 15 2009 .) , SPMeeting.SpecialInstance enum ( int).

, , .

,

using Microsoft.SharePoint.Meetings;

SPMeeting.SPecialInstance, -3 0

:

using(SPSite site = new SPSite(<enter your workspace url>))
using (SPWeb web = site.OpenWeb())
{              
    SPQuery query = new SPQuery();
    query.MeetingInstanceId = (int)SPMeeting.SpecialInstance.AllButSeries;
    query.Query = @"<Query>
                       <Where>
                          <IsNotNull>
                             <FieldRef Name='ID' />
                          </IsNotNull>
                       </Where>
                    </Query>";

    SPList list = web.Lists[<enter your list>];
    foreach (SPListItem item in list.GetItems(query))
    {
        Console.WriteLine(item[item.Fields.GetFieldByInternalName("Title").Id]);
    }
}

. , , , " sharepoint ".

, .

+5

, , .

, CAML, . " " ( " ", ) , SPQuery.ExpandRecurrence "true".

0

Source: https://habr.com/ru/post/1709966/


All Articles