【发布时间】:2011-12-20 13:30:47
【问题描述】:
我有一个使用 fetchXML 向控件添加自定义视图的 javascript 函数。我的问题是根 <fetch> 节点上的 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 条记录。
【问题讨论】:
-
我很难找到有关 count 属性的任何文档,但它似乎 supposed 像 Select Top 一样工作
-
@codeulike - 这是一个实际的错误。看看我的回答stackoverflow.com/a/7987277/227436,点击链接并滚动到最底部。它应该在汇总 10 中修复,但他们非常擅长将东西推回去,从那时起我就没有费心去测试它......
标签: javascript dynamics-crm-2011 fetchxml