Unset flag
See also: Set flag, Working with flags
Actions – Abstract
The Unset flag action resets the flag specified by the Flag name in the context of the form, so that the behaviour type Check flag, that refers to this flag, returns the check result 'false'.
The Unset flag action resets the flag specified by the Flag name in the context of the form, so that the behaviour type Check flag, that refers to this flag, returns the check result 'false'.
If the flag in question was set before the action was executed, the triggering event Flag changed is triggered, so that other behaviours can be executed within the form.
►NOTE◄ Linking an element has no effect on this action.
Example
The basis for the following example is the use case described in more detail in the example for Set flag. This involves displaying an 'account statement' for a specific customer in a portal, which compares invoices with any incoming payments.
The source data from a Tuple search (Form designer) behaviour is transferred by Populate element data into a Repeatable element, whereby criteria for a customer's poor payment behaviour are checked. If these apply to any of the invoices, a flag with the name 'paymentAlert' is set via Set flag, and a warning symbol is displayed in the form header (see below).
The original example does not allow the flag 'paymentAlert' to be unset at the form's runtime, because the form is opened modally for a specific customer account and the payment behaviour is evaluated once. The life cycle of the flag ends when the form is closed anyway. An extension is now provided to allow the source data – e.g. after booking an additional incoming payment – to be called again by clicking on a Button (see below) if the form is already open. Then the flag must be unset.
Runtime example:
Configuration:
|
The behaviour for loading the source data is configured to the newly added Button ('Reload data for 'Customer account') as shown on the left:
|
|
To ensure that the warning symbol is also hidden again when the flag is reset, the behaviour for the Image/Icon element concerned must be adapted as shown on the left:
►NOTE◄ As shown here, the Triggering event Flag changed can also be used to respond to the flag change at other positions within the same form. In more complex use cases, different effects can be configured for the 'decentralized' flag depending on the change of state. This may be clearer and easier to maintain than providing a long list of actions in a single centrally created behaviour (e.g. in the form element). On the other hand, the sequence in which actions are executed can be specifically influenced within a central behaviour. |