FetchXML下一页结果 [英] FetchXML next page results

查看:327
本文介绍了FetchXML下一页结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用Dynamics CRM中的数据填充网格。我使用fetchXML,为每个页面获取10条记录。我想转到下一页,以检索下10条记录。但这并没有发生,我使用XRMToolbox模拟获取查询,但是无论页面属性值如何,它都会返回相同的结果。

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.

fetchXML查询是:

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>

如果我更改了页面属性值,则将响应设为10。
有人可以帮我吗?

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

更新

之后通过XRMToolbox进行的许多测试,我得出的结论是,无论我提供给它什么页面,该查询都不会监听。这是因为有aggregate属性。如果我删除了它,当然也删除了计数总数,那么更改page属性实际上将为我获取下一个页面结果。

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.

因此,summary page属性不会就像聚合属性一样。也许这可以用于分页Cookie,但我尚未对其进行测试,我将对其进行测试并更新此文章。

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.

推荐答案

要实现分页,您不仅需要使用每页属性的页码/记录,还需要使用分页cookie。 这篇msdn文章提供了实现分页所需的所有代码。

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.

这篇关于FetchXML下一页结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