在会议工作区以编程方式从列表中获取所有议程项目 [英] In a meeting workspace get all agenda items from a list programmatically

查看:37
本文介绍了在会议工作区以编程方式从列表中获取所有议程项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

推荐答案

Yeehaaw!

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

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.

哦,别忘了

using Microsoft.SharePoint.Meetings;

或者您可以省略使用 SPMeeting.SPecialInstance,但直接使用从 -3 到 0 的整数

Or you can ommit using SPMeeting.SPecialInstance, but use integeres directly from -3 to 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]);
    }
}

找了好久才找到.可能没有太多关于这个问题的网络信息,或者我没有选择正确的关键字,但无论如何都要归功于 this 获得关键字第一名的来源获取所有列表项共享点工作区重复".

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.

这篇关于在会议工作区以编程方式从列表中获取所有议程项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