2

I'm using the SPServices GetListItems function to pull entries from a calendar list. All of the information is being retreived without any issues. However the RowLimit is not restricting the number of items being returned.

camlQuery = "<Query>"
                +"<CalendarDate>" + calendarDate + "</CalendarDate>
                +"<Where>"
                    +"<DateRangesOverlap>"
                        +"<FieldRef Name='EventDate' />"
                        +"<FieldRef Name='EndDate' />"
                        +"<FieldRef Name='RecurrenceID' />"
                        +"<Value Type='DateTime'>Month</Value>"
                    +"</DateRangesOverlap>"
                +"</Where>"
                +"<OrderBy>"
                    +"<FieldRef Name='EventDate' />"
                +"</OrderBy>"
                +"<RowLimit>6</RowLimit>"
            +"</Query>";
  • You need to make sure that the Web application associated with the site does not have a row limit more than what you expect. – Joseph D Surgeon Oct 8 '14 at 15:01
6

In the SPServices library, you just need to add an option like this in your GetListItems configuration:

CAMLRowLimit: 6

Marc then tacks this onto the appropriate place in the dynamically built CAML query to get your data.

13

Your <RowLimit> tag is inside <Query> tag which is wrong, it should be out side the <Query> and inside <View>.

Try below

camlQuery = "<View><Query><CalendarDate>" + calendarDate + "</CalendarDate><Where><DateRangesOverlap><FieldRef Name='EventDate' /><FieldRef Name='EndDate' /><FieldRef Name='RecurrenceID' /><Value Type='DateTime'>Month</Value></DateRangesOverlap></Where><OrderBy><FieldRef Name='EventDate' /></OrderBy></Query><RowLimit>6</RowLimit></View>";
1
SPQuery query = new SPQuery();
query.RowLimit = 10;
SPListItemCollection items = list.GetItems(query);
  • Love it when the simple answers work. – da_jokker Aug 19 '15 at 16:50
0

Can you try this CAMLRowLimit,

$(document).ready(function() {
    //alert("ASD");
    var idquery="<Query><OrderBy><FieldRef Name='ID' Ascending='False' /></OrderBy></Query>";
        $().SPServices({
        operation: "GetListItems",
        async: false,
        listName: "test",
        CAMLQuery: idquery,
        CAMLRowLimit: 1,
        completefunc: function (xData, Status) {
        $(xData.responseXML).SPFilterNode("z:row").each(function() {
        //alert($(this).attr("ows_Title"));
        var getvalue= parseInt($(this).attr("ows_Title"))+1;//Auto increment value
        $("input[title='TicketNumber']").val(getvalue);

    });
    }
    });


    <a href="http://peakfinders.blogspot.com/2015/10/how-to-get-id-of-last-inserted-row-in.html">more details</a>
  • 1
    Can you please add some description of your answer. Just code do not give a clue. – Asad Refai Oct 7 '15 at 11:41

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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