> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Fields Integration Status

> This document tracks the integration of CustomFieldsSection (PF-16) into entity forms.

## Overview

This document tracks the integration of CustomFieldsSection (PF-16) into entity forms.

## Forms Using ConfigurableForm (Automatic Custom Fields)

Forms migrated to ConfigurableForm automatically include custom fields:

* ✅ **hr\_employees** - EmployeeFormDialog (uses ConfigurableForm)
* ✅ **fa\_customers** - CustomerForm (uses ConfigurableForm)

**Note:** ConfigurableForm's DynamicFormRenderer automatically renders custom fields when:

* Field configs exist with `field_source = 'custom'`
* Custom field definitions exist for the entity type
* Field configs have `is_visible = true` for the current role

## Forms Needing CustomFieldsSection

For forms that haven't been migrated to ConfigurableForm, add CustomFieldsSection:

**Example:**

```typescript theme={null}
import { CustomFieldsSection } from '@/platform/custom-fields';

export function MyEntityForm({ entity, onSubmit }) {
  const form = useForm({...});
  
  return (
    <Form {...form}>
      {/* Standard fields */}
      <FormField name="name" ... />
      
      {/* Custom fields section */}
      <CustomFieldsSection
        entityType="hr_employees"
        control={form.control}
        title="Additional Information"
      />
      
      <Button type="submit">Save</Button>
    </Form>
  );
}
```

## Integration Checklist

* [x] hr\_employees - EmployeeFormDialog (via ConfigurableForm)
* [x] fa\_customers - CustomerForm (via ConfigurableForm)
* [ ] Other entity forms (add CustomFieldsSection as needed)

## Notes

* ConfigurableForm automatically handles custom fields - no separate component needed
* CustomFieldsSection is for non-ConfigurableForm forms only
* Custom fields are stored in `custom_fields` JSONB column
* Field definitions are managed at `/settings/custom-fields`
