Display the referenced model in a pull-down format. You can select one value.
Prepare the product model as shown in Fig. 1 in advance.
Figure 2 shows an example screen that selects the value of this product model in the list box. You can select the name of the reference model "product" from the list box.
In the quotation model shown in Fig. 2, the type of the item item is referred to as "reference item of another model".(Figure 3)
In the detailed setting of the type, the referenced model is "goods", and the item of the reference destination model which is the choice of the list box is "product name". Select "List box" as input type.
You can specify the initial value of the list box.An example will be explained in which "key holder" is selected in the list box when opening a new registration form for estimate model.
Check the value of the primary key (here, product ID) of the target data.(FIG. 5)
When you open the quotation model new registration screen, you can see that the data in Figure 5 is selected as the initial value.(FIG. 6)
Specify the primary key of the target data.
Changing display order of options in option modelYou can set the same rule as for any model.
Here, we added the item "display order" to the product model.(FIG. 8)
If the list is "descending", the choices are arranged in descending order of the numerical value of the display order.
Define the display order item.Item name, item ID isAnyis.Make the type an integer type.(FIG. 10)
In the estimate model, specify "Sort Rule" as the display priority in the option setting and "Display Order" in Figure 10 as the Display Priority Item.(Here, you can specify an item of type integer type arbitrarily.)
Invalidating options in option modelYou can set the same rule as for any model.
Deleting the reference data causes inconsistency between the data.To avoid this, you can invalidate the data (leaving it rather than deleting it).Invalidation makes the system invisible, but it remains in the database.You can cancel revocation and restore it.
We prepared the item "invalidation" in the product model.If an arbitrary character string is set here, this data is invalid. In Figure 12, the character string "production ended" is set for one piece of data.
Invalidated data is not displayed in the quotation model's choice.(FIG. 13)
Define "invalidation" item.Item name, item ID isAnyis.Make the type a string type.(FIG. 14)
In the estimate model, specify the item prepared in Fig. 14 as "invalid judgment item" in option setting.Type is string type.
Invalid items in the option model are also to be searchedYou can set the same rule as for any model.
Please read the link above for setting.
In the list box, the option "(not selected)" which means "nothing selected" is prepared as a standard.This is alwaysAt the beginningIt will be placed.(You can not change this order.)
When this item is used as a search condition, unselected items are also prepared automatically.You can search for data that is "(not selected)".
Opens the Input Control tab in the model item detailed definition of the reference source model (the estimate model in this example).Activate "Model reference> Prepare not selected".Since this setting is enabled by default, please cancel this setting when it is unnecessary.
If you do not prepare unselected items, it will look like Figure 19.in this case,We will not prepare the state that it will not be selected.
When using this item as a calculation formula, the initial value when the new registration screen is opened is null.
If you do not create an unselected item, you can obtain the initial value of the option (by specifying #id or #content).
Specification of narrowing down of options, Even if you do not create an unselected item, the initial value is null.The selection value is set for the first time by narrowing down operation.
If you specify a list box as a search condition, you can search all data by specifying the option "all".
(This is provided as standard only when searching.It is not displayed when newly registering/updating data.)
Opens the search control tab of model item detail definition.Activate "Prepare" All "when using list box" prepared in model reference field.Since this setting is enabled by default, please cancel this setting when it is unnecessary.
You can change the input type of the registration/update screen and search screen.Here is an example using a radio button on the search screen.
From the model item detail definition, open the Search Control tab.Specify "Switch display method" in model reference.(It is blank in the standard.)
An example of selecting a customer in the list box is shown in Figure 25.The choice is "name (full name)".
On the customer model side, add an item to store "Name (Name or Kana)".
This item is obtained by automatic calculation.It is not saved in the database. In this example, the expression is as follows.
This item is hidden when inputting.(Fig. 27) Also make it hidden when outputting.(FIG. 28)
In the referencing model (the side referring to this model), specify the above items as referenced model items.
The reference key item of the reference source model ("estimate" model in the above example) holds the ID value of the reference destination model.It is not a content part.
"((Not selected)" is stored as NULL in the database.