Set flag

See also: Unset flag, Working with flags

Actions – Abstract

The Set flag action sets 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 'true'.

images/download/attachments/189433245/image-2024-10-8_16-13-12-version-1-modificationdate-1728396792666-api-v2.png

The Set flag action sets 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 'true'.

If the flag in question was not set before the action was executed, the triggering event Flag changed is triggered, so that other behaviour can be executed within the form.

NOTE◄ Linking an element has no effect on this action.

Example

In a portal that is opened as a modal dialog on request, an 'account statement' (a list of all invoices and, if applicable, incoming payments) should be displayed for a customer determined by context when opening the portal. The relevant data series is obtained by a Tuple search (Form designer) behaviour, the results of which are written to a Repeatable element that is shown with the 'Grid' display type. If there are any irregularities in any row of the displayed 'History' regarding payment behaviour, a corresponding warning symbol will appear above the list.

Runtime example:

images/download/attachments/189433245/image2020-7-3_13-39-43-version-1-modificationdate-1728395709269-api-v2.png

  • The example shows several overdue invoices with incomplete incoming payments.

  • The relevant validation criteria are primarily checked when each 'row' is filled in the Repeatable element container.

  • At the time of the screenshot (06/26/2020), the invoice listed in the first position is not yet due. Therefore the second row appears selected.

  • For the selected row (in the detail area), the [!] symbol is displayed at the end of the row if there is an irregularity.

  • If there is an irregularity with at least one row, the 'thumbs down' symbol appears in the form header (see image above).

Configuration:

images/download/attachments/189433245/image-2024-10-8_16-19-29-version-1-modificationdate-1728397169231-api-v2.png

For the text field 'Outstanding', which displays the difference between the 'Amount invoiced' and the 'Payment receipt', a number of behaviours are configured as shown on the left. The expanded behaviour ('alert') is the only one that contain the Triggering event and actions, while the other two only provide check results for the Logical condition in the 'alert' behaviour:

  • The 'overdue' behaviour returns 'true' if the date the invoice is due is relative to the current date.


  • The 'outstanding' behaviour returns 'true' if there is a 'remaining amount' > 0.


  • The 'alert' behaviour reacts to the Triggering event Changed with the Change type 'Value set by program'. The behaviour therefore becomes active exactly when the calculation result for the 'Outstanding' amount is received in a row.


  • The Behaviour type Logical condition then checks whether the invoice is due and a balance is given.


  • Under the Actions on 'true', the Show element action initially makes the [!] symbol visible. Afterwards, the Set flag is executed with the Flag name 'paymentAlert'. The following behaviour for the respective Image/Icon element is only active for the first irregularity.


  • Under the Actions on 'false', only the Hide element ensures that the [!] symbol for an invoice without irregularities does not appear in the details area.

images/download/attachments/189433245/image-2024-10-8_16-24-44-version-1-modificationdate-1728397483952-api-v2.png

The 'thumbs down' Image/Icon is set to invisible when opening the form. The 'paymentAlert' behaviour shown on the left is configured for this element:

  • The behaviour reacts to the Triggering event Flag changed for the Flag name 'paymentAlert'. Since the default value of a flag is 'false' and the form does not provide an action to Unset flag, the behaviour is executed a maximum of once per 'session' with the form, namely when the first irregularity occurs, and the 'alert' behaviour (see above) sets the 'paymentAlter' flag for the first time.


  • Since the flag can only be changed from 'false' to 'true' in this case, the flag does not have to be examined by the Behaviour type Check flag. Instead, a Static behaviour type with the default value 'true' is sufficient, since the Actions on 'true' will be executed unconditionally.


  • Under the Actions on 'true', the Show element action makes the Target element with the name 'BAD' visible. This is the executing Image/Icon element itself.

images/download/attachments/189433245/image-2024-10-8_16-29-20-version-1-modificationdate-1728397760861-api-v2.png

In addition, the behaviour shown on the left is configured for the text input 'Outstanding', which sets the focus on 'Outstanding' in the first invoice with irregularites, and thus also ensures that its detailed data is immediately visible because the corresponding row is selected:

  • As a Triggering event, Flag changed is used again for the same flag 'paymentAlert'. This flag will only change state once, if at all, because it is not reset until the form is closed.


  • For this reason, the Behaviour type Static with the default value 'true' is used again, since the Actions on 'true' should be executed.


  • Under the Actions on 'true', Set focus to element sets the focus to the (executing) Target element 'Outstanding' in the 'row' that displays the data of the first overdue invoice in the list.