Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Dynamics crm 使用外部联接查询CRM 2011_Dynamics Crm_Dynamics Crm 4_Dynamics Crm 2011_Fetchxml - Fatal编程技术网

Dynamics crm 使用外部联接查询CRM 2011

Dynamics crm 使用外部联接查询CRM 2011,dynamics-crm,dynamics-crm-4,dynamics-crm-2011,fetchxml,Dynamics Crm,Dynamics Crm 4,Dynamics Crm 2011,Fetchxml,我正在使用下面的代码查询CRM 2011中设置的约会。当我使用这个查询时,它返回数据,但它返回重复的数据。如果我取出外部连接,它不会返回任何东西。有没有办法解决这个问题 <fetch> <entity name="appointment"> <attribute name="scheduledstart" /> <link-entity name="systemuser" from="systemuserid" to="ownerid

我正在使用下面的代码查询CRM 2011中设置的约会。当我使用这个查询时,它返回数据,但它返回重复的数据。如果我取出外部连接,它不会返回任何东西。有没有办法解决这个问题

<fetch>
  <entity name="appointment">
    <attribute name="scheduledstart" />
    <link-entity name="systemuser" from="systemuserid" to="ownerid" link-type="outer">
      <attribute name="firstname" alias="ownerFirstName" />
      <attribute name="lastname" alias="ownerLastName" />
    </link-entity>
    <link-entity name="contact" from="contactid" to="new_contactperson" link-type="outer">
      <attribute name="parentcustomerid" alias="parentaccount" />
      <attribute name="new_businessunit" alias="businessunit" />
    </link-entity>
    <attribute name="new_contactperson" />
    <attribute name="subject" />
    <attribute name="new_coldernotes" />
    <link-entity name="activityparty" from="activityid" to="activityid" link-type="outer">
      <attribute name="participationtypemask" alias="participationtypemask" />
      <filter>
        <condition attribute="participationtypemask" operator="eq" value="5" />
      </filter>
      <link-entity name="contact" from="contactid" to="partyid" link-type="outer">
        <attribute name="fullname" alias="RequiredContactFullName" />
      </link-entity>
      <link-entity name="systemuser" from="systemuserid" to="partyid" link-type="outer">
        <attribute name="fullname" alias="RequiredOwners" />
      </link-entity>
      <link-entity name="account" from="accountid" to="partyid" link-type="outer">
        <attribute name="name" alias="RequiredAccount" />
      </link-entity>
    </link-entity>
    <!--the new join-->
    <link-entity name="activityparty" from="activityid" to="activityid" alias="optionalactivityparty" link-type="outer">
      <attribute name="participationtypemask" alias="optionalparticipationtypemask" />
      <filter>
        <condition attribute="participationtypemask" operator="eq" value="6" />
      </filter>
      <link-entity name="contact" from="contactid" to="partyid" alias="optionalcontact" link-type="outer">
        <attribute name="fullname" alias="OptionalContactFullName" />
      </link-entity>
      <link-entity name="systemuser" from="systemuserid" to="partyid" alias="systemuser2" link-type="outer">
        <attribute name="fullname" alias="OptionalOwners" />
      </link-entity>
      <link-entity name="account" from="accountid" to="partyid" alias="optionalaccount" link-type="outer">
        <attribute name="name" alias="OptionalAccount" />
      </link-entity>
    </link-entity>
    <filter type="and">
      <condition attribute="scheduledstart" operator="on-or-after" value="@FromDate" />
      <condition attribute="scheduledstart" operator="on-or-before" value="@ToDate" />
    </filter>
  </entity>
</fetch>


谢谢

尝试通过将根获取节点更改为

<fetch distinct='true'>
...
</fetch>

...

通过将根获取节点更改为

<fetch distinct='true'>
...
</fetch>

...