---
title: "addRecord"
manual: "TCA Reference"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3tca:tca-property-fieldcontrol-addrecord@main"
source: "ColumnsConfig/CommonProperties/FieldControl/AddRecord.rst"
modified: "2026-09-17T12:35:22+00:00"
---

# addRecord

-   **addRecord**

    -   *Type:* array
    -   *Path:* $GLOBALS\['TCA'\]\[$table\]\['columns'\]\[$field\]\['config'\]\['fieldControl'\]
    -   *Scope:* fieldControl
    -   *Types:* [group](https://docs.typo3.org/permalink/t3tca:columns-group@main)

    Control button to directly add a related record. Leaves the current view and opens a new form to add
    a new record. On 'Save and close', the record is directly selected as referenced element
    in the `type='group'` field. If multiple tables are [allowed](https://docs.typo3.org/permalink/t3tca:columns-group-properties-allowed@main), the
    first table from the allowed list is selected, if no specific `table` option is given.

    > [!NOTE]
    > The add record control is disabled by default, enable it if needed. It
    > is shown below the `edit popup` control if not changed by `below` or
    > `after` settings.

## Examples

### Select field

![](../../../Images/AutomaticScreenshots/SelectMultiplesidebyside6.png)

**EXT:styleguide/Configuration/TCA/tx_styleguide_elements_select.php**

```php
[
    'columns' => [
        'select_multiplesidebyside_6' => [
            'label' => 'select_multiplesidebyside_6 fieldControl',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectMultipleSideBySide',
                'foreign_table' => 'tx_styleguide_staticdata',
                'size' => 5,
                'autoSizeMax' => 20,
                'fieldControl' => [
                    'editPopup' => [
                        'disabled' => false,
                        'options' => [
                            'windowOpenParameters' => 'height=300,width=500,status=0,menubar=0,scrollbars=1',
                        ],
                    ],
                    'addRecord' => [
                        'disabled' => false,
                    ],
                    'listModule' => [
                        'disabled' => false,
                    ],
                ],
            ],
        ],
    ],
]
```

### Group field

![](../../../Images/AutomaticScreenshots/GroupDb1.png)

**EXT:styleguide/Configuration/TCA/tx_styleguide_elements_group.php**

```php
[
    'columns' => [
        'group_db_1' => [
            'label' => 'group_db_1 allowed=be_users,be_groups description',
            'description' => 'field description',
            'config' => [
                'type' => 'group',
                'allowed' => 'be_users,be_groups',
                'fieldControl' => [
                    'editPopup' => [
                        'disabled' => false,
                    ],
                    'addRecord' => [
                        'disabled' => false,
                    ],
                    'listModule' => [
                        'disabled' => false,
                    ],
                ],
            ],
        ],
    ],
]
```

### Select field with options

The field controls are also used in the core. The following example is from
the table `be_groups`:

![](../../../Images/AutomaticScreenshots/FileMountpoints.png)

**EXT:core/Configuration/TCA/be_groups.php**

```php
[
    'columns' => [
        'file_mountpoints' => [
            'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:file_mountpoints',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectMultipleSideBySide',
                'foreign_table' => 'sys_filemounts',
                'foreign_table_where' => ' AND {#sys_filemounts}.{#pid}=0',
                'size' => 3,
                'autoSizeMax' => 10,
                'fieldControl' => [
                    'editPopup' => [
                        'disabled' => false,
                        'options' => [
                            'title' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:file_mountpoints_edit_title',
                        ],
                    ],
                    'addRecord' => [
                        'disabled' => false,
                        'options' => [
                            'title' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:file_mountpoints_add_title',
                            'setValue' => 'prepend',
                        ],
                    ],
                    'listModule' => [
                        'disabled' => false,
                        'options' => [
                            'title' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:file_mountpoints_list_title',
                        ],
                    ],
                ],
            ],
            'authenticationContext' => [
                'group' => 'be.userManagement',
            ],
        ],
    ],
]
```

## Options

### disabled

-   **disabled**

    -   *Type:* boolean
    -   *Path:* $GLOBALS\['TCA'\]\[$table\]\['columns'\]\[$field\]\['config'\]\['fieldControl'\]\['addRecord'\]
    -   *Scope:* fieldControl -> addRecord
    -   *Default:* true

    Disables the field control. Needs to be set to `false` to enable the
    **Create new** button

### options\[pid\]

-   **options\[pid\]**

    -   *Type:* string
    -   *Path:* $GLOBALS\['TCA'\]\[$table\]\['columns'\]\[$field\]\['config'\]\['fieldControl'\]\['addRecord'\]
    -   *Scope:* fieldControl -> addRecord
    -   *Values:* marker or an integer
    -   *Default:* ###CURRENT_PID###

    pid of the new record. Can be an hard pid setting, or one of these markers,
    see [select foreign_table_where](https://docs.typo3.org/permalink/t3tca:columns-select-properties-foreign-table-where@main).

    Falls back to "current pid" if not set, forces pid=0 if records of this
    table are only allowed on root level.

    -   `###CURRENT_PID###`
    -   `###THIS_UID###`
    -   `###SITEROOT###`

### options\[table\]

-   **options\[table\]**

    -   *Type:* string
    -   *Path:* $GLOBALS\['TCA'\]\[$table\]\['columns'\]\[$field\]\['config'\]\['fieldControl'\]\['addRecord'\]\['options'\]
    -   *Scope:* fieldControl -> addRecord
    -   *Values:* name of the table
    -   *Default:* First table from property `allowed` / `foreign_table`

    Add a record to this table, falls back to first table from
    [allowed](https://docs.typo3.org/permalink/t3tca:columns-group-properties-allowed@main) list if not set for
    `type='group'` fields and to [foreign_table](https://docs.typo3.org/permalink/t3tca:columns-select-properties-foreign-table@main) for `type='select'` fields.

### options\[title\]

-   **options\[title\]**

    -   *Type:* string
    -   *Path:* $GLOBALS\['TCA'\]\[$table\]\['columns'\]\[$field\]\['config'\]\['fieldControl'\]\['addRecord'\]\['options'\]
    -   *Scope:* fieldControl -> addRecord
    -   *Values:* plain text label or [label reference](https://docs.typo3.org/permalink/t3coreapi:label-reference)
    -   *Default:* `LLL:core.core:labels.createNew`

    Allows to set a different 'title' attribute to the popup icon.

### options\[setValue\]

-   **options\[setValue\]**

    -   *Type:* string
    -   *Path:* $GLOBALS\['TCA'\]\[$table\]\['columns'\]\[$field\]\['config'\]\['fieldControl'\]\['addRecord'\]\['options'\]
    -   *Scope:* fieldControl -> addRecord
    -   *Values:* string
    -   *Default:* append

    Can be one of 'set', 'prepend' or 'append'. With 'set' the given selection
    is substituted with the new record, 'prepend' adds the new record on top of
    the list, 'append' adds it at the bottom.
