HI,
There is a restriction on exporting records to Excel in Dynamics CRM. You can only export up to 10,000 records.
To increase limit there are two ways to do :
1. Unsupported Way :
select OrganisationBase table in the CRM organisations database. Update the MaxRecordsForExportToExcel field to the required number of data to be exported.
2. Supported Way :
If you are on premise you can modify the registry to fix this, if you are using CRM Online (or don't want to touch the registry) you can use the following code to modify the Organization attribute "maxrecordsforexporttoexcel".
public static void Main(string[] args)
{
OrganizationServiceProxy _serviceProxy = null;
IOrganizationService _service;
Uri crmURI = new Uri("https://{ORGANIZATION}.api.{crmregion}.dynamics.com/XRMServices/2011/Organization.svc");
ClientCredentials clientCredentials = new ClientCredentials();
clientCredentials.UserName.UserName = "username";
clientCredentials.UserName.Password = "password";
using (_serviceProxy = new OrganizationServiceProxy(crmURI, null, clientCredentials, null))
{
QueryExpression query = new QueryExpression();
query.EntityName = "organization";
query.ColumnSet = new ColumnSet() { AllColumns = true };
_service = (IOrganizationService)_serviceProxy;
EntityCollection entities = _service.RetrieveMultiple(query);
if (entities.Entities.Count == 1)
{
if (entities.Entities[0].Attributes.Contains("maxrecordsforexporttoexcel"))
{
entities.Entities[0].Attributes["maxrecordsforexporttoexcel"] = 20000;
_service.Update(entities.Entities[0]);
}
}
}
}
Hope this Helps !!
Kamran