2

FetchXML クエリがあり、partitiontypemask が 5 の場合、partitiontypemask が 5 のユーザーを必須列に配置します。しかし、追加したいので、ユーザーの参加タイプマスクが 6 の場合、それらのユーザーは Optional 列に入れられます。これは FetchXML でも可能ですか? これは私がこれまでに持っているものです。

<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="firstname" alias="RequiredContactFirstName" />
            <attribute name="lastname" alias="RequiredContactLastName" />
        </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>
        <filter type="and">
            <condition attribute="scheduledstart" operator="on-or-after" value="@FromDate" />
            <condition attribute="scheduledstart" operator="on-or-before" value="@ToDate" />
        </filter>
      </entity>
</fetch>
4

1 に答える 1

0

個人的には多忙なため、お待たせして申し訳ありませんが、次のlink-entity Activity Partyように、適切なエイリアスを使用して に再度参加するだけでよいと思います。

<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="firstname" alias="RequiredContactFirstName" />
        <attribute name="lastname" alias="RequiredContactLastName" />
      </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" link-type="outer" alias="optionalactivityparty">
      <attribute name="participationtypemask" alias="optionalparticipationtypemask" />
      <filter>
        <condition attribute="participationtypemask" operator="eq" value="6" />
      </filter>
      <link-entity name="contact" from="contactid" to="partyid" link-type="outer" alias="optionalcontact">
        <attribute name="firstname" alias="OptionalContactFirstName" />
        <attribute name="lastname" alias="OptionalContactLastName2" />
      </link-entity>
      <link-entity name="systemuser" from="systemuserid" to="partyid" link-type="outer" alias="systemuser2">
        <attribute name="fullname" alias="OptionalOwners" />
      </link-entity>
      <link-entity name="account" from="accountid" to="partyid" link-type="outer" alias="optionalaccount">
        <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>
于 2011-11-21T18:31:23.483 に答える