Solved

Error in Tstamp Field When saving records


Userlevel 4
Badge +1

Hi all,

I have created a new screen & two new tables. But when I’m saving a record I got this error.  And now I can not access that screen. 

Error

Error: An error occurred during processing of the field Tstamp: Unable to convert MySQL date/time to System.DateTime, set AllowZeroDateTime=True or ConvertZeroDateTime=True in the connection string. See https://mysqlconnector.net/connection-options/.

Here is DAC Tstamp field.

    #region Tstamp
[PXDBTimestamp()]
[PXUIField(DisplayName = "Tstamp")]
public virtual byte[] Tstamp { get; set; }
public abstract class tstamp : PX.Data.BQL.BqlByteArray.Field<tstamp> { }
#endregion

 

Anyone know how  to fix this?

Thanks.

icon

Best answer by Naveen Boga 13 June 2023, 20:14

View original

13 replies

Userlevel 7
Badge +5

I’d try removing the PXUIField attribute. 

Userlevel 4
Badge +1

@Django I tried that. But still the same error.

Badge +11

According to the most popular answer to this question, it seems like the solution is present in the error.

 

If that is indeed the case, hats off to the error handler. I find actually useful, human-readable error codes to be the exception and not the rule.

Userlevel 4
Badge +1

@darylbowman So I need to do that in Mysql Server? How can I do that?

Badge +11

The connection string would be found in the web.config file at the root of your Acumatica site.

Userlevel 4
Badge +1

@darylbowman I will try it. Thanks!
 

Userlevel 4
Badge +1

@darylbowman What happen if I remove Tstamp field? Will it leads to errors in the future?

Badge +11

Since I’m not really familiar with MySQL, I can’t say for sure. I don’t think it’s a required field, but it sounds like the underlying issue would have something to do with datetime fields, which could potentially crop back up later.

Userlevel 4
Badge +1

@darylbowman Ok.Thanks for the idea.

@Django  Do you have any idea of this? What happen if I remove Tstamp field? Will it leads to errors in the future?

Userlevel 7
Badge +17

@charithalakshan49  Tstamp field is one of the Audit fields in the Acumatica tables and recommended to have it in the tables.

After adding the  ConvertZeroDateTime=True in the web.config → Connection String, is that issue resolved?

Userlevel 4
Badge +1

@Naveen Boga Thanks. I still do not have access permissions to do that. I will try it and will update the result  here.

Userlevel 7
Badge +17

Sure @charithalakshan49  After adding the above attribute in the web.config, assuming that issue will be resolved.

Userlevel 4
Badge +1

After adding the above attribute in the web.config file the issue was resolved.

Thanks All..!

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved