Support > Repository > Search control > Implicit condition
ja | en

When searching, you can always include certain conditions. Specify "condition value" and "expression".

An example is shown in which an implicit condition is added that searches only items whose "price" is larger than "0" in the product model.In Figure 1, we create a product with a price of 0 yen.

Figure 1 Register products with 0 yen price

As shown in Figure 2, it is not displayed in search results.This is because the hidden search condition item "price" is prepared and the condition "greater than 0" is always valid.

Figure 2 Items whose price is 0 yen will not be searched.

Prepare permissions for which implicit conditions do not apply

If implicit conditions are set, no one can view data that is missing in the condition.Therefore, you can set up permissions that do not apply this condition. Figure 3 shows an example of preparing a principal called "product manager".

Figure 3 Preparing the product administrator principal

If you log on with an account with this principal, all product data will be retrieved.

Figure 4 All product data (without implicit conditions)

Simple definition

Opens the detail definition dialog for the model item to which you want to apply implicit conditions.On the "Implicit conditions" tab, set the conditional expression.

In the example shown in Fig. 5, "greater than 0" is specified.

More than one implicit condition can be specified.Only data satisfying all conditions are searched.

Figure 5 Setting implicit conditions
With the setting in Figure 5, no account can search (data that did not meet the condition).To avoid this, you can specify 'unauthorized authority' at the same time.[To be described later]

Setting unauthorized permissions

First, create new permissions (permissions) for this model.(FIG. 6)

Figure 6 Creating Permissions (1)

Here we have the authority named "Exclude (p_except)".

Figure 7 Creating Permissions (2)

Create a principal to manage the added privileges.(FIG. 8)

Figure 8 Creating Principals (1)

Here we have prepared a principal named "product manager (product_mgr)".Have exclusion permission.

9

In the implicit condition setting, set the created "p_except" (excluding) permission in the "Not applicable permission" column.

Figure 10 Specify authorization outside applicable
Here we set the permissions.It is not a principal.

As shown in Figure 3, implicit conditions are skipped for accounts with this principal.

Implicit conditions are automatically granted to the SQL where clause when querying the database. Therefore, the data itself is stored in the database itself.When using the system, it will not be searched.(Excluding applicable authority)

For string type items, In the condition value partCalculation results can be obtained without referring to itemsFunctions can be used.

Make logon account implicit

USERNAME()

Implicit terms and conditions

FISCALYEAR(NOW())

Use the USERINFO function to get the value of juser

USERINFO("name")
TOINT(USERINFO("age"))

The return value of the USERINFO function is a string type.If you want to use an integer type value, use it together with a function such as TOINT.

Concept of unavailable functions

As an implicit condition, you can use a function whose argument does not have an item of a specific model attached. For example, take a function called ABS which takes an absolute value as an example.

ABS(-1)
Can I use it?
ABS(${item1})
Can not be used.

Use special notation now

In the implicit condition of "date" "time" "date and time" item Notation in "now"You can use.

System administrator's handling

Implicit conditions do not apply to system administrators.

Can not be combined with ordinary search conditions

Implicit conditions and normal search conditions can not be used together.In this case, the implicit condition takes precedence and even if you enter a value in the search condition, it is ignored.

Can not be combined with range search

"Search range" in search controlAnd implicit conditions can not be specified at the same time.

Search/list display screen required

If you do not prepare the search/list display screen for that model, implicit conditions can not be used.(The setting will be invalid.)

I will explain the confirmation method when the implicit condition does not work.

  • Have you logged on as a system administrator (admin)? Implicit conditions do not apply to system administrators.