【问题标题】:CRM fetchxml - AggregateQueryRecordLimit exceededCRM fetchxml - 超出 AggregateQueryRecordLimit
【发布时间】:2017-02-16 06:30:44
【问题描述】:

我正在通过 c# 中的 fetchxml 访问动态 CRM 数据。当我尝试执行以下查询时,出现以下错误。

已超出 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>

如何解决这个问题?

【问题讨论】:

    标签: dynamics-crm-2011 fetchxml


    【解决方案1】:

    这是因为实体 productclass 包含的记录多于 AggregateQueryRecordLimit 设置中的当前限制。

    您可以使用此处描述的 powershell 扩展来更改此设置:http://msdn.microsoft.com/en-us/library/2a4061cd-e6b4-4672-8c44-20a27c523718

    完整的设置列表可在http://msdn.microsoft.com/en-us/library/gg334634.aspx 获得 请记住,更改此设置可能会影响性能。

    【讨论】:

      【解决方案2】:

      CRM 正试图避免因过多的数据而窒息。

      作为优化流程的尝试,我建议运行多个查询,每个查询对应cIds 的每个元素(因此从in 切换到eq 运算符,IIRC)。您最终将得到每个元素的一个结果集,您可以将其合并到代码中(这对于 LINQ 来说很简单)。

      我的另一个建议是升级 CRM:在最新版本中,您拥有专门用于对相关记录进行聚合的汇总字段。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-02-19
        • 1970-01-01
        • 2011-11-24
        • 2015-10-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多