views:

1061

answers:

2

Hello All,

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.

+2  A: 

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.

It makes sense! Can I filter on those? How can I determine if i'm holding an instance or an exception?
Frenske
You can filter on them, but I forget how. I'd suggest that you use the object model to get all the SPListItem objects in the list, then iterate through their fields until you find the one that indicates they are an 'exception' item. Sorry I can't be more help.
A: 

@DevinB - Interesting. We just had a client delete an instance of a recurring item in an Events Calendar. It's gone from the series of events, but not in the recycle bin. Since you mention that SP doesn't actually delete them... what's a best practice to recover the "removed event"...

?

Robin Majumdar
You should better post this as a new question, not as an answer... The "Ask Question" button is in the top right. Also, more people will look at it and try to answer if you start a new question.
sth