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

We will show an example of preparing two child models "customer" as parent model and "support" "buying".

More than one child can be specified for linking models with foreign keys.Figures 1 and 2 show examples in which the customer model is the parent and two child "purchasing history" "support" models are prepared.

Figure 1 New registration buttons for multiple child models are prepared on the detail screen of the parent model
Figure 2 When a child model is registered (on the details screen of the parent model)

Display order in parent model

It is arranged in dictionary order of model ID (English).

Figures 3 and 4 show the definition of purchase history model and support model prepared this time.
Specify the type of the item specified as the foreign key with the same type as the type of the referenced item.In this example, "customer ID" is specified as "numeric" type.

Figure 3 Definition of Purchasing History Model
Figure 4 Definition of support model

In the "Customer ID" item, set the foreign key.
Specify the parent model for "foreign key> model name".

Figure 5 Definition of Foreign Key

"Referenced item name" is the item on the child model side isSame nameCan be omitted.(This time it is the same "customerid", so you can omit it.)

Figure 6 Definition of foreign key (when referencing item name is omitted)

Child models on the parent model details screen are stored in tabs by default.(Fig. 1, Fig. 2) Child models can be displayed side by side instead of tabs.

Figure 6 Display multiple child models vertically

Definition method

Modify the screen definition of the child model.

Uncheck "Screen> Search/list display> External key coordination> Display method> Tab layout".By standard, it is checked.

Figure 7 Using tab layout
Figure 8 Do not use tab layout
If there are multiple child models (as in this example), please set whether to use tab layout for all child models or not.It is possible to mix, but usually it will be unified into either.