14
Views
2
Comments
Solved
Store One to One relationship

Hi,

I am trying to create one to one relationship between two entities.

I have two entity one is Employee and second is EmployeeProfile.

How can I achieved this functionality .


Thanks in advance

Regards

Piya

Rank: #89
Solution

Hi Piya,

See this document

https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Data_Modeling/Entity_Relationships/Create_a_One-to-One_Relationship


See this image

And When you insert record in this entity 

insert record first in Employee entity using CreateEmployee or CreateUpdateEntityEmployee

and this action return identifire of created or updated record 

use this ID and assign to EmployeeProfile identifire then your one to one relationship create.


see this image-


Hope this will help you.


Regards

Rahul

You can have the identifier type from the EmployeeProfile "Employee Identifier"  and use  the same value for each employee in both entities. 

There are other ways, but this works.

hope this help