FetchXML next page results

非 Y 不嫁゛ 提交于 2019-12-12 03:24:15

问题


I want to populate a grid with data from Dynamics CRM. I use fetchXML, to get for each page 10 records. I want to get to the next page, to retrieve the next 10 records. But this isn't happening, I'm using XRMToolbox to simulate the fetch query but it returns me the same results, regardless of the page attribute value.

The fetchXML query is:

<fetch version="1.0" output-format="xml-platform" mapping="logical" count="10" page="1" aggregate="true" distinct="false" >
    <entity name="webpage" >
        <attribute name="url" groupby="true" alias="url" />
        <attribute name="webpageid" aggregate="count" alias="top" />
        <order descending="true" alias="top" />
    </entity>
</fetch>

If I change the page attribute value, say to 10 the response won't be different. Can anyone help me with this?

UPDATE

After many tests with XRMToolbox I've come to conclusion that this query won't listen, whatever page I provide to it. This is because of the aggregate attribute. If I remove it and of course remove the count aggregate, then changing the page attribute will actually fetch for me the next page results.

So in summary page attribute doesn't like the aggregate attribute. Maybe this can work with paging cookies, but I haven't tested it yet, I will test it and update this post.


回答1:


To implement paging you need to use not only page number/records per page attributes but paging cookie as well. This msdn article provides all code you need to implement paging.



来源:https://stackoverflow.com/questions/33088942/fetchxml-next-page-results

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!