Versions Compared

Key

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

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

In the SimpleOne interface, choice fields are displayed as drop-down lists, as in the example belowin two ways:Image Removed

Section
Create a choice


Column

Configure a choice-type column for a table.

Sources for choice options

Learn what sources can define a set of options for a particular choice field.

Create a choice option

Configure choice options for a particular field via the new choice form.

Defining an override for choice fields

Change choice options for an inherited choice field in a child table.

Choice list translation

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

Create a choice column

Drop-down list

Image Added


Column

Radio buttons

Image Added


Create a choice field


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

When creating a

choice

Choice column,

 please complete the following steps:
  1. Navigate to the System Definition → All Tables.
  2. Open the table for which you want to create a column.
  3. Scroll down to the Related Lists area and click on the Columns tab.
  4. Click New and fill in the fields.
  5. 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.
Please note that in this case, you will

in addition to the mandatory fields, you need to fill in the

 Table field manually.Column form fields

following fields:

FieldMandatoryDescription
TableColumn TypeY

Specify a column type: Choice.

TitleYA column title displayed on the form. It is preferred to be sensible and human-readable. Latin, Cyrillic, [0..9] numbers, and the underscore symbol ( _ ) are allowed.Column NameY

A system column name. It is preferred to be human-readable and keep the kind of stored data. Latin letters, [0..9] numbers, and the underscore symbol ( _ ) are allowed.

CommentsNWrite a comment with the additional information.ActiveN

Select this checkbox, and customizing of this field displayed on the form and list will be possible.

If unselected, then such a field will be not available for choosing in Form Layout or List layout.

Read OnlyNSelect this checkbox to make the field read-only
Column typeY

Specify the

table name that will be a parent for this column. This field is a reference to the Tables dictionary (sys_db_table).

Choice column type.

MandatoryNSelect this checkbox to make the field mandatory
.Full Text SearchNSet this attribute equal to TRUE to make it possible to perform a Global Search against the current column.Display by RefN

When a record references to another record and the table or column containing this record has the attribute Display by Ref equal to TRUE, then the column value will be displayed.

If a table contains a field that has Display by Ref = TRUE, the value of this field will be displayed when referencing this table in the Reference field of the referencing table.

UniqueNWhen turned on, no way to add a record with a value of this field, if a record with the same value already exists.Type Specification tabChoice TableNReference to a table.Choice Type
(applicable for Choice columns with Choice type = Dropdown with -- None --).
Type Specification tab
Choice tableNSpecify a table that has a column with choice options.
Choice fieldYSpecify a particular column of the Choice table that contains choice options.
Choice typeY

Define whether the option

"

None

" is

 is applicable for the field. Available options:

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

If the Dropdown without --None-- is

chosen

selected, the

Dafault value

Default Value tab becomes mandatory.

Choice Field
Extra attributes
Y
N

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

Code Block
languagejs
themeEclipse
choice_decorator=radio

Image Added

Reference to a particular column of the table.

Default Value tab
Default
Value
valueN

The value of a choice option to be populated

authomatically

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

Type

type is Dropdown without --None--

 

(

must

specify a default value).

Use
Dynamic Default
dynamic defaultN
Check this box to display the Dynamic Default field.
Select this checkbox if you need the value to generate dynamically. 
Dynamic default
Dynamic Default
N

Select the script from the Dynamic Default Values (sys_default_value_dynamic) 

dictionary

table, 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 Default attribute is set to TRUE

dynamic default checkbox is selected.

Note
  1. The script must be
preliminary
  1. preliminarily created in the Dynamic Default Values (sys_default_value_dynamic) 
dictionary
  1. table; otherwise, you will be not able to choose it.
  2. You can
choose
  1. 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 columns 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 Defining an override for choice fields to Column 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.

Image Modified

Create a choice option


Note

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

To create a choice option for a column table, please 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 click on the , 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.

Please note 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.
HintNText hint. This field is not mandatory.
list. Options are arranged in ascending order.


Tip

A quick way to

