Support > Repository > Check the input > User defined check

You can perform original input check using arbitrary expressions. You can also write a message when an error occurs.

Figure 1 shows an example of an error when the "company name" item contains blanks.An error message is arbitrarily prepared.

Figure 1 Space Character Check
User defined checks are not done in real time.After the save button is pressed, it is checked on the server side.

In the detail definition dialog of the model item, write an expression and an error message in the user definition. It will be normal if the value of the expression is "true".When "false", an error message is displayed.

Item names are enclosed in placeholders $ {...}.Functions can also be used in expressions.

Figure 2 User-Defined Expressions
The expression describes "normal (permitted)" contents.If the value of the expression is true (true), no error message is displayed.

Warning will be displayed, but if you set the setting that you do not disturb the registration itself by pressing the save button here, specify "(warning)" option from the list box on the right side of the input column.

Figure 3 Specifying warnings

I want to set an item item 1 not to be input as an error.(Wagby'sRequired specificationDo not use)


I want to judge that the item item 1 is numeric type and it is 0 or more.

${item1} >= 0

The item item 1 must contain numbers from "0" to "9".Otherwise an error will result.


The item item 3 must not contain a space.If it is included, it is an error.

NOT(ISINCLUDE(${item3}, " "))

Up to three checkbox items item 4 can be selected.If four or more are selected, an error occurs.


If the value of date-time type item sdate is 30 days or earlier than today, input can not be performed.

 DATE(TODATE(${sdate})) >= DATE(TODAY()),
 DATE(TODATE(${sdate})) + 30 < DATE(TODAY())

Since sdate is a date/time type, it converts it to the date type via the function TODATE.

When today is May 18, today and future dates, and before one month (before April 17) can be entered, but from April 18th to May 17th will be an error.

You can also make more complex input checks using scripts. For details, please read "Business Logic> Input Check/Consistency Check".

You can use the ERRORMESSAGE function in the message field.The argument is a resource key.



The error message corresponding to the resource key is described in "key = value" format in this file in customize/resources. For details, please read "Change Messages/Internationalization> Edit Resource File".

Resource files are compatible with internationalization.For English version, prepare

Here is an example of description.

E0002=このデータは {0} のため登録できません。
E0003=このデータは {0} のため {1} できません。

Here {0} and {1} are "Placeholders".The first argument of the ERRORMESSAGE function is a resource key (corresponding to E0001 in the above file), but after the second argumentFixed character stringYou can pass.

ERRORMESSAGE("E0002", "空白が含まれている")
ERRORMESSAGE("E0003", "空白が含まれている", "登録")
  • This check is performed on the server side at the timing of pressing the button such as "Save".
  • The input item that caused an error has a background of red.This applies to text input items or date/time list boxes.
  • It is not possible to use aggregate processing functions such as COUNT, SUM, etc. for repetitive items, repeating containers, foreign key related models.
  • Other input checks are performed on the character string entered from the screen, but the check using this expression is the only item of "store model".(To be exact, after converting from a presentation model composed of character strings entered from the screen to a store model, the expression is applied to the value of that store model.)For details of the store model and the presentation model, please read "Business Logic> Model Basics".
  • It is not possible to check inputs for items that are not input targets.Specifically, it is an item which is obtained by calculation formulas, read-only item, reference linking item.

How to check read-only items

As an example, prepare item a, item b, and item sum.
Here we assume an input check that sum = a + b has a relationship and that the value of sum must be 100.

In this case, you can not write an input check on the sum item side.
Wagby does not perform input check for read-only items (items which the user can not directly edit; automatic calculation items are also included in this).

When checking input to items which can not be directly edited by the user, it prevents the case where only data which always becomes an input error can be created.

Therefore, describe the expression on the side of item a.

It can also be described in item b.It will be the same behavior.


The repository key is model/modelitem/generic_check.