Null value conversion does not appear to work - help please

Hello

In this part of the training

https://success.outsystems.com/Documentation/11/Reference/Integration_Studio/Element_Properties_Reference/Entity_Properties

- the documentation refers to a function that we cannot get to work for us.  The document states:

"Convert to/from Null value in Database: all the entity's attributes that have the default value set are stored in the database with the null value. When retrieving data from the database, the null value is converted to the attribute's default value. If no default value is defined for the attribute, the null value is then converted to the Platform default value for the data type."

We are using a MySQL database outside of OS and this function does not seem to work for us. What are we doing wrong?  What do we need to activate this functionality?

Steven

Hi, Steve

Exactly which part is not working? data is not being saved with default platform value?

Regards

Gustavo Gonçalves

Gustavo Gonçalves wrote:

Hi, Steve

Exactly which part is not working? data is not being saved with default platform value?

Regards

Gustavo Gonçalves

Hello Gustavo

Thanks for your reply. This is where we are:

1. 

- We access a record in the MySQL database that has a NULL value for the deleted_date 

- we change one of the field values (not the deleted_date) and save the record

- OS changes the deleted_date in the record as the the OS NULL DATE surrogate date 

2. 

However another member of the team today did something different:

- I believe it was something like changing the data we want to change PLUS if deleted_date does not have a valid date then deleted_date = null date 

This then seems to save the deleted_date in the database correctly as NULL.


This has to be confirmed, and in the morning we are going to experiment to discover is 2. works generally and if so it will probably resolve our problem. We will update tomorrow.

Thanks again for your interest.

Steven

Steven,

I was reading a post here on the forum about Null values (1). In it an MVP outsystems says: "OutSystems does not support null values stored in memory, however it does allow you to store NULL values in the database if you use SQL queries." and quotes another forum post (2) that might help you.

links:
1. https://www.outsystems.com/forums/discussion/49692/how-to-handle-nulldate-or-no-date-values-from-input-to-database/
2. https://www.outsystems.com/forums/discussion/33882/null-value-decimal/#Post184472

Regards

Gustavo Gonçalves