Create records in a One to many relation using forms?

Create records in a One to many relation using forms?

  

Hi, I have to following situation. I have a table "Persons" and another one called "Phones". I want to be able to register a person with zero or more phones. The tables are in a one-to-many relations.

Can I use forms to submit multiple phones to the database?  and How can I do it? or any suggestions on how to solve the issue?

Cheers 

René


Hello rene,

You have what we call a "master detail" situation.

In OutSystems you can easily do that in the following way:

1. Drag & Drop the "Persons" entity twice to the (Main) Flow. It will create for you two Web Screens: Persons and PersonsDetail.

2. In the PersonsDetail, you can Drag & Drop the entity Phones bellow the buttons (Save and Cancel), outside the Form. It will create for you a table of phones, for the person being edit/create, with all the logic to do that (including a PopUp Web Screen do add/edit new phones). This table will appear only when you save the person (or if you are editing an existing Person).

I think you should consider doing the Online Training or a local course/bootcamp. You will learn this and much more :)

Hope this helps.

Cheers,
Eduardo Jauch

Solution

Eduardo Jauch wrote:

Hello rene,

You have what we call a "master detail" situation.

In OutSystems you can easily do that in the following way:

1. Drag & Drop the "Persons" entity twice to the (Main) Flow. It will create for you two Web Screens: Persons and PersonsDetail.

2. In the PersonsDetail, you can Drag & Drop the entity Phones bellow the buttons (Save and Cancel), outside the Form. It will create for you a table of phones, for the person being edit/create, with all the logic to do that (including a PopUp Web Screen do add/edit new phones). This table will appear only when you save the person (or if you are editing an existing Person).

I think you should consider doing the Online Training or a local course/bootcamp. You will learn this and much more :)

Hope this helps.

Cheers,
Eduardo Jauch

Thank you Eduardo Jauch for the reply, found it helpful. 


Solution

I'm glad I could help :)