2016-08-02 11 views
2

Fetch XMLで左外部結合を使用してデータをフェッチする方法はありますか?Fetch XMLで左外部結合を使用してデータをフェッチする方法はありますか?

カラムを作成できましたが、データを表示できませんでした。

私はVisual Studio 2008でSSRSレポートを作成しています。CRMバージョンはCRM 2016 Onlineです。

このフェッチXMLクエリは、リンクエンティティ 'meeting'にあるデータを表示しません。詳細については

<fetch mapping='logical'>     
<entity name='company'>    
    <attribute name='name'/>    
    <attribute name='createdon'/>   
    <attribute name='companyid'/>   
    <order descending="false" attribute="name"/>    
    <filter type="and">   
      <condition attribute="infocode" value="0" operator="eq"/> 
    </filter>   
    <link-entity name='company' from='companyid' to='meetingid' link-type='outer'>   
     <attribute name='meetingid' />  
     <attribute name="topic"/>  
     <attribute name="createdon"/>  
     <order descending="false" attribute="topic"/>  
    </link-entity>   
</entity>    

- エンティティの構成が表示され、データの表示を希望 - このイメージを参照してください。あなたが質問に投稿された画像に基づいて

enter image description here

答えて

1

、私はあなたがINNERは、両方のテーブルからデータを表示するためにJOINを行う必要があると思います。

この行置換:により

<link-entity name='company' from='companyid' to='meetingid' link-type='outer'> 

を:

<link-entity name='company' from='companyid' to='meetingid' link-type='inner'> 

LEFT OUTERは、他のテーブルからの行と関連していない一つのテーブルからの戻り行をJOIN。両方のエンティティに参加したいので、あなたのケースには適していません。

あなたは左の外側を使用することができますは、次のような結合テーブル上の フィルタは、ない は過去2ヶ月で、キャンペーン活動を持っていたすべての連絡先を検索するクエリを実行するためにFetchXMLに参加します。

REFERENCE

このことができますなら、私に教えてください。

+0

こんにちは、アレハンドロ。 私は 'outer'を 'inner'に置き換えようとしましたが、 の列は作成されましたが、値が表示されませんでした。 Fetch-XML(または「CRM 2016」)は、Fetch-XML(または「CRM 2016オンライン ")内部の結合をサポートしていますか? 私はWebでその記事を見つけることができませんでした。 「Visual Studio 2008」と「CRM 2016 online」のレポートを作成しています。 「Dynamics CRM 2016 SDK」をインストールする必要がありますか? – esperanish

+0

@esperanishでは、[FetchXMLを使用してクエリを作成する](https://msdn.microsoft.com/en-us/library/gg328117.aspx)を確認してください。 Microsoft Dynamics CRM 2016およびMicrosoft Dynamics CRM Onlineに適用されます。 –

0

esperanish、 はいFetchXMLは内部結合操作をサポートしています。

上記のFetchXMLを手動で作成しましたか?ダイナミックCRMオンラインでビューを事前に検索するか使用しますか。

より正確なFetchXMLを作成するには、事前検索ビューを使用することをお勧めします。あなたの与えられたFethXMLコードで

私はあなたの主なエンティティが「当社」であり、あなたのリンクエンティティは、ここで任意の意味をなさない同じエンティティへのリンク、あまりに「当社」であることがわかります。これらのFetchXMLを使用して

試してみてください。

<fetch mapping='logical'>     
<entity name='company'>    
    <attribute name='name'/>    
    <attribute name='createdon'/>   
    <attribute name='companyid'/>   
    <order descending="false" attribute="name"/>    
    <filter type="and">   
      <condition attribute="infocode" value="0" operator="eq"/> 
    </filter>   
    <link-entity name='meeting' from='meetingid' to='companyid' link-type='inner'>   
     <attribute name='meetingid' />  
     <attribute name="topic"/>  
     <attribute name="createdon"/>  
     <order descending="false" attribute="topic"/>  
    </link-entity>   
</entity> 

または

<fetch mapping='logical'>     
<entity name='company'>    
    <attribute name='name'/>    
    <attribute name='createdon'/>   
    <attribute name='companyid'/>   
    <order descending="false" attribute="name"/>    
    <filter type="and">   
      <condition attribute="infocode" value="0" operator="eq"/> 
    </filter>   
    <link-entity name='meeting' from='companyid' to='meetingid' link-type='inner'>   
     <attribute name='meetingid' />  
     <attribute name="topic"/>  
     <attribute name="createdon"/>  
     <order descending="false" attribute="topic"/>  
    </link-entity>   
</entity> 

注:私は使用されるマッピングを知らないので、私が与えられたFetchXMLはあなたかのために働くかどうかわかりませんあなたのCRMで。これを回避策の例として考えることができます。

関連する問題