是否可以编写一个获取根实体和多个子实体的 FetchXML 查询?我能做的就是1:1。
詹姆斯·伍德是正确的。获取 XML 是递归的,因此通过使用链接实体,您可以获得所需的信息。
例如,以下内容是有效的:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
<entity name="account">
<attribute name="name" />
<attribute name="primarycontactid" />
<attribute name="telephone1" />
<attribute name="accountid" />
<order attribute="name" descending="false" />
<link-entity name="contact" from="parentcustomerid" to="accountid" alias="aj">
<attribute name="firstname" />
<attribute name="lastname" />
<attribute name="telephone1" />
<link-entity name="businessunit" from="businessunitid" to="owningbusinessunit" alias="ak">
<attribute name="name" />
<attribute name="address1_line1" />
<attribute name="address1_line2" />
<attribute name="address1_line3" />
<filter type="and">
<condition attribute="name" operator="not-null" />
</filter>
</link-entity>
</link-entity>
</entity>
</fetch>
如果您的问题确实是“是否可以编写一个 FetchXML 查询来获取SINGLE根实体和多个子实体”,那么不幸的是答案是否定的。但是,如果您能够处理根数据的重复项(例如使用 SSRS 报告的分组功能),那么您所需要的完全是可能的
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)