FormsModel-driven app

Field states

How a field shows that it is required, recommended, locked, read-only or hidden, so people know what they can and must fill in.

Show me in the demoOpens the demo app with this component highlighted.

What it is

A field on a form can be in different states. A business required field has a red asterisk and blocks saving until filled. A business recommended field has a blue plus and doesn't block saving. A locked field is greyed out and can't be edited right now. A read-only field is always display only. A hidden field is not shown at all until something makes it visible.

When to use it

Use required only for data a process can't work without. Use recommended to nudge people toward data you would like. Use locked or hidden to guide people through a state, for example locking a field after approval. For rules that depend on other values, use Business rules rather than a script.

Licensing and configuration

No extra licence. The requirement level (Optional, Business Recommended, Business Required) is set on the field in the form designer or on the column. Read-only and Hidden are properties of the field on the form. Making a field required, locked or hidden conditionally is done with business rules or with client scripting (formContext.getAttribute(...).setRequiredLevel(...), setDisabled, setVisible).

Pitfalls

  • A field set to required on a form is required on that form only. The same column on another form or in an import can be empty.
  • A hidden field that is business required can still block saving, and users can't see why.
  • A field that looks locked may be locked by a business rule, a script or field-level security. Check all three.
  • Business recommended fields are easy to ignore unless people know why they matter.

Try it in the demo

  1. Open the first accelerator and find the red asterisk and the blue plus.
  2. Try to edit the locked field and note that you can't.
  3. Turn on the toggle that reveals the hidden field.