Ability to create rows in a table when creating a record in another table

Ability to create rows in a table when creating a record in another table

peterbrownepeterbrowne Posts: 314Questions: 54Answers: 0
edited February 2020 in Editor

Is there functionality in the editor that when creating a new record in one table, to add multiple records in another table, that are then related to the new record being created?

So, the scenario is:

In the process of creating a new record in table 'unit', where the editor has name field etc for the new 'unit' record. Underneath 'name field is a another field input to add a 'unit outcome' for that new unit. The 'unit outcome' field creates a new record in table 'unit_outcome' that is automatically related through foreign key to the created 'unit' record. In addition, there needs the ability to add multiple 'unit_outcomes' fields in the editor by using something like a + button. So the abillity to create an infinite number of unit_outcomes for the unit at the time the unit is created which are all related to the new unit.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Currently, the only way to do that is to use a postCreate server-side event. While there is some multi-db-table editing ability in the libraries, they aren't particularly great at this sort of thing and need to be fleshed out a bit.

    Allan

This discussion has been closed.