Contained in service items
See also: Data service update, Get service items
The Behaviour type Contained in service items determines whether the value present as input data ($input) is included in the current service entries of an element in the group of List elements.
The Behaviour type Contained in service items determines whether the value present as input data ($input) is included in the current service entries of an element in the group of List elements.
If no element is linked, the service entries of the executing element are evaluated.
If an element is linked, the service entries of the linked element are evaluated.
If the element in question belongs to the group of List elements and the value available as input data ($input) is contained in the current service entries, this value is passed to the Actions on 'true'.
If the element in question does not belong to the group of List elements or the value available as input data ($input) is not contained in the current service entries, this value is passed to the Actions on 'false'.
►IMPORTANT◄ The Behaviour type only returns the entries currently loaded locally into the element by the data service. If the service configuration settings include paging ('Max. results' per loaded page), search restrictions, etc., these may affect the return value. Stable results can only be expected if a data service is used that does not use paging but always provides all configured entries 'statically' (e.g. based on a dynamic enumeration).
Example
An input form for Orders specifies that in an order's special text attribute ('Selected price list'), a unique identifier is given for the price list to be applied. The selection of the price list is done via a modal portal opened by a Button (see the 'globe' symbol), which will not be described in detail here. Each price list applies only to a specific sales area, which is defined by a whitelist of countries. Corresponding dependencies are regulated in the example Dynamic enum filters for the dynamic enumeration Country in connection with Association criteria. In the context of the order entry, the Association criteria assign a certain dynamic enumeration filter depending on the current value for the text attribute 'Selected price list', which then restricts the selection options for the Country (in the Combobox 'Country code') within the 'Principal Address' according to the selected price list.
Runtime example:
The Selected price list 'BENELUX_2020' selected here applies – as the name suggests – for the countries Belgium (BE), Luxembourg (LU), and the Netherlands (NL).
A Principle Address in Belgium was selected, which conforms to the restrictions for the 'Selected price list', as shown in the dropdown on the screenshot.
Due to the dynamic enumeration filter, only one country can be selected for the direct input of a new customer address, which is valid for a previously selected price list. However, the form does not require the selection of the price list to be made before a principal is specified. Nor does it prevent a different price list from being assigned after a principal has been specified. In addition, the Expandable element used for the principal's address not only supports the input of an address, but also the selection of existing address book entries by a dropdown. Therefore it can sometimes occur – as in the following example – that a country appears in the Country code field of a principal's address, for which the Selected price list does not apply:
Here, instead of the address entered in the previous example, a principal in Switzerland was selected from the address book.
The restrictions of the price list 'BENELUX_2020' still apply, as shown in the dropdown on the screenshot. However, the dynamic enumeration filter only affects the selectable countries (service entries), but does not prevent the country 'Switzerland' from being assigned as Country code according to the selected address book entry.
Without further provisions, an unsuitable combination of Selected price list and Country code can only be detected if both the Expandable element and the dropdown for the Country code are opened. As shown in the following screenshot, a corresponding message text should appear for the elements Principal Address and Country code when an unsuitable combination is present:
Configuration:
This section only describes the configuration with regard to the hint texts for which the behaviour type Contained in service items is essential.
|
As a basic mechanism for setting and deleting hint texts, a behaviour 'checkCountryPricelist' is set up for the Combobox element for the country ('Country code') as shown on the left:
|
|
The comparison between 'Price list' and 'Country' should not only be executed when changes are made for the 'Country' (see above), but also when the options (or service entries) for the Country change, because a new price list is selected. For this purpose, another behaviour 'countriesUpdated' is created for the same combobox 'Country code' and configured as shown below:
|