web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

MSCRM 2011 - [FormatException: String was not recognized as a valid DateTime.] Lead Create/Update

(0) ShareShare
ReportReport
Posted on by 105

Hi,

Please can anyone can guide me to resolve the issue. Suddenly dont know for what reasons started getting this issue.

ISSUE : On lead form I have 5- 7 date time fields. yone or more fileds (Date time fields) is updated/changed and I try to save the form get below error.

Resolutions Tried :

1. Diabled all scripts on lead page.

2. Diabled all plugins.

3. Deactivated all workflows.

4. Imported old customizations files in system (Backup file taken before last customizations update)

Still facing the same issue detailed below.

Microsoft CRM Error Report:

Error Description:

An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.


Error Details:

Exception of type 'System.Web.HttpUnhandledException' was thrown.


Full Stack:

[FormatException: String was not recognized as a valid DateTime.] at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at Microsoft.Crm.Application.Platform.AttributeCollection.CreateValueFromDateTimePropertyValue(String name, Object value) at Microsoft.Crm.Application.Platform.AttributeCollection.SetEntityProperty(Entity entity, String name, String childAttributeName, Object parentProperty, AttributeMetadata attributeMetadata, Object value, IOrganizationContext context) at Microsoft.Crm.Application.Platform.AttributeCollection.Insert(String name, Object value, Boolean throwIfKeyExists) at Microsoft.Crm.Application.Platform.EntityProxy.SetData(XmlNode entityElement) at Microsoft.Crm.Application.Forms.EndUserForm.RetrieveParametersForEventDefault() at Microsoft.Crm.Application.Forms.EndUserForm.Initialize(Entity entity) at Microsoft.Crm.Application.Forms.CustomizableForm.Execute(Entity entity, FormDescriptor fd) at Microsoft.Crm.Application.Components.PageHandlers.LeadRecordPageHandler.ConfigureFormHandler() at Microsoft.Crm.Application.Components.Utility.GenericEventProcessor.RaiseEvent(String eventName) at Microsoft.Crm.Application.Controls.PageManager.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

[HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown.] at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Error Number:


Source File:

Not available


Line Number:

Not available


Error Trace:

Request URL:

 

Any help or Suggestions are appreciated.

Regards,

Sarfaraj

*This post is locked for comments

I have the same question (0)
  • AFTAB HUSSAIN Profile Picture
    on at

    Hello Sarfaraj,

    According the error message above.

    [FormatException: String was not recognized as a valid DateTime.]

      at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)

    "String was not recognized as a valid DateTime".

    It seems that one of the field string that reflects the data and time is not in the correct format as this is failing when the function (System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) is called.

    I would suggest if we are changing or updating the Date Time value, then verify and confirm if we have entered the DataTime field in correct format.

    Other way :

    Try applying date and time functions on that variable. I mean try converting the value in the variable to a date and time.

    Remember CRM converts between UTC (on the database) and local time (adjusting for DST) for display on forms. When looking at the value of dates while debugging your code you need to know whether you are looking at a UTC or local DateTime to know whether it is 'correct'. You can find out by looking at the DateTime.Kind property.

    For more help.

    social.microsoft.com/.../string-was-not-recognized-as-a-valid-datetime

    I hope this helps.

    Thank You !

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans