Reference linking is a mechanism for posting information on a reference model.

The operation of reference linking will be explained with the following figure.

  1. In the business daily report model, we will acquire the "customer name" of the customer model.
  2. At this timing, the primary key of the customer model is confirmed.(Example: Refer to data with customer ID 1000.)
  3. With this primary key, we will acquire (read) the "company name" of the customer model again.
  4. The company name is displayed (posted) on the screen of the business daily report model.

In this tutorial, you will learn how to set up reference linkage.

Edit the "business daily report" model.Insert "company" item between "customer" item and "contents" item.

Fig. 1 Select the item ("content" item) of the insertion destination and select New (item) from the gear icon
Figure 2 New item inserted

Define the "company" item as follows.For model type, select "Refer to other model item".

Item name (Japanese) Item name (English) Item type
Company visit/vcompanyname Item reference of another model - reference linkage
Figure 3 Defining company items

Set reference linkage.By selecting "Reference destination model", you can select "linked item name" and "reference destination model item" respectively.

Refer to Figure 4 to set up interlock

As before, I stop, build, and restart the Web application. After logging on to the application, import historical data.

On the new registration screen of the business daily report, decide the customer name.

Figure 5 Determine customer name

As soon as you confirm the customer name, the company name will be displayed.

The interlocking is performed with reference to FIG. 6

The detailed display screen after saving is shown.

Figure 7 Detailed display of business daily report

When the company name of the reference destination (customer model in this example) changes, the information to be posted (the business daily report model side) is automatically updated.

Items set as reference linkage are not prepared in the database table.When displaying, the value is always acquired from the referenced model and displayed.

There is also a setting method to save the reference linkage item in the database.In this case, use the table value when displaying.For details, please read the manual 'Save Reference Linking Items to Your Model'.

Please read "Frequently Asked Questions and Answers> Tutorial".