Change Dynamics 365 Customer Engagement local deployment Advanced Configuration

I am a Microsoft Dynamics 365 & Power Platform aspects engineer Rayong, Microsoft Most Valuable Professional is the July 2015 to June 2018 for three consecutive years Dynamics CRM / Business Solutions aspects (Microsoft MVP), I welcome the attention of the public micro-channel number MSFTDynamics365erLuoYong, or 20,190,718 reply 346 may facilitate access to this article, but you can get the latest information I Bowen issued in the first room, follow me!

In the implementation of the project, Dynamics 365 more than the data show the chart (chart) displays this error,

AggregateQueryRecordLimit exceeded.  Cannot perform this operation.

This error means that the polymerization advanced value exceeds the recorded AggregateQueryRecordLimit field configuration, the operation is terminated.

The advanced configuration item AggregateQueryRecordLimit Where? It is not the organization attribute as a database in the organization, such as  changes to the organization attributes - for example to change the maxrecordsforexporttoexcel , but [dbo] MSCRM_CONFIG database [DeploymentProperties] table, which projects it, I am here in my own local. deployment of Dynamics 365 Customer Engagement version 1612 (9.0.3.7) (DB 9.0.3.7) ( local) order, check out through the following SQL.

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

 

I came out here to capture part of the results are as follows:

 

How do you change it? According to the document  Use Advanced Configuration Settings (ConfigDB) can RetrieveAdvancedSettingsRequest messages to find and use UpdateAdvancedSettingsRequest news updates. If the use of these two message processing, the program needs to reference Microsoft.CrmSdk.Deployment, I personally tested here a valid code is as follows:

            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命令来更新,我这里根据  的文章 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'

 

Guess you like

Origin www.cnblogs.com/luoyong0201/p/Update_Dynamics_365_Customer_Engagement_Advanced_Configuration_Setting.html