问题
My post is a continue of Expand Recurring Events from a Sharepoint Calendar over WebServices?
The problem is that expanding works while view fields query is null or empty. But since I set up some fields, the response doesn't match expectations.
The Lists.asmx service method,that I use, is
public System.Xml.XmlNode GetListItems(string listName, string viewName, System.Xml.XmlNode query, System.Xml.XmlNode viewFields, string rowLimit, System.Xml.XmlNode queryOptions, string webID)
When I use a viewFields value, presented below, the method doesn't expand recurrence events:
var viewFields = new XmlDocument();
viewFields.LoadXml(@"
<ViewFields>
<FieldRef Name='ID' />
<FieldRef Name='Title' />
</ViewFields>");
What's wrong with a viewFields?
回答1:
The problem is that view fields should contain additional fields EventDate, EndDate, fRecurrence and RecurrenceData. When this items absent, expanding doesn't work. So, if you want to retrieve a Category (for example), you should use the following ViewFields query:
<ViewFields>
<FieldRef Name='EventDate' />
<FieldRef Name='EndDate' />
<FieldRef Name='fRecurrence ' />
<FieldRef Name='RecurrenceData' />
<FieldRef Name='Category' />
</ViewFields>
来源:https://stackoverflow.com/questions/12108589/expanding-of-recurring-events-from-a-sharepoint-calendar-doesnt-work-for-a-view