javascriptjquerydynamics-crm-2013xrmservicetoolkit

XrmSvcToolkit issue fetch only max of 5000 records


Hey can anyone help me out, I am using fetch xml to retrieve data , but the result show only 5000 , but I have got 17000 records . How can I retrieve all the records

var fetchXml =
          '<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" >' +
         '<entity name="account">' +
         '<all-attributes/>' +

         '</entity>' +
         '</fetch>';
                var retrievedate = XrmSvcToolkit.fetch({
            fetchXml: fetchXml,
            async: false,
            successCallback: function (result) {


               return result;

            },
            errorCallback: function (error) {
                throw error;
            }
        });

Solution

  • The XrmServiceToolkit Project (found here) provides a way to retrieve all the pages of a fetch query. See the sample below. This project is more active, so I would recommend using it over XrmSvcToolkit.

    XrmServiceToolkit.Soap.Fetch(fetchXml, true, function(result){ return result});
    

    The second parameter is the "fetchAll" parameter, which allows you to get the paged results of the query