Previous Topic

Book Contents

Book Index

Next Topic

Rule Type: View

The 'View' rule type is one of the most commonly used rule types. It can modify an editor (add/remove dynamic fields or tabs with dynamic fields) on the basis of attribute values and a defined condition. The 'View' rule type is usually used with trigger type B so that it is triggered when the editor gets opened.

Rule configuration

Brief overview of the rule configuration wizard for 'View' rule type:

Note: The description is based on the example of rule 'OrderItemDisabler'. Rule 'OrderItemDisabler' is applied to object type 'Order Item' to make sure that quantity cannot be changed if the order item is not pending.

  • Step 1 - Basic Rule Parameters

    Provide rule name and description, select rule type = 'View', assign the rule to an object type.

    In our example, the object type will be 'Order Item'.

    Help Image

  • Step 2 - Triggering type and condition for the rule

    Specify rule triggering. 'View' rules are usually used with trigger type B.

    Help Image

  • Step 3 - Specify view modifications

    Step 3 specifies what properties will attributes take on when the triggering condition is met.

    In our example, attribute 'Quantity' will not be editable.

    Help Image

Note: If you want to save changes in an editable structured dynamic field (which has been modified), it is necessary to enable the 'save' option by the 'VMWeb.EnableEditingOfDynamicStructureAttributes' main parameter. It is disabled by default. Also note that it is not possible to edit and save the structured attributes in the View Customizer.

Property Settings

The 'Properties for attributes' tab (image above) provides an overview of attribute settings. Double-clicking the attribute row in the 'Properties for attributes' reference catalog opens another rule customizer window in which the actual settings can be made.

Help Image

Buttons in the 'Properties for attributes' tab have the following functions:

Button

Function

Delete

Delete the selected attribute from the list

Edit

Alter attribute properties

New

Add a new attribute to the list. (Several attributes can be altered by the condition).

The following attribute properties can be modified:

Property

Function / Meaning

Attribute name

Attribute to which the properties will be applied.

Visible

An attribute can be removed from the view completely, depending on the condition evaluation.

Editable

An attribute can be enabled or disabled, depending on the condition evaluation. A disabled attribute is grayed out and cannot be edited. For example, if a certain status is reached, then the attribute cannot be edited any more.

Structured attributes cannot be edited in view by default (unless the 'save' option has been enabled by mainparameter 'VMWeb.EnableEditingOfDynamicStructureAttributes', applies also to Valuemation Rich Client). The only exception is the simple search view where structured attributes can freely be filled in.

Mandatory

The attribute will become mandatory when the condition is met. For example, if a certain status is reached, then the attribute must be filled.
Note that setting an attribute mandatory in the object type customizer takes precedence over mandatory settings in the rule customizer. This means that you can make an object-type non-mandatory attribute mandatory but you cannot make an object-type mandatory attribute non-mandatory by the view rule.

Max. length

Makes it possible to restrict the entered value length if the triggering condition is met.

Dialog for delete values?

If the rule removes an attribute from the view (i.e. changes the 'Visible' property from TRUE to FALSE), then property 'Dialog for delete values' is enabled. Three values can be set:

Yes - When the attribute is removed from the view, the value it holds gets deleted.

No - When the attribute is removed, the value it holds remains in the database.

Ask - Before the attribute is removed by the rule, a dialog box asking the user whether the value should be kept or deleted gets displayed.

The triple-state check boxes used in the editor have the following meaning:

TRUE

If condition TRUE, then attribute parameter set to TRUE

FALSE

If condition TRUE, then attribute parameter set to FALSE

GRAYED

Attribute parameter does not depend on the condition.

About Mandatory Attributes

Note that the following interplay between field mandatoriness and visibility comes into play:

  • If a field is set as mandatory in the view customizer or by a rule AND at the same time the field is set as not visible in the view, than the field's mandatoriness is ignored. This combination would be used for instance when an attribute is relevant only if some condition is met but once it is relevant, than it is mandatory.
  • If a field is set as mandatory on the database or object type level, than it remains mandatory even if it is set as not visible in the view. This combination would be used for instance when the value of a mandatory attribute is supplied internally (e.g. by a workflow) and the corresponding field is not visible to the user because the user is not allowed to change the value.

About View Rules Order

There is no given order in which view rules are executed, nor can it be defined. View rules are in essence status rules, their execution depends on attribute changes and its internal consistency must be assured.

View rules triggering is governed by attribute changes. When an attribute changes and there is a view rule whose triggering condition depends on that attribute change, the rule is triggered. If two or more rules are triggered by the change of the same attribute, the order in which these rules are triggered is given by an internal order which cannot be customized.

See Also

Rule Types

Rule Type: Validation

Rule Type: Calculation

Rule Type: Action GUI

Rule Type: Action Object

Rule Type: Starts an Action