dynamics-crm - 基于两个相关实体的属性的 FetchXML 或条件
问题描述
此 FetchXML 语句的要求是:
- 返回所有“ebs_opportunityinternshipunit”,其中
- “createdon”是“上周”
- 和
- 'account' 的 'owner' 是 'eq-userid'
- 'account' 被 'opportunity' 的 'parentaccountid' 引用
- 或者
- “account2”的“所有者”是“eq-userid”
- 'account2' 被 'opportunity' 的 'mitacs_partner2' 引用
- 'account' 的 'owner' 是 'eq-userid'
我尝试使用开箱即用工具 XRMToolbox FetchXML Builder 配置过滤器,访问官方 CRM 社区论坛并阅读 FetchXML 文档。尽管如此,我能想到的最好的还是如下:
<fetch version="1.0" mapping="logical">
<entity name="ebs_opportunityinternshipunit">
<attribute name="ebs_name" />
<attribute name="createdon" />
<attribute name="ebs_opportunityinternshipunitid" />
<order attribute="ebs_name" descending="false" />
<filter type="and">
<condition attribute="createdon" operator="last-week" />
<filter type="or">
<condition entityname="ab" attribute="ownerid" operator="eq-userid" />
<condition entityname="ac" attribute="ownerid" operator="eq-userid" />
</filter>
</filter>
<link-entity name="opportunity" from="opportunityid" to="ebs_opportunity" link-type="inner" alias="aa">
<link-entity name="account" from="accountid" to="parentaccountid" link-type="inner" alias="ab" />
<link-entity name="account" from="accountid" to="mitacs_partner2" link-type="inner" alias="ac" />
</link-entity>
</entity>
</fetch>
解决方案
推荐阅读
- flutter - 仅为 Flutter Web 添加自定义字体
- algorithm - 给定一个整数数组,找到最接近 K 的子集和
- java - 为什么休眠查询方法(在存储库接口中定义)不可用?
- objective-c - 无法打开该文件,因为您无权查看它。(NSData dataWithContentsOfFile)
- date - Java LDAP Unix 时间戳 | 为什么 Nanotime 到 Java 日期转换使用公式:(((1970-1601) * 365) - 3 + Math.round((1970-1601)/4) ) * 86400L?
- python - selenium - driver.get() 无需等待 (Python)
- kubernetes - GKE 指标服务器
- java - 1 个测试用例(我不知道)失败了,有人可以检查我的代码并告诉我有什么问题吗?
- flutter - 如何在颤动中暂停移动的 AnimatedPositioned?
- python - 打开 cuda 库时出错。在我的电脑上找不到