获取SharePoint日历项RecurrenceData

时间:2017-06-12 18:25:20

标签: sharepoint sharepoint-2013 caml

当我查询我的SharePoint 2013日历列表项时,我得到了我的事件,但对于RecurrenceData项,该值只是说V3RecurrencePattern。

如何获取已设置的实际模式?我不希望获得该项目的每个实例。我真的只想要重复数据。

1 个答案:

答案 0 :(得分:0)

您需要<DateRangesOverlap>

试试这个

SPQuery query = new SPQuery();
string queryString =
@"
    <Where>
        <DateRangesOverlap>
        <FieldRef Name=""EventDate""/>
        <FieldRef Name=""EndDate""/>
        <FieldRef Name=""RecurrenceID""/>
        <Value IncludeTimeValue=""TRUE"" Type=""DateTime"">
        <Now/>
        </Value>
        </DateRangesOverlap>
    </Where>
    <OrderBy>          
    <FieldRef Name=""EventDate"" Ascending=""TRUE""/>      
    </OrderBy>
";
query.Query = queryString;
query.ExpandRecurrence = true;

参考http://sharepointchan.blogspot.hr/2011/10/situation-i-want-to-get-all-calendar.html