为什么 fetchXml 计数属性不限制返回的记录?

发布于 2024-12-13 06:10:53 字数 1284 浏览 0 评论 0原文

我有一个 javascript 函数,它使用 fetchXML 将自定义视图添加到控件中。我的问题是根 节点上的 count 属性不起作用。我将其设置为 6,但它返回 26 条记录(所有记录),由 fetch 定义。

这是 fetchXML

<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false' count='6'>
  <entity name='xyz_entity'>
    <attribute name='xyz_entityname' />
    <attribute name='xyz_startdate' />
    <attribute name='xyz_enddate' />
    <attribute name='xyz_currententity' />
    <attribute name='xyz_inactiveentity' />
    <order attribute='xyz_currententity' descending='true' />
    <order attribute='xyz_startdate' />
    <filter type='or'>
      <condition attribute='xyz_currententity' operator='eq' value='1' />
      <filter type='and'>
        <condition attribute='xyz_startdate' operator='ge' value='2011-11-01' />
        <condition attribute='xyz_enddate' operator='gt' value='2011-11-01' />
      </filter>
    </filter>
  </entity>
</fetch>

fetchXML 在 javscript 中的使用如下:

Xrm.Page.getControl("itt_termid").addCustomView(viewId, entityName, viewDisplayName, fetchXml, layoutXml, true);

但是当用户单击查找图标时,将返回所有 26 条记录,而不是 6 条记录。

I have a javascript function that adds a custom view to a control using fetchXML. My issue is that the count attribute on the root <fetch> node is not working. I have it set to 6, but it's returning 26 records (all of the records), defined by the fetch.

Here is the fetchXML

<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false' count='6'>
  <entity name='xyz_entity'>
    <attribute name='xyz_entityname' />
    <attribute name='xyz_startdate' />
    <attribute name='xyz_enddate' />
    <attribute name='xyz_currententity' />
    <attribute name='xyz_inactiveentity' />
    <order attribute='xyz_currententity' descending='true' />
    <order attribute='xyz_startdate' />
    <filter type='or'>
      <condition attribute='xyz_currententity' operator='eq' value='1' />
      <filter type='and'>
        <condition attribute='xyz_startdate' operator='ge' value='2011-11-01' />
        <condition attribute='xyz_enddate' operator='gt' value='2011-11-01' />
      </filter>
    </filter>
  </entity>
</fetch>

And the fetchXML is being used in the javscript like this:

Xrm.Page.getControl("itt_termid").addCustomView(viewId, entityName, viewDisplayName, fetchXml, layoutXml, true);

but when the user clicks on the lookup icon, all 26, rather than 6 records get returned.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

云醉月微眠 2024-12-20 06:10:53

您是否尝试过明确指定页码(如 1)?

像这样的东西

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

Have you tried explicitly specifying the page number (as 1) ?

Something like

<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'     page='1' count='6'>
夏了南城 2024-12-20 06:10:53

这似乎是 CRM 2011 的自定义视图中的错误。它也不支持此页面引用的排序依据:http://social.microsoft.com/Forums/en/crmdevelopment/thread/81537133-b3a7-457b-a257-b745b30ca98e

This appears to be a bug in the Custom Views for CRM 2011. It also doesn't support order by as referenced by this page: http://social.microsoft.com/Forums/en/crmdevelopment/thread/81537133-b3a7-457b-a257-b745b30ca98e

友谊不毕业 2024-12-20 06:10:53

用户可以指定他们想要每页显示多少条记录,并且由于控件必须自己进行分页,我的猜测是它会用自己的计数替换您的计数。如果您在查找视图的上下文之外运行此提取,它是否正确限制了计数?

Users can specify how many records they want to appear per page, and since the control has to do paging of its own, my guess would be that it's replacing your count with its own. If you run this fetch outside of the context of a lookup view, does it correctly limit the count?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文