After upgrading to 9.6.007 virtual fields of type date in forms apps are not working anymore as expected.
In that version changelog there’s this entry:
“Fixed problem in formatting date/time fields when marked as a label.”
It’s not exactly my issue, but it makes me wonder if while fixing something related to dates, NetMake broke something else date related that was working…
Scenario to reproduce the error:
- A form with two date fields.
- One “real” (bound to the db) and one virtual created in the app.
- The fields are set to use the regional setting and display this date format: “dd/mm/yyyy”
- The form is run and both fields are populated with the same date:
- field_from_db = “23/04/2021”
- field_virtual = “23/04/2021”;
When read by any event, the fields return two different values:
- field_from_db = “2021-04-23”
- field_virtual = “23042021”;
The virtual one is obviously wrong and this was not happening before the upgrade to 9.6.007.
On one of the form events, my code reads the virtual field value and via sc_exec_sql() writes it in a db table date field. ‘23042021’ is not a correct slq date format and the db returns an error.
Again, this was not happening before the SC upgrade: the sql write was successful, hence the returned date value was formatted correctly.
Note that the “field_from_db” field in my example above is there only to be able to compare the behavior difference with the virtual field, I didn’t try, but I expect the issue to be detectable even with just the virtual field.