In foreign key relation, child model can be updated directly on the update screen of parent model.
We treat "customer" model and "support" model as examples.
N customer support information is associated with one customer.At this time, you can update N support information (linked) on the customer model update screen.
All settings are done with the support model (which is a child model).There is no setting on the parent model side.
In the support model, include "customer ID" which is a foreign key in the search condition.
"Customer ID" is set to save the value in the database at the time of registration.
Similarly, in the detailed definition of the "customer ID" item, make the range search effective, or make the conditional expression "equal". In other words, you set either Figure 4 or Figure 5.
We will create a "list update screen" of the support model.
Activate the simultaneous update function of foreign keys provided in the setting field of the list update screen.(It is enabled by default.)
By using the "input check" button, you can check the input of the child model.(It is equivalent to the input check function of the list update screen.)
You can control the display of input check buttons.It becomes the setting of the registration/update screen of the parent model side.
You can specify the initial display number of the child model. On the registration screen of the parent model (customer model in this case), records are displayed for the initial display number specified as shown in Fig. 10.
In the support model list maintenance screen setting, set "simultaneous update function of foreign key> initial display number".
More than one model can be linked with a foreign key.At this time, simultaneous updating of child models also works.
In a model that is related to a foreign key, when copying is registered, all child models linked to the parent model are also copied.
In Figure 15, we prepared a copy registration function in the customer model. Clicking on the copy button transitions to the copy registration screen.
On the copy registration screen of the customer model, if there is relevant support data, you can see that this is also copied at the same time.(Figure 16)
In the customer model, enable "Search/list display> button display> copy registration button".
In the support model, set "Update List> Update Foreign Keys Simultaneously> Enable Concurrent Updates" and set "Copy child model when copying parent model".(This setting is enabled by default.)
This copy function works even with a parent model with two or more foreign key child models.