在会议工作区中以编程方式从列表中获取所有议程项目

发布于 2024-07-23 05:14:10 字数 347 浏览 2 评论 0原文

我想从定期会议工作区的特定列表中获取所有项目。 我尝试执行以下 CAML:

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

但它仅显示即将举行的会议的数据。

但是,当我打开列表时,从操作菜单中我可以选择显示所有会议的数据。 这让我认为这是可能的。 我知道我可以将列表转换为系列项目,以便它们出现在所有会议中,但这不是我想要的。

I want to get all items from a specific list in recurring meeting workspace. 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 list, from actions menu I can choose to display data from all meetings. That makes me think it is possible. I know I can convert the list to series items so they appear in all meetings, but it is not that I want.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

烏雲後面有陽光 2024-07-30 05:14:10

耶哈!

终于我找到了解决方案! SPQuery 类有一个属性 MeetingInstanceId,您可以为其分配特定 InstanceID 的值(例如 20090615 表示 2009 年 6 月 15 日的项目),或者要查询所有项目,您必须分配该值SPMeeting.SpecialInstance 枚举值 (不要忘记将其转换为 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]);
    }
}

花了很多时间才找到。 对于这个问题,网上可能没有太多信息,或者我没有选择正确的关键字,但无论如何都要归功于 来源用于获取关键字“获取所有列表项共享点”的第一个位置工作空间重复出现”。

我希望这对其他人有帮助。

Yeehaaw!

Finally I found a solution! SPQuery class has a property MeetingInstanceId, which one you can assign a value of a specific InstanceID (for example 20090615 for 15 June 2009 items) or to query all items you must assign it SPMeeting.SpecialInstance enum value (don't forget to cast it to int).

Then you just execute your query to get items from whatever workspace you want.

Oh, and don't forget

using Microsoft.SharePoint.Meetings;

Or you can ommit using SPMeeting.SPecialInstance, but use integeres directly from -3 to 0

Sample code:

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]);
    }
}

It took so much time for this to find. Probably not too much info on the net for this issue or I didn't choose the right keywords, but anyway credit to this source for getting in the first place for keywords "get all list items sharepoint workspace recurring".

I hope this helps others.

情何以堪。 2024-07-30 05:14:10

我认为列表的默认视图仅显示即将到来的会议列表项,而不显示过去的会议列表项。

如果您未指定运行 CAML 查询的视图,它将检索默认视图中的所有项目。 使用“所有项目”视图(如果是日历则为“所有事件”视图)而不是默认视图,并将 SPQuery.ExpandRecurrence 属性设置为 true。

I think the default view of the list displays only the upcoming meeting list items, and not the meeting list items in the past.

If you don't specify the view on which you run your CAML query, it will retrieve all the items from the default view. Use the All Items view (All Events view if it is a calendar) instead of the default view, also set the SPQuery.ExpandRecurrence property to true.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文