Associating object of two entities

0
Hi fellow developers, i have created two domain models parent and child with a single entity name in both, and have filled data in both the domain models. Now i want to create an association between these two entites and want a UI through which i can select one name from parent and link it with various child names i want.  The issue i am facing is i have already created names for both domain models and i am unable to find a way to link already created data of both the domain models
asked
2 answers
0

Hi there

 

I think there is some confusion in your terminology, so let me clear it out for you real quick:

  • Domain model: the entirety of entities of a module or across modules if you are talking about the domain model of your entire app
  • Entity: a table of data. E.g., the employee entity (where all employees are saved)
  • Association: a link between two entities. E.g., employee_business_department (where business departments are linked to employees)

 

What I interpreted from your question is that you have two entities (a parent and a child) which you want to associate to each other. 

This can be done within your domain model by going to your child entity > associations and selecting a new association:

image.png

 

Once you have done this, you can generate overview pages for your entities by right clicking the child entity and clicking 'Generate overview pages...':

image.png

 

This will create a page for you where you can select the parent. It should look somewhat like this: 

image.png

 

You can use this page to create new children, as well as edit existing objects that already exist within your database.

 

As it looks like you are a bit new to this, I advise you take a look at these interesting learning paths to sharpen your Mendix knowledge!

https://academy.mendix.com/link/paths/31/Become-a-Rapid-Developer 

https://academy.mendix.com/link/paths/56/Create-an-App-with-Advanced-Page-Building

https://academy.mendix.com/link/paths/59/Expand-Your-Domain-Modeling-Skills

Good luck and go make it!

answered
0

I think you didnt get what i wanted to ask or maybe i framed it wrong, i dont want to edit the data, i just want to associate the already existing data in both the domain models with each other. Like Entity1 data i wanna bind with Entity2 data.

The problem i am facing is i dont know how to bind already existing data of two entities.

answered