Tip

An easier way to quickly create several options for the same column is to use Insert and StayMake a copy:

  1. After saving a choice option, inchange the Title, Value, Order fields values.
  2. In the hamburger menu Image Added, select Make a copy the burger menu, choose Insert and Stay. A copy of the current choice option record will be created .
  3. Change the Title, Value, and Order fields.
  4. Click Save or Save and Exit to apply changes.

You can also use this way to create a translation for the choice options. After saving the record, click Insert and Stay, enter the translation in the Title field and specify the two-symbol name of the language in the Language field. Please note that the Value field has to remain unchanged.

Defining an override for choice fields

Override allows changing column value and attributes in the child tables extended from the base table. For example, the parent table has the following options for a choice column State: Registered, Rejected, Processed. A column override can change the quantity of these options or the options themselves in the child table. For example, for the State new values can be Draft, New, Assigned, Completed
  1. and saved.

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

Regarding As for task states, it makes sense to make values numericalnumeric; this can help with selection construction (see the code sample below).

Code Block
languagejs
themeEclipse
titleaddQuery
task.addQuery('state', '>', '2'); // all states after In Progress

To create an override, please perform the following steps:

  1. Navigate to the column for which you want to create an override.
  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 an override.
  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.

If changing of the column attributes is needed, please perform the following steps:

  1. Navigate to the column for which you want to set up an override.
  2. Scroll down to the Related Lists area and choose the Column Override tab.
  3. Click New and fill in the fields.
  4. Click Save or Save and Exit to apply changes.

Column Override form fields

FieldMandatoryDescriptionBase TableY

Select the uppermost (in terms of inheritance) table containing the field to override.

TableYSelect the child table that will be affected by the override.ColumnYSelect a column to be overridden.Display by Ref OverrideNSelect this checkbox if you need to override the Display by Ref setting which is responsible for what column will be displayed instead of reference IDs.

Default Value Override

N

Select this checkbox to display the Default Value field, which overrides the default value for the field on the extended table.

After selecting this checkbox, the Default Value field appears. Enter the default value that will override the original one. 

Reference Qualifier OverrideN

Select the checkbox to display the Reference Qualifiers fieldset, which overrides the reference qualifier for the field on the extended table.

  • Reference - in this field, select a table to which the overriding column is referenced to.
  • Reference Qualifier Type - choose your reference qualifier type, is it Simple or Dynamic.
  • Reference Qualifier Condition - build a reference filter that will fit the necessary conditions.
  • Dynamic Reference Qualifier - if you have chosen the Dynamic type from the choice menu above, then select the appropriate one from the dictionary.
Mandatory OverrideNSelect the checkbox to display the Mandatory field, which overrides whether the field on the extended table must contain a value to save a record.Read Only OverrideN

Select this checkbox to display the Read Only field, which overrides whether a user can change the field value on the extended table.

Dependent on Column ID OverrideN

Select this checkbox to display the Dependent on Column field, which overrides the field on which the current field depends.

in code.

Choice list translation


To create a translation for the choice options, complete the following steps:

  1. Navigate to System Settings → Choice Options.
  2. Open the option for which you need to create a translation.
  3. Enter the translation in the Title field and specify the language in the Language field.
  4. Click Make a copy

Choice list translation

To localize a choice list, please complete the steps below:

  1. Navigate to System Definition → Choice Options.
  2. Click New and fill in the field.
  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

An easier way to quickly localize a set of options for the same column is to use Insert and Stay.

In the burger menu, choose Insert and Stay
  1. . A copy of the current choice option
record
  1. for the specified language will be created and saved. 
Note

Note

.
  • Enter the translation in the Title field.
  • Specify the two-symbol name of the language in the Language field.
  • Click Save or Save and Exit to apply changes.
  • Please note that the Value field has to remain unchanged. 


    Image Modified


    Image Modified


    Tipinfo

    If some of the choice options were are not localized (for example, some added choice options in English but didn't add their translations), then in user locale other than English, choice 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