R – SharePoint Lists.asmx: query returns “deleted” Calendar items

camlsharepointweb services

While running caml query's against the sharepoint list.asmx service, I have this strange behaviour that the GetListItems method also returns deleted items;

found item: test
found item: already done
found item: recurring
found item: recurring event 3-4
found item: Deleted: recurring event 3-4
found item: Deleted: recurring event 3-4
found item: Deleted: recurring event 3-4
found item: Deleted: recurring event 3-4
found item: Deleted: recurring event 3-4
found item: todays event 15-16 //<- NOT DELETED YET

How is this happening? Do I need to apply a special filter on the caml query or something? I'm currently querying as follows;

<Query>
  <OrderBy>
     <FieldRef Ascending='TRUE' Name='EventDate' />
  </OrderBy>
  <Where>
     <Eq>
        <FieldRef Name='EventDate' />
        <Value Type='DateTime'><Today /></Value>
     </Eq>
  </Where>
</Query>

What i've tried so far;
1. purge all the from the recycle bin
2. perform an iisreset on the sharepoint webserver

please note; im running in a VMWare Workstation environment.

Best Answer

Based on passed experience with Calendars, they have a very strange (but logical) way of dealing with recurring events. Two things first, calendars are fundamentally just a specialized list (as are all things in SP) with a fancy view control on it.

When an item is added to a calendar, a single item is added to the list. When a recurring event is added, SP does not add an infinite number of items on the list, it adds one special "recurring" item, as you noticed. Then if you remove some of the individual recurring events, (I.e. Weekly meeting, but it is cancelled next tuesday) SP adds a special 'removed event' item to the list. Those items aren't actually deleted in the sense that they exist and no longer exist, they are simply exceptions to the recurring event. So, they are filtered out when you view the calendar in list view, but they are 'real' individual SP List items on their own.

I hope that made sense.

Related Topic