Understand What Will Be Shown at Runtime

At runtime, VB Studio evaluates all the rules from bottom to top, starting with the Default rule, then moving through the built-in rules and ending with the extension rules (if any) .

As long as a rule's conditions are met at runtime, the rule's property values are applied to the display. However, since rules are evaluated one at a time (starting at the bottom), the topmost rule effectively takes precedence, as it can override what was previously set by lower rules.

To help you evaluate what will be shown for fields and regions at runtime, the editor provides a pop-up viewer. To display the pop-up viewer, hover over the field or region until you see an info label, then click it:



The pop-up viewer shows all the active rules that modify a region's properties, or a field’s properties within the same region:
Description of metadatasoniapopup2.png follows
Description of the illustration metadatasoniapopup2.png

Let's take a closer look at the pop-up viewer:
  1. Name of the field (Organization Name) and the region (Detailed department) that these rules pertain to.
  2. Currently viewed rule, which is shown with a blue background. The conditions for each rule appears beneath the rule's name.
  3. Another rule. If a rule name appears in blue, you can click it to see all the fields/regions modified by that rule (as opposed to just the selected field or region).
  4. The Default rule, which specifies the out-of-the-box behavior. The Default rule is always active and cannot be modified. And since it doesn't have any conditions, it will always be considered "true".

Interpret the Pop-Up Viewer

Let's examine the rules for the Organization Name field to see how it would appear to two different users: first, a buyer in Canada, and then a buyer in Argentina.

The pop-up viewer shows that three rules have modified the Organization Name field in the Detailed department region:
Description of metadatasoniapopup3.png follows
Description of the illustration metadatasoniapopup3.png

Let's suppose the current user satisfies the conditions for the Buyer in Canada rule, that is, they have the Buying Role "Supporting role" and are located in Canada. What will he or she actually see on the page?

Let's begin by looking at the first rule that is evaluated, the Default rule, which is a built-in rule that is always applied. The properties for the Organization Name field are set to Optional, Visible, and Editable, and no value is set for the field. None of these properties are locked in the Default rule, so they can all be overridden by rules above it.

Moving up from the Default rule, the Buyer in Argentina rule is not enforced because it's conditions aren't met (the current user is in Canada.)

Moving up to the Buyer in Canada rule, our current user satisfies the rule's conditions, so this rule will be enforced, overriding the properties enforced by lower rules (in this case, just the Default rule.)
  • The Required property does not have a value enforced by this rule, as indicated by the dash mark. Moving down the Required column, the next rule (Buyer in Argentina) doesn't enforce a value for this property because its conditions aren't met, so we look to the Default rule, which enforces a value of Optional. So, for the buyer with the "supporting role" located in Canada, the Organization Name field is optional because no rule overrides the value set in the Default rule; in other words, the user doesn't have to supply a value for this field before submitting the form.
  • Now let's scan the Hidden, Read Only and Value columns in the rule. Two of these have values that are enforced by the rule, overriding values set in lower rules; that is, the Hidden property is set to Visible, and the Value property is set to an expression. The rule doesn't set a value for the Read Only property.

For buyers with a "supporting role" in Canada, then, the Organization Name field will be visible and its value set to an expression (as the field is not Read Only, the user has the power to change the value.)

Now let's see what happens at runtime if the user is a buyer with the "supporting role" but located in Argentina, rather than Canada. Once again we start with the Default rule, which sets the properties described above.

Then we move up to the next rule, Buyer in Argentina. This time, both conditions are satisfied, so let's look at what this rule does:
  • Once again, this rule does not enforce a value for the Required property. Continuing down the column we reach the Default rule, which states that the Organization Name field is Optional for these users.
  • Likewise, the Hidden property does not have a value, so we take the value from the Default rule, Visible.
  • The Read Only property is set to Read Only, overriding any value set in lower rules (just the Default rule, in this case).
  • The Value property is set to an expression (this expression is different from the one set in the Buyer in Canada rule.)

Moving up to the Buyer in Canada rule, this time the conditions for this rule are NOT satisfied, because the user is not in Canada, so this rule is not enforced.

In summary, buyers with the "supporting role" in Argentina can see the Organization Name field, but, unlike their counterparts in Canada, it is read only, and its value might be calculated differently.