Hide or Disable Rule
The Hide or Disable Rule uses the rule() keyword to conditionally remove an element from the selection menu (hide) or preserve it in the menu while preventing user selection (disable).
This functionality can be applied.
- On a bundle, hide a component to remove it from the selection menu, or disable a component to preserve it in the menu but prevent users from selecting options for it.
- On an individual product, hide an attribute to remove it from the selection menu, or disable an attribute to preserve it in the menu but prevent users from selecting options for it.
- On an attribute, hide or disable an attribute value to preserve it in the menu but prevent users from selecting options for it. For attribute values, the hide and disable rules have the same behavior.
In Visual Builder in Salesforce, for attribute values, only the hide rule is enabled. When you apply the hide rule to an attribute value in Visual Builder, the value appears in the menu but selections are disabled.
The hide and disable rules use this syntax, where action is replaced by either hide or disable.
In the example in this section, rules rely on specific variables to define the scope and target of the action.
| Variable in Rule | Purpose | Example from Generator Set | Description |
|---|---|---|---|
logic expression (Declaration) | Condition upon which the rule occurs. | requiredKW <= 500 | The logical test that triggers the action. |
action | Designates whether the rule is hide or disable. | "hide", "disable" | Determines if the element is removed from view or made unselectable. |
actionScope | Designates whether the rule acts on an attribute or relation scope. | "attribute", "relation” | Specifies if the target is a variable property or a component relationship. |
actionTarget | Designates the specific variable or relation that the rule acts on. | "Voltage", "StarterMotors" | The Constraint Modeling Language (CML) name of the attribute or relation. |
actionClassification | Designates whether the rule acts on a type or a value. | "type", "value" | Used when targeting components within a relation (type) or specific options within an attribute domain (value). |
actionValueTarget | Designates the specific type or value that the rule acts on. | "7976/13800", "StarterMotor_Advanced" | The specific string value or type name to hide or disable. |