Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I retrieve just recurring event masters using Exchange Web services?

I'm using a CalendarItemType view to retrieve calendar items. The only items I care about are those that I've created and I know that they are all weekly recurring items. I'm able to get each individual occurrence and, from any one of them the recurring master item, but I'd like to narrow the scope of my search to just those items that would match my pattern.

I've trying using the Restriction property on the FindItemType to specify a NotEqualTo restriction with a null constant for calenderRecurrenceId. This caused my request to time out. So far I've been unable to load the recurrences with the FindItemType at all and need to use a subsequent GetItemType call when I find an event that is an occurence in a recurring series.

Here's the code that I'm starting with. The code needs to work with both Exchange 2007 and Exchange 2010.

    var findItemRequest = new FindItemType();

    findItemRequest.ParentFolderIds = new DistinguishedFolderIdType[]
    {
        new DistinguishedFolderIdType()
    };

    ((DistinguishedFolderIdType)findItemequest.ParentFolderIds[0]).Id = DistinguishedFolderIdNameType.calendar;
    findItemRequest.Traversal = ItemQueryTraversalType.Shallow;

    var itemShapeDefinition = new ItemResponseShapeType(
    {
        BaseShape = DefaultShapeNamesType.AllProperties;
    }

    findItemRequest.Item = calenderView;
    findItemRequest.ItemShape = itemShapeDefinition;

    var findItemResponse = this.esb.FindItem( findItemRequest );

Also, if you know of any good source of examples (beyond the ones in MSDN), I'd welcome them. I'm picking up someone else's code in an emergency and trying to learn Exchange Web Services on the fly.

like image 801
tvanfosson Avatar asked Aug 21 '10 02:08

tvanfosson


1 Answers

Maybe I'm misunderstanding you, in which case I apologize.

You do NOT use the CalendarView - you use the normal IndexedPageItemView if all you want is Master Recurring Calendar items.

You use the CalendarView to expand the recurrences to individual items. However the compromise with CalendarView is NO restrictions are permitted besides Start and End Date. None.

like image 138
MJB Avatar answered Oct 22 '22 21:10

MJB