我是微软Dynamics 365 & Power Platform方面的工程师罗勇,也是2015年7月到2018年6月连续三年Dynamics CRM/Business Solutions方面的微软最有价值专家(Microsoft MVP),欢迎关注我的微信公众号 MSFTDynamics365erLuoYong ,回复346或者20190718可方便获取本文,同时可以在第一间得到我发布的最新博文信息,follow me!

在实施项目的时候,Dynamics 365数据量比较多,展示的图表(chart)显示这个错误,

AggregateQueryRecordLimit exceeded.  Cannot perform this operation.

这个错误的意思就是聚合的记录超过了高级配置AggregateQueryRecordLimit字段的值,操作终止。

这个高级配置项目AggregateQueryRecordLimit在哪儿?它不像组织属性那样在组织数据库中,如 更改组织属性-以更改maxrecordsforexporttoexcel为例 ,而是在 MSCRM_CONFIG 数据库的 [dbo].[DeploymentProperties] 表中,有哪些项目呢,我这里以我自己的本地部署的Dynamics 365 Customer Engagement 版本 1612 (9.0.3.7) (DB 9.0.3.7) (本地) 为了,通过如下SQL查出来。

SELECT [ColumnName]
,[BigIntColumn]
,[IntColumn]
,[SmallIntColumn]
,[TinyIntColumn]
,[BitColumn]
,[FloatColumn]
,[DateTimeColumn]
,[SmallDateTimeColumn]
,[NVarCharColumn]
FROM [MSCRM_CONFIG].[dbo].[DeploymentProperties]
ORDER BY [ColumnName]

我这里截图出来部分结果如下:

如何更改呢?根据文档 Use Advanced Configuration Settings (ConfigDB) 可以用 RetrieveAdvancedSettingsRequest 消息来查找,然后使用 UpdateAdvancedSettingsRequest 消息来更新。若是用这两个消息来处理,程序需要引用 Microsoft.CrmSdk.Deployment ,我这里亲自测试有效的代码如下:

            DeploymentServiceClient deploySvc = Microsoft.Xrm.Sdk.Deployment.Proxy.ProxyClientHelper.CreateClient(new Uri("https://demo.luoyong.me/XRMDeployment/2011/Deployment.svc"));
deploySvc.ClientCredentials.Windows.ClientCredential = new NetworkCredential("crmadmin", "Paseewxw", "luoyong.me");
ConfigurationEntity entity = new ConfigurationEntity();
entity.LogicalName = "Deployment";
entity.Attributes = new Microsoft.Xrm.Sdk.Deployment.AttributeCollection();
entity.Attributes.Add(new KeyValuePair<string, object>("AggregateQueryRecordLimit", ));
UpdateAdvancedSettingsRequest request = new UpdateAdvancedSettingsRequest();
request.Entity = entity;
deploySvc.Execute(request);

更方便的是使用PowerShell命令来更新,我这里根据 Simon Jenkinson 的文章 Microsoft Dynamics CRM 2013 Change Deployment Settings via PowerShell 稍作更改可以使用如下代码:

$itemSetting = new-object 'System.Collections.Generic.KeyValuePair[String,Object]'("AggregateQueryRecordLimit",50000)
$configEntity = New-Object "Microsoft.Xrm.Sdk.Deployment.ConfigurationEntity"
$configEntity.LogicalName="Deployment"
$configEntity.Attributes = New-Object "Microsoft.Xrm.Sdk.Deployment.AttributeCollection"
$configEntity.Attributes.Add($itemSetting)
Set-CrmAdvancedSetting -Entity $configEntity

最后一个方法不推荐使用,但是也可行,就是用SQL来更新,记得更新后需要对CRM的Web 站点对应的应用程序池执行Recycle,当然也可以用执行 IISRESET代替Recycle。

  UPDATE [MSCRM_CONFIG].[dbo].[DeploymentProperties]
SET IntColumn = 50000
where ColumnName = 'AggregateQueryRecordLimit'

