Uniface on GitHub
Fixes and Updates
we use Sql-Server as database, which use bit-type for boolean. We would like to use a tri-state Check-box. Unfortunately we have started to use $STORE_BOOLEANS_AS_FALSE in ASN-file, which stores null as 0 (false) for boolean-fields.My tri-state Checkbox works as I remove $STORE_BOOLEANS_AS_FALSE, ie. Checkbox On - 1 in databaseCheckbox Off - 0 in databaseCheckbox undetermined - null in database. (Actually bit can be null)
However using $STORE_BOOLEANS_AS_FALSECheckbox On - 1 in databaseCheckbox Off - 0 in databaseCheckbox undetermined - 0 in database. I dare not remove $STORE_BOOLEANS_AS_FALSE from ASN-file.Is there a way to use a tri-state Checkbox, having $STORE_BOOLEANS_AS_FALSE in ASN-file? Wanting to distinguish between leaving field empty and choosing No (false), do I have another choice than using a Radio-button?
you can also use a DropDownList to rapresent a tri-state condition.
To safely remove $STORE_BOOLEANS_AS_FALSE from your ASN file, you should add to ALL your those entities using boolean field(s), in the WRITE trigger just before the write instruction, one line of code like:if (myBooleanField = "") myBooleanField = 0That's not a trivial task!
a DropDownList is perhaps a clearer way, as tri-state Checkboxes sometimes are a bit confusing for the user. However the same problem there, ie. I can't save Boolean-type as null due to $STORE_BOOLEANS_AS_FALSE. But in this case, I can change it to an integer/numeric.
Hmmm, I will solve this by altering the boolean field to integer. Then I can use tri-state Checkbox.
© 2020 Uniface Privacy & Cookies | Privacy Statement | Legal