Thursday 18 June 2020

Increase the limit of ExportToExcel in Dynamics 365 CE - MaxRecordsForExportToExcel

Hi Everyone,

Today I was working with one of the users and they were to looking to export more than 10000 records from Dynamics 365 CE in one go. We all know that this is the limitation in the system. Somehow, I remembered that I have read something on this where we can increase the limit and quick check has shown a way to do.

There is a configuration for this and we can update in a supported way. MaxRecordsForExportToExcel attribute in Organization entity has this information.

We need Organization ID to update this setting, get it from Advanced Settings/Settings --> Customizations --> Developer Resources  --> Instance Reference Information.

Here is the code to update the setting using C# and we can update to the max value of 2147483647 but update it as per your requirement as the huge number might put the load on the system while exporting.


Entity entOrganization = new Entity("organization");
// Get Organization ID from Developer Resources.
entOrganization.Id = new Guid("OrganizationID");
entOrganization.Attributes["maxrecordsforexporttoexcel"] = 500000;
crmService.Update(entOrganization);

Hope this helps.

--
Happy 365'ing
Gopinath

2 comments:

  1. What is the maximum value of maximumvmaxrecordsforexporttoexcel ???
    Here you update with 50k it's the last range value???

    ReplyDelete