Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Anyone know what a calendar item with an eventtype of 5 means? I think its to do with specific instances of a recurring event but am not sure and can't seem to find a definitive list anywhere that includes this particular one?

share|improve this question
add comment

2 Answers

I have seen this event type value when using the expand recurrence option in a CAML query. Each occurrence in the series, except series exceptions or deletions, will have an EventType value of 5.

Sample code:

SPList list = SPContext.Current.Web.Lists["Calendar"];
SPQuery query = new SPQuery();
query.ExpandRecurrence = true;
query.Query = string.Concat(
    "<Where>",
        "<DateRangesOverlap>",
            "<FieldRef Name=\"EventDate\"/>",
            "<FieldRef Name=\"EndDate\"/>",
            "<FieldRef Name=\"RecurrenceID\"/>",
            "<Value Type=\"DateTime\">[Today]</Value>",
        "</DateRangesOverlap>",
    "</Where>");
SPListItemCollection items = list.GetItems(query);
foreach (SPListItem item in items)
{
    // This value should be 5 for items that are expanded from a recurring series
    // and are not exceptions to the series.  Any exceptions to the series should
    // have an event type value of 4.
    int eventType = (int)item["EventType"];
}
share|improve this answer
add comment

Are you sure that the EventType is 5 and that this has been setup by SharePoint - rather than modifed by non OOTB code?

I've only ever see EventTypes of 0-4 as detailed here - and I've done a lot of work with recurring events.

If it showing 5 can you detail the recurrence pattern and any exceptions (deleted/modified) instances so that we can try to reproduce the problem.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.