Support > Repository > Parent-child relationship > Link multiple parents to one child
ja | en

I will explain an example of a child model "warehouse stock" that refers to two parent models "warehouse" and "item". R7.6

Indicates the relationship between material model, warehouse model and warehouse inventory model.The warehouse inventory model maintains the primary key of the parent item model, warehouse model, and manages them as its composite primary key.

Figure 1 Relationship between item, warehouse and warehouse inventory

Warehouse model

Data examples of the warehouse model are shown below.

Figure 2 Warehouse model

Material model

Here is an example of the data of the material model.

Figure 3 Item Model

Register warehouse inventory model - From warehouse

We will create a warehouse inventory model (child) from the details screen of the warehouse model.

Figure 4 New creation of warehouse inventory model

The parent warehouse is confirmed at this point.

Figure 5 Parent (warehouse) is set as initial value

Set the material manually, which is the other parent.Since the item is a primary key, it is a rule that you can not register it because it is not set.

Figure 6 Setting items

Registration of the warehouse inventory model that is a child has been completed.You can transition to any parent screen.

Figure 7 Warehouse inventory model registration completed

Register warehouse inventory model - From item

Now we will create a warehouse inventory model (child) from the detail screen of the item model.

Figure 8 New creation of warehouse inventory model

The parent item is fixed at this point.

Figure 9 Parent (item) is set as initial value

Set the warehouse manually, which is the other parent.Since the warehouse is a primary key, it is a rule that it can not be registered and not registered.

Fig. 10 Setting the warehouse

Registration of the warehouse inventory model that is a child has been completed.You can transition to any parent screen.

Figure 11 Warehouse inventory model registration completed

Confirmation of the child attached to the details screen of the parent

On the detail screen of the item model, you can check the list of warehouse stock models linked (children).

Figure 12 Detailed screen of the item model

Likewise, you can check the list of warehouse inventory models that are linked (child) on the details screen of the warehouse model.

Figure 13 Detailed screen of warehouse model

Three models

In this time, we define items, warehouse, warehouse inventory model to prepare.

Figure 14 Model list to define

Material model

The material model manages the material number and item name.

Figure 15 Defining the item model

Warehouse model

The warehouse model manages the warehouse name and address.

Figure 16 Definition of warehouse model

Warehouse inventory model

In the warehouse inventory model, prepare the item and warehouse as primary key and foreign key.

Figure 17 Definition of Warehouse Inventory Model

The "item" item is a model reference, it is a primary key and a foreign key.

Figure 18 Model reference definition for material item
Figure 19 Primary Key, Foreign Key Definition for Item Item

The "warehouse" item is also a model reference, and it is assumed to be a primary key and a foreign key.

Figure 20 Model Reference Definition for Warehouse Item
Figure 21 Primary key of warehouse item, foreign key definition