Working with flags

Flags can be used in forms in the context of behaviour and actions. These are freely nameable Boolean 'flags' that have precisely two states: 'set' or 'not set' (default value).

The creation of a flag does not require any special actions or declarations. Flags are created by simply 'referencing' them in the form design. The input field for flag names shows a dropdown list with all flag names that are already used in a form.

NOTE◄ If the name of a flag is adjusted, all 'references' within the form must be adjusted.

The state of a flag can only be influenced with the actions Set flag and Flag zurücksetzen.

Tip: By using the behaviour trigger Form data object changed (on form level), flags can be safely reset when new records are loaded into the form.

The Prüfe Flag behaviour evaluates the current state of a given flag, returning 'true' for 'set' and 'false' for 'not set'.
Based on this evaluation, the state of the flag can also be included in further logical link type behaviour.

Example:

A button should switch a symbol (image/icon) back and forth when clicked.

images/download/attachments/44941837/image2018-5-18_10_12_17-version-1-modificationdate-1580808817199-api-v2.png
Illustration: Output form

By configuring a behaviour for the 'Toggle' button, which reacts to 'Clicked', it is now possible to achieve a change of the image with the help of a fictional flag 'CHECK':

images/download/attachments/44941837/image2018-5-18_10_11_12-version-1-modificationdate-1580808817196-api-v2.png
Illustration: At (1) – With the Enter key or via a click on the plus symbol, a new flag can be defined

Checking whether the flag 'CHECK' (1) is set returns either 'true' or 'false'. Accordingly, by resetting 'CHECK' to 'true' (2) and setting 'CHECK' to 'false' (3), the 'CHECK' flag can be toggled on and off by repeatedly clicking the 'Toggle' button.

Finally, a behaviour can be defined at a central point (the form level is a good choice), which reacts to the change of the 'CHECK' flag and executes corresponding actions to change the image resource:

images/download/attachments/44941837/image2018-5-18_10_10_20-version-1-modificationdate-1580808817184-api-v2.png

The configured form behaviour 'flagCheck' is triggered as soon as the 'CHECK' flag has been changed. If the flag is set (checked at 2), the 'check mark image' (fa://fa-check) is loaded, otherwise the 'cross image' (fa://fa-remove) is loaded.

Executed

images/download/attachments/44941837/flagTogglingExample-version-1-modificationdate-1580808817169-api-v2.png