Modifying detail record fields when adding new rows from the master form

I have a conventional master/detail setup where the master Add form allows you also to enter new detail records.

I also want to add some other calculated field data into the detail records.
I assumed I would do this in the Row_Inserting server event for the detail table.

However a simple test using..

// Row Inserting event
function Row_Inserting(?BaseEntity $oldRow, BaseEntity $newRow): ?bool
{
    $newRow['Notes'] = 'Test note';   
    return true;
}

.. does not produce anything at all in the 'Notes' field of the detail table record.

What am I missing?

Make sure you add your code for the detail table, not the master table.

It is in the detail table!

  1. Make sure the field name is correct, note that it is case-sensitive.
  2. In the generated code (models/YourDetailTable.php), make sure your code is generated.
  3. If you use v2026, make sure you have cleared cache, especially if you use production environment, read Clearing Symfony Cache.