Restrict by this parent company
Actions – Abstract
The Restrict by this parent company action restricts choices for one of the following attributes to business objects in an input form to elements with a specific relation to a given company account (referred to as 'This company' here.
The Restrict by this parent company action restricts choices for one of the following attributes to business objects in an input form to elements with a specific relation to a given company account (referred to as 'This company' here):
Starting point |
Target element |
Effects of restriction |
Company account |
Company (Combobox) |
|
Address (Combobox) |
|
|
Product (Combobox) |
|
►IMPORTANT◄ A 'restricted' target element can only feature options that would also be available in an unrestricted context, i.e. for which there is at least read access for the current session and that match the context of the current search (Company type or Product catalog type), according to the service configuration of the Combobox. Typically, the action will be used in situations where Company authorizations grant read-access to 'foreign' content. For company selections, an authorization to 'Use as involved' (per business objects type) may be required.
Settings:
The filter criterion for the restriction or the definition for This company, results from the context of the action. Technically this can be achieved either by placing the action in a behaviour of a company combobox or by linking a company combobox to a behaviour like Validate element as a target element.
The element to restrict must be linked as a Target element.
The option Include parent company is only relevant for selecting companies and controls if 'This company' should be listed as a choice together with its sub companies.
The option Restrict no value too controls whether the target element dropdown appears empty (without choices) if 'This company' is undefined (i.e. has 'no value').
The option For duplicates also defines if the action should be applied to one or all instances if the target element belongs to a Repeatable element container.
►NOTE◄ For a practical implementation, it is also decisive at which time or depending on which event in the form the restriction becomes effective or should be refreshed. It is necessary to consider, that the restrictions applied by the action are not cross-checked against existing choices for the business object. If a product choice for line items of a shipment is restricted by the choice for principal, it may be necessary to prevent a change of the principal account if line items have been entered already.
Configuration example:
This example is based on a very simple case of company hierarchy involving three accounts, which is described in a static text field inside an order form. Next to the company name, the company types (see Company type) assigned to each company account are listed in brackets.
On the right side of the form are two comboboxes where companies can be selected as Company type for the Principal and Consignee of the order.
According to the company types assigned to the company account, only companies 'Xflow' and 'Vortex' qualify as choices for Principal, whereas all companies qualify as Consignee.
However, the choice for Consignee should be restricted and based on the choice for Principal, so only direct child companies of the Principal company can be selected as Consignee.
This is achieved by configuring the following behaviour for the Principal combobox:
The behaviour is triggered by the Changed event and executes the Actions on "true" unconditionally, based on a Static behaviour. The changed company account will be given to the action.
The single action Restrict by this parent company is linked to the Consignee as a target element.
The option Include parent company is unchecked, since the company assigned as Principal should not be a choice for Consignee.
The option Restrict no value too is checked, to make sure that there are no options for Consignee without a selection for Principal.
Effects:
Depending on the choice for Principal, only the direct child company appears as a choice for Consignee:
No principal |
Principal: Xflow |
Principal: Vortex |
|
|
|
Alternative setting:
For a comparison here, the following results show choices with the Include parent company option checked:
No principal |
Principal: Xflow |
Principal: Vortex |
|
|
|