How to insert data into Relational database

I have relational database. Product and Electronic.

A screen for user to insert a Product, then multiple insert of Electronic devices.

How can I insert a product and 2 x electronic devices in a form, by clicking on save button? 

Attached is my oml file.

Thanks in advanced.


Hi Joseph,

I did help you yesterday with another (basic) OutSystems question.

The question you now have gives me the idea, that you just started coding with OutSystems without following any kind of training.

As you are trying to develop a mobile application I would strongly suggest that you follow the following guided path:

https://www.outsystems.com/learn/paths/1/becoming-a-mobile-developer/

I am pretty sure that if you do this training, that most of the questions you had so far and al that will come, when you don't do the training, will be answered.



I did have a quick look at your module, if you only want to insert a product and 2x electronic device you have to:

- remove two aggregates (you only want to insert data not query data)

- create 1 local variable of type Product called 

- create 2 local variable of type Electronic 

- bind attributes of these local variables to inputs on your screen

- in the save screen action you have to cal CreateProduct and 2 calls to CreateElectronic

Regards,

Daniel

Solution

Daniël Kuhlmann wrote:

Hi Joseph,

I did help you yesterday with another (basic) OutSystems question.

The question you now have gives me the idea, that you just started coding with OutSystems without following any kind of training.

As you are trying to develop a mobile application I would strongly suggest that you follow the following guided path:

https://www.outsystems.com/learn/paths/1/becoming-a-mobile-developer/

I am pretty sure that if you do this training, that most of the questions you had so far and al that will come, when you don't do the training, will be answered.



I did have a quick look at your module, if you only want to insert a product and 2x electronic device you have to:

- remove two aggregates (you only want to insert data not query data)

- create 1 local variable of type Product called 

- create 2 local variable of type Electronic 

- bind attributes of these local variables to inputs on your screen

- in the save screen action you have to cal CreateProduct and 2 calls to CreateElectronic

Regards,

Daniel

Thank you for your advice and yes, i did went through the guided path and I must said it was a good start. But as much as I can learn, those are the basic and scenario given are straight forward. But to do different approach, will need to seek help from those who are more 'experience' and from this forum.


Anyway, I have attached the solution file here for those who need the same approach. Cheers!


Solution