Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Field Sets entry
How-to guide

Creating and using Field Sets

Setup is two phases: define the field set in Object Manager, then reference it from Visualforce or LWC code. Most usage involves both an admin creating the field set and a developer consuming it.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated May 16, 2026

Setup is two phases: define the field set in Object Manager, then reference it from Visualforce or LWC code. Most usage involves both an admin creating the field set and a developer consuming it.

  1. Open Object Manager

    Setup, Object Manager, pick the target object. Click Field Sets in the left sidebar. The list shows any existing Field Sets for the object.

  2. Create the Field Set

    Click New. Enter Field Set Label, API Name, and Description. The description is critical; future admins need to know what consuming code expects from this field set.

  3. Add fields to the Field Set

    Drag fields from the In the Field Set panel onto the canvas. Reorder by drag. Mark fields as Required if the consuming code should treat them as mandatory at validation. Save.

  4. Reference from Visualforce or LWC

    Visualforce: <apex:repeat value="{!$ObjectType.MyObject.FieldSets.MyFieldSet}" var="f"><apex:inputField value="{!record[f]}"/></apex:repeat>. LWC: pass the field set name to a component that fetches and renders the field list via @AuraEnabled Apex or lightning-record-form.

  5. Iterate on the field set, not the code

    Once the code references the field set, admins extend or shrink the field list without redeploying. Document the field-set name in the consuming code so future admins know what page or component depends on it.

Key options
Required flagremember

Per-field setting inside the field set. Marks the field as required at validation in consuming code. The flag does not change object-level required-field metadata.

Field orderremember

Drag to reorder. Consuming code renders fields in the field-set order. Reordering changes the rendered output without code changes.

Available fieldsremember

Any field on the object can be added to the field set, including standard fields, custom fields, and formula fields. Cannot add fields from related objects without a custom Apex bridge.

Consumer typesremember

Visualforce (native support), Lightning Web Components (via Apex helper or lightning-record-form), managed packages (extension pattern), Apex (Schema.FieldSet introspection).

Gotchas
  • Field-level security applies on top of field sets. A user without read access sees the field as blank, not as removed.
  • Renaming or deleting a field that is in a field set silently breaks the field set. Audit field sets after schema changes.
  • LWC does not natively support field sets in lightning-record-edit-form. Use Apex helper or lightning-record-form for LWC.
  • Field Sets cap at around 50 per object and 100 fields per set. Hit these caps and the platform rejects the addition.
  • For standard Lightning record pages, Dynamic Forms is the better tool. Field Sets are for code-driven dynamic rendering, not for record layouts.

See the full Field Sets entry

Field Sets includes the definition, worked example, deep dive, related terms, and a quiz.