1

Dynamics CRM 2011 のオンライン バージョンで FetchXML を使用して、今後 30 日から 60 日から 90 日以内に終了するテリトリー (テリトリーはアカウントで定義されます) ごとのすべての商談のリストを取得する方法はありますか?

テスト データベースに SQL を記述してこれを実行しようとしましたが、次の SQL を使用することで可能です。

select Territory.TerritoryId ,
 (select count(OpportunityId) from Opportunity where Opportunity.AccountId = Account.AccountId and Account.TerritoryId = Territory.TerritoryId and EstimatedClosureDate < '12/12/2011') as OppIn30Days,
 (select count(OpportunityId) from Opportunity where Opportunity.AccountId = Account.AccountId and Account.TerritoryId = Territory.TerritoryId and EstimatedClosureDate < '12/1/2012') as OppIn60Days,
 (select count(OpportunityId) from Opportunity where Opportunity.AccountId = Account.AccountId and Account.TerritoryId = Territory.TerritoryId and EstimatedClosureDate < '12/2/2012') as OppIn90Days
  from territory left outer join Account on Territory.TerritoryId = Account.TerritoryId --group by Territory.TerritoryId, Account.TerritoryId, Account.AccountId
-- TODO parameterization of query, etc. 

SQL の結果は次のようになります。

Columns: TerritoryId|OpportunitiesClosingIn30Days|OpportunitiesClosingIn60Days
Data:   US              5                                   1
        Europe          1                                   4
        Asia            4                                   5

外部結合がサポートされていないため、FetchXML を使用してこれを行うことは可能ですか?

商談に非表示のテリトリー フィールドを追加し、商談が作成されるたびに対応する取引先からテリトリーがコピーされるようにコードを記述すれば、役に立ちますか?

4

1 に答える 1

1

残念ながら、これは FetchXML では不可能です。関連するすべてのデータを取得して表示用に操作するレポートを使用してダミーを作成できる場合がありますが、それに答えるには SSRS の第一人者が必要です。

非正規化されたデータの提案は、おそらく正しい方向Territoryに進んでいます。商談に追加すると、MSCRM ダッシュボードを使用して、月ごとに終了した商談を地域ごとに表示できます。

于 2012-05-08T04:16:34.690 に答える