Conversion from string "30.12.1899" to type 'Date' is not valid error.

Hi All,

I am getting below error message when I save person object in web.

This error mesage is thrown only when I work with English language, if I switch to german language and save person no error thrown.

Does anyone faced such situation and what is the solution.

Wednesday, November 18, 2020 2:59 PM Error     WebLog cv5m43pfhohdxaohnm1enr5j  VI.Base.ViException: An exception has occurred while executing the form method Popup0_Popup0_ControlRef2_Container6_Button1_Method. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> VI.Base.ViException: Error during execution of 'OnSaved' in logic module 'VI.DB.Entities.EntityScriptLogic'. ---> VI.Base.ViException: Error during execution of 'OnSaving' in logic module 'VI.DB.Entities.EntityScriptLogic'. ---> VI.Base.ViException: Error executing script for event OnSaving. ---> VI.Base.ViException: Error executing script 'UNSAccountB_OnSaving'. ---> System.InvalidCastException: Conversion from string "30.12.1899" to type 'Date' is not valid.
     at Microsoft.VisualBasic.CompilerServices.Conversions.ToDate(String Value)
     at DynScripts.Table_sgJcg5VHvySHcFHcAW7xmEyjKXg.UNSAccountB_OnSaving()

Thank you.

Regards,

Dnyandev

Parents
  • You should check the code of the OnSaving script und the UNSAccountB table. It seems that use some Date conversion of a string value without taking the current locale into account. That's why a German date format "30.12.1899" cannot be converted to a Date if the language (and culture) is switched to English.

    You haven't specified which version you are using so I assumed an 8.1 which does not contain such conversion code on the OnSaving script for UNSAccountB.

Reply
  • You should check the code of the OnSaving script und the UNSAccountB table. It seems that use some Date conversion of a string value without taking the current locale into account. That's why a German date format "30.12.1899" cannot be converted to a Date if the language (and culture) is switched to English.

    You haven't specified which version you are using so I assumed an 8.1 which does not contain such conversion code on the OnSaving script for UNSAccountB.

Children