Save record One To One relation

Hi everyone!


I created a Person and Address entity, the relationship between them is "OneToOne", but how can I save the data? Could anyone provide an example?


I'm using the "CreateOrUpdatePerson" method, I imagine that Outsystems is in charge of saving the relationships, am I correct?


Thank you!

Marcelo

Solution

Hi Marcelo,

How did you specify the OneToOne Relation?

After calling CreateOrUpdatePerson you have to call CreateOrUpdateAddress. And it might be that you have to assign the PersonId output parameter of CreateOrUpdatePerson to your Address.PersonId or Address.Id.

Hans


Solution

Hi Marcelo,

After calling CreateorUpdatePerson please call CreateorUpdateAddress and assign its id equal to the Id return by CreateorUpdatePerson along with Address entity attributes like below:

Hope it will help you!!

Cheers,

Krushna

Hello Krushana and Hans,

Obrigado!


Desculpe, eu estava pensando que Outsystems faria isso, já que ele conhece as relações entre as entidades.


Muito obrigado!