Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A choice field provides several predefined options to choose from, and only one option can be selected.

In the SimpleOne interface, choice fields are displayed in two ways:

Section


Column

Drop-down list


Column

Radio buttons


Create a choice field


Open the table for which you need to create a column

This column database value can contain all kinds of symbols. If the string length is not set, then it is limited to 80 symbols.

To create a choice column, complete the following steps:

  • Navigate to the System Definition → All Tables.
  • .

  • Scroll down to the Related Lists area and click on the Columns tab.
  • Click New and fill in the fields.
  • Click Save or Save and Exit to apply changes.
  • Info

    You can also open the form this way:

    1. Navigate to System Definition → All Columns.
    2. Click New and fill in the fields.
    3. Click Save or Save and Exit to apply changes.

    Note that in this case, you will need to fill in the Table field manually.

    When creating a Choice column, in addition to the mandatory fields, you need to fill in the following fields:

    Reference to a tableExtra Attributes
    FieldMandatoryDescription
    Column TypetypeY

    Specify the Choice column type.

    MandatoryNSelect this checkbox to make the field mandatory (appropriate applicable for Choice columns with Choice Type type = Dropdown with -- None --).
    Type Specification tab
    Choice TabletableNSpecify a table that has a column with choice options.
    Choice fieldYSpecify a particular column of the Choice table that contains choice options.
    Choice TypetypeY

    Define whether the option "None" is  is applicable for the field. Available options:

    • Dropdown with --None--
    • Dropdown without --None-- (specify a default value)

    If the Dropdown without --None-- is chosenselected, the the Default Value tab becomes mandatory.

    Choice FieldYReference to a particular column of the table specified in the Choice Table field.
    Extra attributesN

    Enter the text below to apply the radio button style to the choice field:

    Code Block
    languagejs
    themeEclipse
    choice_decorator=radio

    Image Modified

    Default Value tab
    Default ValuevalueN

    The value of a choice option to be populated automatically by automatically by default. Check the value of a field in the Choice Options dictionary options (sys_choice) table.

    The field is mandatory if the Choice Typetype is Dropdown without --None-- (specify a default value).

    Use Dynamic Defaultdynamic defaultNSelect this checkbox if you need the value to generate dynamically. 
    Dynamic DefaultdefaultN

    Select the script from the Dynamic Default Values (sys_default_value_dynamic) dictionarytable, so its execution result will be automatically calculated and entered into this field. This value will be the default value for the column specified.

    This field appears only when the Use Dynamic Defaultdynamic default checkbox is selected.

    Note
    1. The script must be preliminary preliminarily created in the Dynamic Default Values (sys_default_value_dynamic) dictionarytable; otherwise, you will be not able to choose it.
    2. You can choose select only active scripts (the Active attribute is equal to Yes).


    Sources for choice options


    There are three ways to define a set of choices for the drop-down lists:

    • by inheriting values from a parent table (if the current table is a child to of another one).
    • by creating a set of records for this field in the Choice Options dictionary (sys_choice) table.
    • by defining a source table and its column in column in the Type Specification tab.

    In the second case, you may need to create a different set of choices if the column is inherited and has predefined options. See Overriding of choice options set for child tableColumn Override to learn more.

    In the third case, the available options are taken from a particular column of a source table. In the example below, the choice table Role contains a column Name and some records where Name is not empty. The choice options will be values of the Name column in this table.

    Create a choice option


    Note

    Before creating a set of options for a particular table and column, make sure that this column is already created (navigate to System Definition → Settings → All Columns).

    To create a choice option for a column table, perform the following steps:

    1. Navigate to the choice column, for which you need to create a set of options.
    2. Scroll down to In the Related Lists area and  navigate to , select the Choice tab.
    3. Click New, and  and fill in the fields.
    4. Click Save or Save and Exit to exit to apply the changes.
    Info

    You can also open the form this the following way:

    1. Navigate to System Definition Settings → Choice Options.
    2. Click New, and  and fill in the fields.
    3. Click Save or Save and Exit to exit to apply the changes.

    Note that in this case, you will need to fill in the Table and Column fields manually.

    Choice option form fields

    FieldMandatoryDescription
    TableY

    Specify the table to which this choice option is related.

    Select the same table for the translated choice version as for the original one.

    ColumnY

    Specify the column to which this choice option is related.

    Select the same column for the translated choice version as for the original one.

    TitleYType the translation title of the source field thereoption. 
    LanguageYSpecify the two-symbol name of the language (ru, en,  and and so on). Generally, references to languages are stored in the Languages (sys_language) table.
    ValueYType Specify the same value as specified for the source fieldof the option.
    OrderYEnter the number to define the option order in the choice list (options are arranged in the . Options are arranged in ascending order).


    Tip

    An easier A quick way to quickly create several options for the same column is to use Make a copy:

    1. After saving a choice option, change the Title, Value, Order fields values.
    2. After saving the record, enter the translation in the Title field and specify the language in the Language field.
    3. In the hamburger menu , choose select Make a copy. A copy of the current choice option record will be created and saved.

    You can also use the following way to create a translation for the choice options:

    1. Then click Make a copy. A copy of the current choice option for the specified language will be created and saved. 

    Note that the Value field has to remain unchanged.

    Overriding of choice options set for child table

    Override allows for changing choice options set for the child tables extended from the base table. For example, the parent table has the following options for a choice column State:

    • New
    • Rejected
    • Processed.

    An overriding can change the quantity of these options or their values in the child table. For example, the new set for the State field can be the following:

    • Draft
    • New
    • Assigned
    • Completed
    • Rejected.

    When creating a choice field option, it is recommended to set text values in the the Value field to increase code readability. For example, it can be incoming, or active, or failed values for Incoming, Active, and Failed choice options, respectively.

    Tip

    As for task states, it makes sense to make values numeric; this can help with selection construction in code

    .

    To create a new option set, perform the following steps:

    1. Navigate to the column for which you want to create a new set.
    2. Scroll down to the Related Lists area and choose the Choice tab.
    3. Click New and fill in the fields.
    4. Fill in the Table field with the name of the table for which you need to configure a new set of options.
    5. Click Save or Save and Exit to apply changes.
    Info

    You also can find the form this way:

    1. Navigate to the System Definition → Choice Options.
    2. Click New and fill in the fields.
    3. Click Save or Save and Exit to apply changes.
    Please note that in this case, you will need to fill in the Task and Column fields manually

    .

    To learn how to change the column attributes, refer to the Column Overriding article.

    Choice list translation

    You can provide a set of options for a choice field with localization, which will be displayed in the user's locale.


    To localize a choice list, please complete the steps belowTo create a translation for the choice options, complete the following steps:

    1. Navigate to System Definition → Settings → Choice Options.
    2. Click New and fill in the fields.
    3. Make sure the Value fields of an option in both languages are equal.
    4. Click Save or Save and Exit to apply changes.
    5. Repeat steps 2 – 4 for the rest of the options on the list.
    Tip
    1. Open the option for which you need to create a translation.
    2. Enter the translation in the Title field and specify the language in the Language field.
    3. Click Make a copy. A

    An easier way to quickly localize a set of options for the same column is to use Make a copy.

  • After saving a choice option, insert the translation in the Title field and specify the language in the Language field.
  • In the hamburger menu Image Removed, choose Make a copy. A
    1. copy of the current choice option for the specified language will be created and saved. 
    Note

    Note that the Value field has to remain unchanged. 


    Image Modified


    Image Modified


    Tipinfo

    If some of the choice options are not localized, then in a user locale other than English, the choice lists containing untranslated options will display them in English by default, regardless of the current user locale.To avoid this, please be careful when adding options to your choice lists.  


    Table of Contents
    absoluteUrltrue