Boolean fields are all enterable (enabled) after conversion to project mode

The “not enterable” and “not modifiable” field properties have been removed in the conversion to project mode. The enterable property is converted to a form object property where the field is used on a form. The exception is Boolean fields - they are now enterable and enabled on every form.

There is not a form editor option to make the boolean field disabled by default. So it seems the only way to fix this is add code to every every form where the boolean field should be disabled.

Hi John,

I can see the problem with a new checkbox object as well. To me, this looks like a bug. We’ll go ahead and submit a bug report for you.

Add

Sorry I was wrong about the same behavior with a new checkbox object. I think this is what is going on. An object that appears as a checkbox is considered a button type of object. Instead of the Enterable property, it is controlled by the “Enable” property.

As a workaround, you can put the following code in the object method.

If (Form event code=On Load)
	OBJECT SET ENABLED(*;OBJECT Get name(Object current);False)
End if 

Anyway, I’m not sure if this is the new behavior or a bug but we’ll go ahead and submit a report for it.

Add

Could it have something to do with this message in the conversion log

“Field object whose field is defined in structure as ‘Display only’,
is converted as non enterable.”,

Did you check this log after conversion to project mode?
You might find more information under
https://doc.4d.com/4Dv18R3/4D/18-R3/Converting-databases-to-projects.300-4919320.en.html#4970855
in particular the “compatibility” section.

But that’s just a guess on my part.

Hi Add,

Thank you for submitting a bug report. I’m lucky I caught this before the pending version 18 production release. In version 17 the boolean fields are display only. In version 18 project mode the user can change them. This would have had some bad consequences for my application.

I’m hoping the fix means that boolean fields are treated like any other field. Here are a list of issues:

  • Every form field type is controlled by OBJECT SET ENTERABLE, except boolean fields. You have to use OBJECT SET ENABLED instead. OBJECT SET ENTERABLE should work on boolean fields.

  • There is no form property to control enterability/enabled for checkboxes in the form editor.

  • In conversion to project mode all of the boolean fields have “Expression Type” set to “Integer”. Seems like it should be boolean.

  • Changes to boolean fields (check boxes) only respond to the “On Clicked” event and not “On Data Change” event. How is changing a field value for a boolean field not a data change event where it is for any other type of field? This makes generic capture of form modifications very difficult. You can change a boolean field using the space bar. In 4D that is a “On Clicked” event, and not a “On Data Change” event.