Override Field Properties in a Form

For each field on the page, you can set some properties to override the values set by lower-level rules, .

These properties include:

  • Required – Make required or optional
  • Hidden – Visible or hidden
  • Read Only – Editable or read only
  • Value – Static or expression

If more than one rule impacts a given field, it can be tricky to sort out what is finally displayed at runtime to each user group; Understand What Will Be Shown at Runtime can help you.

To set a property on a field:

  1. In the business rules editor, select the form rule you want to configure.
  2. Locate the field you want to modify.
  3. Click the dash—or an existing value—in the appropriate column, and select a new value for the property in the dropdown list.

    For example, you can modify a field’s Hidden property by selecting Visible or Hidden in the dropdown:



    VB automatically saves your work for you, so there's no need to do so explicitly.

    If you change your mind after setting a property, use the Remove Override option to remove your setting and restore the property to its original value.

    Descriptive Flexfields (DFF) and Extensible Flexfield (EFF) sections (or contexts), when shown, are treated like any other fields; that is, you can set the Required, Hidden, Read Only, and Value properties for them as needed.

    Remember that the Default rule is always active, which establishes the out-of-the-box behavior. All other built-in are essentially overriding what is specified in the Default rule. If none of the other rules evaluate to true, then the only overrides applied are those defined in the Default rule.

    Note:

    A field marked as hidden can still be rendered as visible at runtime. For example, suppose when a page's rules are evaluated, a given field is both required, which means it must have a value, but also hidden. In addition, the field does not have a default value, which means that the user must supply a value explicitly. But how can the user supply a value if the field is hidden? To protect users from encountering this quandary, VB will show the field even though it is marked as hidden, thus allowing users to enter a required value and move on from the page.

Set a Default Value for a Field

Use the Value property in a business rule to set a default value for a field.

Suppose you have a form in which the user can enter a currency in the Currency Code field. If the user doesn't enter a value—that is, if the field is empty at runtime—you can populate the field with a default value. You can accomplish this by using the Value property to set the field to, say, "euro", if the user is in Italy. When the user updates the form and clicks Save, the value "euro" is saved in the field, unless the user changes it to something else.

If the business rule sets the field to Read Only, of course, the user won't be able to change it. But if the field is editable, the user can change the value simply by updating the field.

To set a value for a field:

  1. In the Fields and Regions editor, find the field you want to modify.
  2. Click the dash in the Value column to open a popup dialog for setting the value.


    If there’s already a value set for the field, click the value and select Edit Value in the popup menu. You can also select Remove Override in the menu to remove the value.

  3. In the popup dialog, do one of the following:
    • Select Clear Field Value to remove any default value already set for the field by other rules. For example, you can use this option to remove the value set by the Default built-in rule. When the rule is applied, this option makes the field's value empty (the value is set to null).
    • Select Set Field Value to enter a default value for the field, which can be:
      • A static value (like "euro"), or
      • An expression which typically uses one or more different variables (like $fields.BudgetDetails.CurrencyCode.$value()) to calculate the actual value shown at runtime. When you use an expression, the value is recalculated if a variable referenced in the expression changes.

        To help you create your expression, you can click (x) and select variables from the list:



        If you want to create a more complex expression, click Use Advanced Expression to open the expression builder. See Build Advanced Expressions for more on how to use the expression builder.

    Note:

    If you see a lock, this means the field has been locked by the Default built-in rule, and you can't override it. Values that should not be overridden might be locked by Oracle.

At runtime, if the business rule's conditions are met, the field will show the value set in the popup.

What Do the Blue Indicators Mean?

Indicators in the Regions and Fields area help you see at a glance what has been changed.

In this example:
Description of metadataindicators.png follows
Description of the illustration metadataindicators.png
  1. An empty blue circle next to a region (When & Why Section) indicates that while the region itself does not have a property overridden, at least one field in the region does.
  2. The number in parentheses next to the region indicates the number of fields in this region that has overridden properties.
  3. A blue dot next to a field or region indicates that there is at least one overridden property at this level.

Locks, Blanks, and Dashes

Let's take a look at what the lock icon, empty spaces, dashes, and grayed text mean in the context of a given rule.

The extent to which these attributes are displayed depends on the type of rule you're looking at. The default rule, for example, always shows the property values as set by Oracle. If nothing has been overridden, the values for the Required, Hidden, and Read-Only properties are always Optional, Visible, and Editable, respectively.

For all other rules:
  • A dash indicates that a value has not yet been set for the property by this rule. At runtime VB Studio evaluates all the rules from bottom to top, so a property setting for one rule can be overridden—and then overridden again—by rules that are higher up in the list.
  • A lock icon means that a value has been locked by Oracle and cannot be overridden. (Any property value that appears in light gray is an Oracle-seeded value.)
  • Blank fields represent system fields that are not available for modification by anyone.