Support > Repository > A formula > Model reference

In the model reference item, there are "ID part" and "content part". In the automatic calculation formula, you can specify which part to use.

The model reference item consists of an ID part and a content part.It can be handled in the following format.

Example: Structure of staff model

ID part Content section
1000 Yamada Taro
1001 Ichiro Suzuki

Suppose you have prepared an item staffname that refers to the above staff model.
In the automatic calculation formula, you can make the following specifications.


We will acquire the contents section.The return type is the type of the item specified in "Referenced model item" to the staff model. In the above example, the string "Yamada Taro" "Ichiro Suzuki" is returned.


Acquire ID part.The type of the return value is "the primary key of the reference model" to the staff model.The type is the same as the type of the primary key item of the staff model. In the above example, the numbers 1000, 1001 are returned.


It has the same meaning as $ {staffname}.

Acquisition of content part in user definition check

In the case of the user-defined check, #content specification is always required to acquire the content part. In the above example, use $ {staffname # content} instead of $ {staffname}.

Handling list box items

If an item referred to as a list box is specified in an expression, the initial value when the new registration screen is opened is null.This is because the top of the choice is "(not selected)".If you do not create an unselected item, you can obtain the initial value of the displayed option (by specifying #id or #content) as the initial value.

Even if you do not create an unselected item, the initial value is null when you narrow down the choices.(The selection value is set for the first time by performing the narrowing operation.)

You can not specify #id, #content for reference linkage items.We will treat the posted values ​​as they are.

The ID value is stored in the item of the reference linkage source as shown in Fig.

Handling of linked items referring to Figure 1

Here, if you want to use "content" of "unit price model", refer to the contents section as shown in Fig.

See Fig. 2 Connecting interlocking

The type of $ {XXX # id} is the type of the primary key of the referenced model.

For this reason, please convert it to a character string using TOSTR as necessary when using within a function.Or convert it to a number using VALUE.

Example: When the item item 1 of the model reference (list box) has been selected, it returns the selected ID value.Otherwise it returns the character string "(not selected)".(This calculation result is stored in the item of character string type, and so on.)

IF(SELECTED(${item1}), TOSTR(${item1#id}), "(未選択)")

Item1 # Since id is an integer type, it is enclosed in function TOSTR and it is converted to character string type.

#content can not be specified for the model reference item in the expression used in the job (activation condition in mail send/receive job, expression on success/failure, etc.) description.Only # id is available.