更改Dynamics 365 Customer Engagement本地部署的高级配置的更多相关文章

  1. 利用Azure虚拟机安装Dynamics 365 Customer Engagement之五:安装SQL Server

    我是微软Dynamics 365 & Power Platform方面的工程师罗勇,也是2015年7月到2018年6月连续三年Dynamics CRM/Business Solutions方面 ...

  2. Dynamics 365 Customer Engagement中插件的调试

    微软动态CRM专家罗勇 ,回复319或者20190319可方便获取本文,同时可以在第一间得到我发布的最新博文信息,follow me!我的网站是 www.luoyong.me . 本文主要根据官方的教 ...

  3. Dynamics 365 Customer Engagement安装FAQ

    微软动态CRM专家罗勇 ,回复310或者20190308可方便获取本文,同时可以在第一间得到我发布的最新博文信息,follow me!我的网站是 www.luoyong.me . 本文参考了包括但不限 ...

  4. Dynamics 365 Customer Engagement的标准导入不支持并行导入了吗?

    我是微软Dynamics 365 & Power Platform方面的工程师罗勇,也是2015年7月到2018年6月连续三年Dynamics CRM/Business Solutions方面 ...

  5. 配置基于服务器认证的Dynamics 365 Customer Engagement和SharePoint Online集成

    我是微软Dynamics 365 & Power Platform方面的工程师罗勇,也是2015年7月到2018年6月连续三年Dynamics CRM/Business Solutions方面 ...

  6. Dynamics 365 Customer Engagement V9.X新引入的自动编号属性介绍

    我是微软Dynamics 365 & Power Platform方面的工程师罗勇,也是2015年7月到2018年6月连续三年Dynamics CRM/Business Solutions方面 ...

  7. 利用Azure虚拟机安装Dynamics 365 Customer Engagement之四:组织单位服务安装账号设置

    我是微软Dynamics 365 & Power Platform方面的工程师罗勇,也是2015年7月到2018年6月连续三年Dynamics CRM/Business Solutions方面 ...

  8. 利用Azure虚拟机安装Dynamics 365 Customer Engagement之二:创建域控虚拟机

    我是微软Dynamics 365 & Power Platform方面的工程师罗勇,也是2015年7月到2018年6月连续三年Dynamics CRM/Business Solutions方面 ...

  9. 利用Azure虚拟机安装Dynamics 365 Customer Engagement之一:准备工作

    我是微软Dynamics 365 & Power Platform方面的工程师罗勇,也是2015年7月到2018年6月连续三年Dynamics CRM/Business Solutions方面 ...

随机推荐

  1. UITableView 实例详解 滑动编辑 headerView

    转自:http://blog.csdn.net/reylen/article/details/8505960 self.dataArray = [[[NSMutableArray alloc]init ...

  2. windows下RocketMQ下载安装教程

    一.下载(原文链接:http://www.studyshare.cn/software/details/1183/0 ) 1.官网下载:下载地址   2.百度网盘下载:下载地址 提取码:0g5a ja ...

  3. 数据库MySQL的安装与卸载

    安装 MySQL  卸载 MySQL: 停止 MySQL 服务 开始-->所有应用-->Windows 管理工具-->服务,将 MySQL 服务停止. 卸载 mysql server ...

  4. ARTS-S 做事情的正确方法

    有同学改bug的思路是:你们别管我怎么改,先看改的效果对不对.效果对,就这样改,效果不对,我再想别的办法.这样其实把自己关起来,盲目试错,效率太低. 合理的方法应该是和其他大佬们商量一个大家认为正确的 ...

  5. WebAPI接口的自动化测试2

    接口认证: 服务器的接口需要通过一个验证机制,这个验证机制可以是session或token 以session为例. session存储与服务器,通常用户登录后,服务器会把配套的sessionid发送给 ...

  6. Python3 面向对象小练习

    定义MySQL类 对象有id.host.port三个属性 定义工具create_id,在实例化时为每个对象随机生成id,保证id唯一 提供两种实例化方式,方式一:用户传入host和port 方式二:从 ...

  7. 【React】383- React Fiber:深入理解 React reconciliation 算法

    作者:Maxim Koretskyi 译文:Leiy https://indepth.dev/inside-fiber-in-depth-overview-of-the-new-reconciliat ...

  8. python爬虫获取天猫与京东的商品价格

    git地址:   https://gitee.com/zhxs_code/spider_python 目前已简单实现可以爬取指定页面的价格(天猫和狗东的都可以),但是由于天猫与狗东对价格的展示方式和策 ...

  9. 基于WCF 的远程数据库服务访问技术

    原文出处:http://www.lw80.cn/shuji/jsjlw/13588Htm.Htm摘要:本文介绍了使用WCF 建立和运行面向服务(SOA)的数据库服务的系统结构和技术要素,分析了WCF ...

  10. 聊一聊看似简单的Promise.prototype.then()方法

    Promise.prototype.then() Proise实例的then方法是定义在原型对象Promise.prototype上的,它的作用是为Promise实例添加状态改变时的回调函数. 该方法 ...