[英]Execution of Fetch XML using Web API Dynamics 365
我正在使用这种方法在Web API中使用Fetch XML进行分页。
当我们使用简单的fetch时,Web API可以完美地工作;如果有更多的记录,它会返回pagging cookie以及结果,但是当我们使用complex(具有链接实体)时,fetch XML会返回分页cookie,但为空,例如:
<b><cookie pagenumber="2" pagingcookie="" istracking="False" /></b>
在这里,您可以看到分页Cookie中没有任何内容。
提取用于查询的XML:
<fetch mapping="logical" version="1.0" output-format="xml-platform" count="10" page="1" >
<entity name="invoicedetail" >
<attribute name="invoicedetailid" />
<attribute name="uomid" />
<attribute name="quantity" />
<attribute name="manualdiscountamount" />
<attribute name="priceperunit" />
<attribute name="extendedamount" />
<filter>
<condition entityname="invoice" attribute="customerid" operator="eq" value="{5A8F8B46-2443-E511-80E3-3863BB351E10}" />
</filter>
<link-entity name="invoice" from="invoiceid" to="invoiceid" >
<attribute name="invoiceid" />
<attribute name="invoicenumber" />
<attribute name="description" />
<attribute name="totalamount" />
<order attribute="ss_postingdate" descending="true" />
</link-entity>
</entity>
</fetch>
如果我们删除链接的实体,它将开始在响应中提供确切的页面Cookie,可以使用@Microsoft.Dynamics.CRM.fetchxmlpagingcookie
来获取。
在复杂的情况下,有什么方法可以获取准确的分页cookie?
我已经在标准组织服务中看到过这种情况。 我建议仅使用分页cookie而不进行分页-这为我解决了组织服务中的问题。
例如<fetch mapping="logical" page="1" count="50">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.