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

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

问题描述

我想从定期会议工作区中的特定列表中获取所有项目.我尝试执行以下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 类具有属性 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]);
    }
}

花了很长时间才找到.网上可能没有太多关于此问题的信息,或者我没有选择正确的关键字,但无论如何应归功于

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天全站免登陆