{Error Resolution}DateTime is less than minimum value supported by CrmDateTime error in Dynamics CRM 2016 in a plugin

Recently users started randomly reporting an error when they hit a custom ribbon button on a custom entity which used to trigger a plugin.

The log they were able to download had the following error:

clip_image001

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: DateTime is less than minumum value supported by CrmDateTime. Actual value: 01/01/0001 00:00:00, Minimum value supported: 01/01/1753 00:00:00Detail:

<OrganizationServiceFault xmlns:i=”http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns=”http://schemas.microsoft.com/xrm/2011/Contracts”&gt;

  <ErrorCode>-2147220935</ErrorCode>

  <ErrorDetails xmlns:d2p1=”http://schemas.datacontract.org/2004/07/System.Collections.Generic&#8221; />

  <Message>DateTime is less than minumum value supported by CrmDateTime. Actual value: 01/01/0001 00:00:00, Minimum value supported: 01/01/1753 00:00:00</Message>

  <Timestamp>2016-07-12T11:19:59.489724Z</Timestamp>

  <InnerFault i:nil=”true” />

  <TraceText>

[CRM.Plugins:.CRM.Plugins.PreCreateUpdate]

[944f9582-fb77-e511-8102-3863bb357c38: CRM.Plugins.PreCreateUpdate: Update of]

</TraceText>

</OrganizationServiceFault>

 

Issue Resolution:

A quick check on the code told the reason. A developer had set CRM Date Time field to 01/01/0001.

Smallest Date Time possible to be set in CRM is 01/01/1753.

Here is the official Note on MSDN:

clip_image003

Detailed Read: https://msdn.microsoft.com/en-us/library/dn996866.aspx

Hope it helps and Happy CRMing!

If you want to know more on Dynamics CRM, just get in touch.

Do not forget to share! Sharing knowledge is true power!


Check this out

Twitter: https://twitter.com/msdynamicsblog
LinkedIn: https://www.linkedin.com/in/deepesh-somani-00296932

Google Play Store:

https://play.google.com/store/apps/details?id=com.dynamicsofdynamicscrm.msdynamicsblog&hl=en

Advertisements