[SOLVED] NULL values in database when form field left blank

Good morning everyone.
I have noticed that since the latest versions, SC no longer correctly handles form fields set to NULL, especially in the OnAfterUpdate event.

In previous versions, if a form field was set to NULL on insert and update and the user left it blank while filling out the form, the corresponding database field was set to NULL, and the SC field value remained empty.

In the latest versions, however, SC assigns the string ‘NULL’ to the form field value as well. But it does not do this consistently. It depends on the event in which you examine the field value. For example, if you check it in the OnValidate event, an empty field has an empty value. If you check it in the OnAfterUpdate event, an empy field is set to the string ‘NULL’.

This creates quite a bit of confusion because the field value differs depending on the event in which it is evaluated, making also some macros, such as SC_CHANGED, impossible to use.

3 Likes

@maxi,

We have performed some tests and identified the problem that you reported above.

The case has already been forwarded to the responsible team and as soon as the fix is ​​released, we will provide feedback through this topic.

Best regards!

Thanks Danilo.
I have reported the same via official support.
Waiting for the patch to fix it.

Regards
Max

@maxi,

The fix was released in version 9.12.002, which is now available for download/update.

Best regards!

Thank you very much Danilo.
This is good support !!!

Regards, Max