fetchXMLを使用してコントロールにカスタムビューを追加するjavascript関数があります。私の問題は、ルート<fetch>ノードのcount属性が機能していないことです。6に設定しましたが、フェッチによって定義された26レコード(すべてのレコード)が返されます。
これが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は次のようにjavascriptで使用されています:
Xrm.Page.getControl("itt_termid").addCustomView(viewId, entityName, viewDisplayName, fetchXml, layoutXml, true);
ただし、ユーザーがルックアップアイコンをクリックすると、6つのレコードではなく26のレコードすべてが返されます。