Tuesday, 3 December 2013

Nullable Dates and Date Pickers

A null date in Gen (represented by datenum(0) or 01-01-0001) is valid and is often used to indicate that the date field is not set.

However most date picker controls do not support a null date - they always have a value, and so if you use a date picker OCX control, you may have to add an additional checkbox beside the date control to specify whether the date is set or not.

This workaround is easy enough to implement, but can be time-consuming if you need to implement it for many date fields across many windows and requires changes to the action diagram code to enable/disable the date control based on the setting of the checkbox.

With a conversion to Rapide, you may want to implement date pickers by default and still support null date values. To make conversion easier, Rapide now supports the concept of a nullable date picker.

This is simply done by checking the Nullable checkbox when defining the field:

The date picker is then implemented with an automatic additional checkbox to indicate if the date field is null or not.

Nullable date with no value set

Nullable date with value set

No comments: