我试图通过使用 fetch XML 在 MS dynamics 中加入"系统视图"和来自同一组织的实体来获取一些记录(基本上我在 ssis 任务中执行此操作( - 如果我尝试加入多个实体或来自同一组织的不同实体,它会起作用。
我不确定需要在"链接实体"部分中使用什么代码才能将实体链接到系统视图。下面是我试图锻炼的代码
<fetch version="1.0" output-format = "xml-platform" mapping = "logical" distinct = "true">
<entity name = "Contact">
<attribute name = "address1_line1"/>
<attribute name = "address1_city"/>
<link-entity name="My system View" alias = "msv" to="contactid" from = "new_contactID" link-type="inner">
<attribute name = "Company"/>
</link-entity>
</entity>
</fetch>
问题 - 而不是使用代码<link-entity name="My system View" alias = "msv" to="contactid" from = "new_contactID" link-type="inner">
需要做什么才能将实体"联系人"链接到系统视图"我的系统视图"?
在 FetchXML 中,您只能将实体作为链接实体。似乎您正在尝试在同一实体联系人中构建父引用?如果是这种情况,您必须将联系人添加为链接实体,并在链接实体元素中添加该系统视图的条件。
例:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" >
<entity name="Contact" >
<attribute name="address1_line1" />
<attribute name="address1_city" />
<link-entity name="contact" alias="msv" to="contactid" from="new_contactID" link-type="inner" >
<filter type="and" >
<condition attribute="sysviewattrname" operator="eq" value="value" />
</filter>
<attribute name="Company" />
</link-entity>
</entity>
</fetch>
请注意,我已经手动修改了 FetchXML,因此您可能需要对其进行一些调整,以防它无法验证。