KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Choice List for Fields in Project Mode
PRODUCT: 4D | VERSION: 19 | PLATFORM: Mac & Win
Published On: April 4, 2023

A feature of 4D is the ability to have a choice list appear when entering a Table Field on a Form. The feature allows one of the lists in the database to be displayed as choices for the user to select. When the field is entered on the form a window will appear with the list to select one to fill the field automatically.

In Binary Mode, there are two ways to assign a choice list to a field. The first method is to automatically enable the choice list feature by using the field's properties in the Inspector window of the Structure Editor. Under the Data Entry Controls section, a choice list can be enabled and assigned to the field. Whenever the field is entered on any form, the choice list will be displayed.



The second way is to manually specify which specific field form objects should open the choice list. An input/field form object has a Choice List property under the Data Source section.



In Project Mode, the first method is no longer availble. The structure definition and properties are stored in the catalog.4DCatalog file. This file will not have a setting to store the choice list. While the UI is available in the Structure Editor, it does not have any function in Project mode. In Project Mode, the only way to assign a choice list is to use the second method and apply the list as a property of each desired input form object. During a conversion, any fields that have a choice list assigned will automatically have the list set to None and then the choice list applied to all input form objects with the field. This is mentioned as a warning in the conversion log, below is an example warning:

{
    "table": 1,
    "tableName": "Table_1",
    "form": "myForm",
    "object": "Field2",
    "message": "Field object whose field is associated in structure to a choice list, is converted using the same list in form object definition.",
    "severity": "warning"
},

There is no need to perform any changes with the warning, however, it should be noted that moving forward, any new additions of an input form object associated to the field will need to have the choice list applied manually in the object's properties.