我花了几天时间逐渐减少代码来隔离问题,但我在构造 FetchXML 结构来过滤子网格的方式上显然犯了一些根本性错误。 此 xml 在 XRMToolbox 中工作正常,但当我在 Dynamics 中运行它时失败,并出现错误“未找到具有名称或别名 LearnEvent 的链接实体”
<fetch>
<entity name='crd80_flightplanevent'>
<attribute name='crd80_flightplanevent' />
<attribute name='crd80_specificday' />
<attribute name='crd80_windowfinish' />
<attribute name='crd80_windowstart' />
<filter type='and'>
<condition attribute='crd80_learnerflight' operator='eq' value='01446622-C4ED-42AF-BA56-20D39324B2F8'/>
<condition entityname='LearnEvent' attribute='crd80_learningeventid' operator='eq' value='8795c5e6-f042-ed11-bba3-0022489b43c0'/>
</filter>
<link-entity name='crd80_learningevent' from='crd80_learningeventid' to='crd80_learningevent' link-type='outer' alias='LearnEvent' />
</entity>
</fetch>
请问有什么建议吗?
fetchXML 是在 Dynamics 的高级过滤器中创建的。 我最终通过编写一个 webapi 调用解决了这个问题,然后为每个循环添加实际的 guid 作为查找字段的单独条件。