获取XML以获取没有特定实体的任何关联记录的所有记录

时间:2013-03-01 12:33:10

标签: dynamics-crm-2011

此高级查找获取XML检索所有具有关联服务活动的案例:

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
    <entity name="incident">
        <attribute name="title" />
        <attribute name="ticketnumber" />
        <attribute name="createdon" />
        <attribute name="incidentid" />
        <order attribute="title" descending="false" />
        <link-entity name="serviceappointment" from="wl_serviceactivitiesid" to="incidentid" alias="aa">
        </link-entity>
</entity>

Fetch XML或View逻辑用于显示具有关联服务活动的所有案例。 在:

之前可以有
<link-entity>

1 个答案:

答案 0 :(得分:1)

我认为这可行:

基本上,它对serviceappointment进行外连接,然后排除任何具有主键的项目。

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
    <entity name="incident">
        <attribute name="title" />
        <attribute name="ticketnumber" />
        <attribute name="createdon" />
        <attribute name="incidentid" />
        <order attribute="title" descending="false" />
        <link-entity name="serviceappointment" from="wl_serviceactivitiesid" to="incidentid" alias="aa" link-type="outer">
            <filter type="and">
                <condition attribute="wl_serviceactivitiesid" operator="null" />
            </filter>
        </link-entity>
</entity>