Skip to main content

Overview

The ConfigurableForm component (PF-17) provides a dynamic, configuration-driven form renderer that eliminates the need for hardcoded forms. It supports:
  • Standard fields from entity table columns
  • Custom fields from pf_custom_field_definitions
  • Picklist-based selects from pf_picklists
  • Lookup fields for entity references (accounts, customers, etc.)
  • Field visibility based on roles and conditional rules
  • Configurable layouts with sections and column spans

Quick Start

Basic Usage

Props

Field Types

Standard Field Types

The following types are supported in STANDARD_FIELDS:

Adding Select Fields with Picklists

To use a picklist for a select field, add picklistName to the field definition:

Adding Lookup Fields

Lookup fields reference other entities. Configure them in LookupFieldRenderer.tsx:

Database Configuration

Field Configs Table (pf_entity_field_configs)

Each visible field needs a config entry:

Custom Fields

Custom fields are automatically included when:
  1. They exist in pf_custom_field_definitions for the entity type
  2. A config entry exists with field_source = 'custom'

Migration Example

Converting an existing form to ConfigurableForm:

Before (Hardcoded)

After (ConfigurableForm)

Fallback Behavior

If no field configs exist for an entity/context, ConfigurableForm falls back to rendering all fields from STANDARD_FIELDS in a default layout.

Best Practices

  1. Seed field configs for all view contexts - create_form, edit_form, detail_view, list_view
  2. Use meaningful section names - Groups fields visually in the UI
  3. Set column_span = 2 for full-width fields like textarea
  4. Configure conditional_rules for dependent field visibility
  5. Use picklists instead of hardcoded select options for flexibility

Architecture