3

Is there is any CAML quey to fetch all the recurring events from SharePoint 2010 Calendar List. i.e not for single year or month. Eusing the <DateRangeOverlap> CAML query we can get events of today, Month & year . but we need to get all the recurring events from the calendar list.

We tried the following CAML query to get recurrence events for a month:

var nextdate=yy+'-'+mm+'-'+dd+timeZone 

CAMLViewFields: "<ViewFields>" +
      "<FieldRef Name='ID' />"+
            "<FieldRef Name='Title' />" +
            "<FieldRef Name='EventDate' />" +
            "<FieldRef Name='EndDate' />" +
            "<FieldRef Name='Location' />" +
            "<FieldRef Name='Dept' />" +
            "<FieldRef Name='Description' />" +
            "<FieldRef Name='fRecurrence' />" +
            "<FieldRef Name='RecurrenceData' />" +
            "<FieldRef Name='fAllDayEvent' />" +
        "</ViewFields>",

CAMLQuery: "<Query>" +
                    "<Where>" +
                    "<DateRangesOverlap>" +
                            "<FieldRef Name='EventDate' />" +
                            "<FieldRef Name='EndDate' />" +
                            "<FieldRef Name='RecurrenceID' />" +
                            "<Value Type='DateTime'>" +
                                "<Month/>" +
                            "</Value>" +
                "</DateRangesOverlap>" +
                "</Where>" +
                "<OrderBy>" +
                        "<FieldRef Name='EventDate' />" +
                "</OrderBy>" +
                "</Query>",

CAMLQueryOptions: "<QueryOptions>" + 
             "<CalendarDate>"+nextdate+"</CalendarDate>" +
            "<RecurrencePatternXMLVersion>v3</RecurrencePatternXMLVersion>" +
            "<ExpandRecurrence>TRUE</ExpandRecurrence>" +
        "</QueryOptions>",       

If possible please share the code to get events between specific date(i.e from & to dates).

0
"<Query><Where><Eq><FieldRef Name='fRecurrence'/><Value Type='Boolean'>1</Value></Eq></Where></Query>"

EDIT: You'll also need to include the recurrence field in ViewFields:

CAMLViewFields: "<ViewFields><FieldRef Name='Title' /><FieldRef Name='fRecurrence' /></ViewFields>",

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.