Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

CamlQuery and Calendar Recurrence

$
0
0

I'm trying to pull events from a Calendar list using a CamlQuery using client OM. This is my query, pretty much pulled strait from the Calendar view:

<View RecurrenceRowset="TRUE">  <Query>    <Where>      <DateRangesOverlap>        <FieldRef Name="EventDate" />        <FieldRef Name="EndDate" />        <FieldRef Name="RecurrenceID" />        <Value Type="DateTime">          <Month />        </Value>      </DateRangesOverlap>    </Where>  </Query>  <ViewFields>    <FieldRef Name="EventDate" />    <FieldRef Name="EndDate" />    <FieldRef Name="fRecurrence" />    <FieldRef Name="EventType" />    <FieldRef Name="WorkspaceLink" />    <FieldRef Name="Title" />    <FieldRef Name="Location" />    <FieldRef Name="Description" />    <FieldRef Name="Workspace" />    <FieldRef Name="MasterSeriesItemID" />    <FieldRef Name="fAllDayEvent" />  </ViewFields></View>

And a snippet from the code that execute the query:

var query = new CamlQuery
{
    ViewXml = myViewXml
};
var retVal = list.GetItems(query);
context.Load(retVal, all => all.IncludeWithDefaultProperties(i => i.DisplayName));
context.ExecuteQuery();

The query executes and returns ALL items from the list. Also, it seems like recurring events are not expanded as there is just the one item returned with StartDate=SeriesStartDate and EndDate=SeriesEndDate.

Is expanding recurrence not supported in CamlQuery or is there something I'm missing? Also, how can I specify the 'CalendarDate' of the query in order to get items that overlap a month different from the current month? I've tried adding a 'CalendarDate' node with ISO8601 formatted DateTime value but this doesn't change the results of the query at all.


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>