更改Dynamics 365 Customer Engagement本地部署的高级配置

更改Dynamics 365 Customer Engagement本地部署的高级配置

在实施项目的时候,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", 100000));
            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'

来自罗勇的博客:https://www.cnblogs.com/luoyong0201/p/Update_Dynamics_365_Customer_Engagement_Advanced_Configuration_Setting.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值