How to create a CreateOrUpdate action when two or more tables have relationship?

How to create a CreateOrUpdate action when two or more tables have relationship?

We have three tables [1,2,3] and they're connected via a common Identifier. Two of them have a shared identifier [1,2] and one of them only have a connection to the other table [inheritance].

We're having trouble to create a CreateOrUpdate it seems not to work at all.

Thanks for the help.

Data.PNG

mvp_badge
MVP

Hi, 

1. You need first do the CreateOrUpdateEmpresa for the Empresa entity. 

2. After this in the logic, you need to assign the returned Id from the CreateOrUpdateEmpresa to the record of the Cliente entity, and then do the CreateOrUpdateCliente action, as this last one is an extension of the first, and so it needs the ID of the first as its own ID.

3. Than you can execute the CreateOrUpdateContato, as you need the returned ID from the CreateOrUpdateEmpresa as source to the EmpresaId foreign key in the Contato record.

Hope this helps

Cheers


I'm in the same situation, I understand the logic, but I don't know how to get the ID generated from the first table that was saved, to save the others in the sequence. 



how to get the returned ip? 


I found the solution in another post, thanks. 

https://www.outsystems.com/forums/discussion/69361/form-that-inserts-in-2-tables-of-data/

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.