How to limit the Fetch results

Jan 31, 2014 at 11:48 AM
is it possible to limit the XrmServiceToolkit.Soap.Fetch() results like 'TOP number' in SQL.
I´ve tried to use "count='number'", but this gets totally ignored as far as I can see in Fiddler.
Here is the complete Fetch:
function getFetchResult(forYear)
    var myFetchXML = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false' count='1'>" +
                        "<entity name='account'>" +
                          "<attribute name='name' />" +
                          "<attribute name='accountid' />" +
                          "<attribute name='vfw_siegelnummer' />" +
                          "<attribute name='od4u_laufvariable' />" +
                          "<attribute name='od4u_jahresnummer' />" +
                          "<order attribute='od4u_laufvariable' descending='true' />" +
                          "<filter type='and'>" +
                            "<condition attribute='od4u_jahresnummer' operator='eq' value='" + forYear + "' />" +
                          "</filter>" +
                        "</entity>" +

    return XrmServiceToolkit.Soap.Fetch(myFetchXML);
Feb 5, 2014 at 4:00 PM
Hi There.

I do believe there is a way in general to limit the number of records by using page and count in the fetch. For example,

"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false' page='1' count='1'>"

However, the current version of the toolkit has modified the fetch method to allow user only put <entity name=....> to start by using the fetch. Therefore the content of the fetch statement has ben ignored except aggregate.

I am currently updating the toolkit to 2.0.1 and hopefully will have some better approach for the fetch method.

Feb 28, 2014 at 10:43 AM
Hi Jaimie,

First, thanks for your work and the quality of your development.

Do you know when the version 2.0.1 will be available ?

Best regards,
Mar 20, 2014 at 6:30 PM

Thanks for your support. :)

Current plan is the end of this month or in the middle of next month cause I am a bit busier with work and life at the moment.