use*_*388 5 sharepoint recurring-events sharepoint-online sharepoint-webservice
注意:此问题与现有未解决的问题( SharePoint重复日历事件的CAML OrderBy)相似。
如何使用Lists.asmx Web服务检索今天或以后发生的重复发生的事件?
<CalendarDate>2019-06-25T15:55:04.108Z</CalendarDate>在将请求发送到/_vti_bin/Lists.asmxWeb服务时,我提供了参数,但是我仍然收到过去的事件(如下面的屏幕快照所示)!
这是XML响应(屏幕截图)。请注意,即使将“ CalendarDate”指定为“ 2019-06-25” ,活动日期仍在今天之前:
这是与请求一起发送的XML有效负载:
<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
<soap:Body>
<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>
<listName>{ my list GUID }</listName>
<query>
<Query>
<OrderBy>
<FieldRef Ascending='TRUE' Name='EventDate' />
</OrderBy>
<Where>
<And>
<Eq>
<FieldRef Name="fRecurrence" />
<Value Type="Boolean">1</Value>
</Eq>
<DateRangesOverlap>
<FieldRef Name="EventDate" />
<FieldRef Name="EndDate" />
<FieldRef Name="RecurrenceID" />
<Value Type='DateTime'>
<Year/>
</Value>
</DateRangesOverlap>
</And>
</Where>
</Query>
</query>
<viewFields>
<ViewFields>
<FieldRef Name="Category" />
<FieldRef Name="Location" />
</ViewFields>
</viewFields>
<queryOptions>
<QueryOptions>
<ViewAttributes Scope="RecursiveAll" />
<RecurrencePatternXMLVersion>v3</RecurrencePatternXMLVersion>
<DateInUtc>TRUE</DateInUtc>
<ExpandRecurrence>TRUE</ExpandRecurrence>
<CalendarDate>2019-06-25T15:55:04.108Z</CalendarDate>
<RecurrenceOrderBy>TRUE</RecurrenceOrderBy>
</QueryOptions>
</queryOptions>
<rowLimit>20</rowLimit>
</GetListItems>
</soap:Body>
</soap:Envelope>
Run Code Online (Sandbox Code Playgroud)
编辑:以下是上面的查询未返回的事件的示例。
Year不尊重该CalendarDate属性 - 它返回当前日期一年内发生的先前事件和当前日期一年内发生的未来事件。
使用<Value Type='DateTime'><Now /></Value>inDateRangesOverlap并删除CalendarDate来检索今天或以后发生的重复事件
| 归档时间: |
|
| 查看次数: |
61 次 |
| 最近记录: |