0

I´m using SP CAML Query Helper Online fot getting all the elements of a recurrent event but it only get the general recurrent event. there is possible to get all the days of this recurrent event in differents elements.

Note: I only create the recurrent event, I did not edit any of this.

In Query tab i put the following:

<Query>
   <Where> 
      <DateRangesOverlap>
         <FieldRef Name="EventDate" />
         <FieldRef Name="EndDate" />
         <FieldRef Name="RecurrenceID" />
         <Value Type="DateTime" IncludeTimeValue="FALSE">
            <Year />
         </Value>
      </DateRangesOverlap>
   </Where>
</Query>

In View Fields tab:

<FieldRef Name="EventDate" />

<FieldRef Name="EndDate" />

<FieldRef Name="fRecurrence" />

<FieldRef Name="RecurrenceData" />

In View Attributes tab:

ExpandRecurrence="True"

1
  • In Which element do you need all the days of your recurrent event?
    – Hardik
    Jun 9 '16 at 17:58
0

Using below code you will get recurring events as distinct items using SPServices.

var startDate = "2012-05-12T12:00:00Z"; // Our example will show the month of May 2012

$().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "My Calendar",
    CAMLViewFields: "<ViewFields>" +
            "<FieldRef Name='Title' />" +
            "<FieldRef Name='EventDate' />" +
            "<FieldRef Name='EndDate' />" +
            "<FieldRef Name='Location' />" +
            "<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>" + startDate + "</CalendarDate>" +
            "<RecurrencePatternXMLVersion>v3</RecurrencePatternXMLVersion>" +
            "<ExpandRecurrence>TRUE</ExpandRecurrence>" +
        "</QueryOptions>",
    completefunc: function (xData, Status) {
        $(xData.responseXML).SPFilterNode("z:row").each(function() {
            var $node = $(this),
                fADE = $node.attr("ows_fAllDayEvent") || 0,
                thisADE = (fADE == 0),
                thisID = $node.attr("ows_ID"),
                sepID = thisID.indexOf(';#'),
                thisTitle = $node.attr("ows_Title"),
                thisRecurrence = $node.attr("ows_fRecurrence"),
                thisDesc = $node.attr("ows_Description");
            if (sepID != -1) thisID = thisID.substring(0,sepID);
            var thisUrl = "DispForm.aspx?ID=" + thisID,
                thisClass = thisTitle.replace(" ","").substr(0,10).replace(",","").replace(" ","") + thisID,
                thisRD = $node.attr("ows_RecurrenceData");                                                        

            // if working with FullCalendar or building an events object for another purpose...
            events.push({
                title: thisTitle,
                start: $node.attr("ows_EventDate"),
                end: $node.attr("ows_EndDate"),
                allDay: thisADE,
                url: thisUrl,
                description: $(thisDesc).text()
            });
        });
    }
})

Please refer the below link for more information.

Use SPServices to Get Recurring Events as Distinct Items

4
  • But is there any way to do the query with SP CAML Query Helper Online? Jun 10 '16 at 12:30
  • Please use this tool to build the query...spcamlqueryhelper.codeplex.com
    – Hardik
    Jun 10 '16 at 12:35
  • Have you got it working for you?
    – Hardik
    Jun 10 '16 at 16:48
  • This is the tool that I am making reference Jun 13 '16 at 1:49

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.