为什么 fetchXml 计数属性不限制返回的记录?
我有一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否尝试过明确指定页码(如 1)?
像这样的东西
Have you tried explicitly specifying the page number (as 1) ?
Something like
这似乎是 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
用户可以指定他们想要每页显示多少条记录,并且由于控件必须自己进行分页,我的猜测是它会用自己的计数替换您的计数。如果您在查找视图的上下文之外运行此提取,它是否正确限制了计数?
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?