Support > Repository > Referencing other models > Narrow down choices by value of other items

You can narrow down the choices of model reference depending on the value of other items.

Setting image

An example in which "choice of our person in charge" changes when "designate department in charge" is specified.

Fig. 1 Setting image

An example

Figure 2 shows the state in which the department in charge has not been selected.At this time, we can not select any person in charge.

Figure 2 Optional personnel options are not displayed unless the department in charge is decided

If the department in charge is the general affairs department, the person in charge belonging to the general affairs department is displayed as a choice.

Figure 3 Selecting the General Affairs Department in the department in charge

If the department in charge is also the sales department, the person in charge belonging to the sales department is displayed as a choice.

Fig. 4 Select sales department in department in charge

Definition method

The model has "staff" "job category" "department" "customer".Since "job category" is an option model, we omit explanation.

Figure 5 Model prepared

In the "department" model, prepare the primary key "department ID" and "department name".

Figure 6 Defining the department model

The "staff" model refers to the "department" model.(FIGS. 7 and 8)

Figure 7 Definition of staff model
Figure 8 Definition of department items in staff model

We refer to the department model as the "customer" model as "department in charge of our company" and the staff model as "person in charge of our company" respectively.(FIG. 9, FIG. 10, FIG. 11)

Figure 9 Defining customer model
Figure 10 Defining department items for customer model
Figure 11 Defining Staff Items for Customer Model

We will set the refinement here.Set "Input control> Model reference (narrowed down)" from the detail dialog of "Company contact person" item.

Fig. 12 Model reference (narrowing down) setting
item name
Specify which item in the model (customer model in this case) is the source of the narrowing down.
Refining condition
Specify "equal" to select matching ones.
Referenced item name
"Person in charge personnel" item refers to the staff model.Specify "dept" which is the department item on the staff model side.
Operation when not yet input
As shown in Figure 1, when choosers are not selected, we do not prepare options, so specify "Do not make choices".

Setting image

I will explain an example of narrowing down shown in Fig.Prepare two narrowing conditions.

Figure 13 Setting image

An example

Suppose that a choice model "job title" is prepared as follows.The ID of the job "general" is "4".

Figure 14 Category information

The condition that "job type is general only" was added to the narrowing-down condition.Compared with Figure 4, the number of choices is decreasing.

Figure 15 Only sales department and general occupation are prepared as options

Definition method

We will add a narrowing-down condition for our company personnel item in the customer model.(Fig. 16) A fixed condition that the ID value of the job title (title) is "4" is added.

Figure 16 Adding conditions for occupation

Setting image

You can specify the item in the repeating container as the condition for narrowing down.

Figure 17 Setting image

An example

We have four employees registered.(FIG. 18)

Figure 18 Employee Data

Assign two employees to "Project 1" and "Project 2" respectively.(FIG. 19, FIG. 20)

Figure 19 Assigning User 1 and User 2 to Project 1
Figure 20 Assigning User 3 and User 4 to Project 2

Register work results.In conjunction with the selected employee, the choices of the project are narrowed down.(FIG. 21, FIG. 22)

Figure 21 When user 1 is selected, project 1 will be selectable

Figure 22 When user 3 is selected, project 2 will be selectable

Definition method

We have "Employees", "Work Projects" and "Work Results" as models.

Figure 23 Model list

"Employee" model consists of ID and name.

Figure 24 Employee Model

In the "work project" model, there are multiple employees in one project.It is realized with repeating containers.

Figure 25 Work project model

We will narrow down the project items in the "work achievement" model.

Figure 26 Work performance model

Set a refinement rule that "Employee ID" item (included in the same model) is included in "Employee ID (member/staffid)" (item of reference target model "Work project").

Figure 27 Setting refinement

How it works

This function includes the specified refinement condition in SQL where clause.That is, narrowing down is done in the database.

Operation when the value of the narrowing source has changed

In the case where the value of the narrowing source is changed (in the above example, the value of "department in charge in charge" was changed), the value selected as "person in charge of our company"MaintenanceIt will be.

This also applies to the case where the value of the narrowing source is cleared.The choice of the narrowing destination is maintained.

(We plan to extend it so that we can choose whether to keep or narrow down the choice of the narrowing destination in the future Wagby.)

Fixed value and special notation now

For narrowing down date type items, you can use the special notation as a fixed value.You can narrow down by today's date.

Suggest item

You can not narrow down to suggestion items.(Setting does not work.)

Constraints on using repeated containers

If the narrowing-down item is defined as an out-of-container item and the narrowing-down item is defined as a repeating container item, only the data in the first row of the container will be used for narrowing down.

Data on the second and subsequent lines are not used as refinement and are ignored.

If refinement is not performed properly, please confirm the following points.

  • If more than one narrowing condition is specified, even if one of them is "null", it can not be narrowed down.Please check whether the value used for narrowing down conditions is appropriate.
  • In the case where the items used for the narrowing down condition are obtained by "reference interlocking" or "calculating formula", in the narrowing down processbeforeThese values ​​need to be fixed.If it is uncertain, it will be "null", so it can not be narrowed down.By refining the order of design information, the order of reference linking may change.Normally, it is better to place the linkage source item of the reference link before the item defining the narrowing down.
  • When including model reference items set by narrowing down on the list display screen and list updating screen, it is necessary to include the narrowing items in the list display.