2017-02-16 93 views
0

我通過c#中的fetchxml訪問動態CRM數據。當我嘗試執行以下查詢時,出現以下錯誤。CRM fetchxml - AggregateQueryRecordLimit超出

AggregateQueryRecordLimit超出。無法執行此操作。

<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false' aggregate='true'> 
    <entity name='productclass'> 
    <attribute name='classificationidid' groupby='true' alias='classidid'/> 
    <attribute name='productidid' aggregate='count' alias='ProductCount' /> 
     <filter type='and'> 
     <condition attribute='classidid' operator='in'>" + cIds + @"</condition> 
     </filter> 
    </entity> 

如何解決這個問題?

回答

0

CRM正試圖在不成比例的數據量上阻止自己窒息。

我建議作爲優化過程的嘗試將運行多個查詢,每個元素cIds(因此從in轉換爲eq運算符,IIRC)一個查詢。您最終會爲每個元素設置一個結果集,您可以在代碼中進行合併(這對於LINQ來說很簡單)。

我的另一個建議是讓您升級CRM:在最新版本中,您有彙總字段,專門用於在相關記錄上進行彙總。

相關問題