Dynamics 365 fetchxml multiple link entity 多个链接实体或者关系查询

D365实现关联实体之间的条件或者关系例子:

下面的示例查询客户列表,条件是:

客户的状态=可用且((客户库存的某些产品在指定列表中,且状态=100000001) 或者某些产品不在客户库存表中)

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" >
    <entity name="account" >
        <attribute name="name" />
        <attribute name="accountid" />
        <order attribute="name" descending="false" />
        <filter type="and" >
            <condition attribute="statecode" operator="eq" value="0" /> 
        </filter>
        <filter type="or" >
            <condition entityname="acnull" attribute="account_r1" operator="null" />
            <condition entityname="acoffshelf" attribute="onshelfstatus" operator="eq" value="100000001" />
        </filter>
        <link-entity name="accountstock" from="account_r1" to="accountid" link-type="outer" alias="acoffshelf" >
            <filter type="and" >
                <condition attribute="product_r2" operator="in" >
                    <value>6a7644c6-540f-ee11-8f6e-6045bd1ba93b</value>
                </condition>
            </filter>
        </link-entity>
        <link-entity name="accountstock" from="account_r1" to="accountid" link-type="outer" alias="acnull" >
            <filter type="and" >
                <condition attribute="product_r2" operator="in" ><value>6a7644c6-540f-ee11-8f6e-6045bd1ba93b</value>
                </condition>
            </filter>
        </link-entity>
    </entity>
</fetch>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值