Instead of writing internal script code to decide visibility or read-only properties of other fields based on selected values, it may be a simpler option to add a JavaScript expression in the Read-only or Hidden expressions in the properties for a field.
The Read-only and Hidden-expressions are basic JavaScript “eval” expressions that decide whether a field should be hidden or read only. See the table below for examples.
Info: Read-only and Hidden expressions support JavaScript notation to evaluate an expression. It supports field lookup, arithmetic and logical operators.
Field references must be enclosed in double curly brackets, for example {{field01}}.
Text fields in the expression must be of type Single Line.
Expression | Description |
---|---|
{{L301}}=="HIDE" || {{selector}}<2 | Match if the L301 field value is "HIDE" and the numeric field selector is less than 2. |
({{V01}} / {{V02}}) *100 < 50 | Match if the numeric field V01 is less than 50% of V02. |