Condition builder options allow creating and use dynamically evaluated predefined values for the specified column types, or fields, or tables, or condition operators.

The main use case of this functionality is filtering by fields of Date/Time/DateTime type. Options facilitate filtering by using predefined values, such as "Yesterday", "Week before", "Next Month" and others.

The following options are implemented for the Date, DateTime, DateTime Specific column types:

  • Tomorrow
  • Today
  • Yesterday

These options are delivered within the platform.

Creating a new option


To create a new option, please complete the steps below:

  1. Navigate to System Settings → Condition Builder → Options.
  2. Click New and fill in the fields.
  3. Click Save or Save and Exit to apply changes.

Option form fields

FieldMandatoryDescription
TitleY

The option name. It will be displayed in the condition builder values choice list. See the screenshot below as an example;

Active
Select this checkbox to make the option active. If not selected, then this option is not displayed in the condition builder values choice list.
Field typeNSpecify a column type for which this option is applicable. If not specified, then the option will be applicable for all field types created in the system.
Use for fieldNSpecify a field for which this option is applicable. If not specified, then the option is applicable for all columns.
Use in tables NSpecify tables against which this option is applicable. You can specify more than one table. If not specified, the option is applicable for the whole table structure.
Use with operatorsN

Specify condition operators for which this option is applicable. You can specify more than one type. If not specified, then the option is applicable for all operators supported.

To find a list of operators supported by options, please navigate here:

System Settings → Condition Builder → Operators.

To add new operators to this list, please contact your vendor.

OrderNSpecify an option order. If there is more than one similar option created, then they will be applied according to the specified value in the ascending order.
ScriptN

Specify a script implementing the option logic.

You can use Script Includes when defining option logic. For this, keep the sequence below:

  1. Create a script include as described in the article mentioned above.
  2. Import it using the ss.importIncludeScript(name) method.
dateWeekAfter
function getDateWeekAfter() {
const simpleDateTime = new SimpleDateTime();
simpleDateTime.addDays(7);
return simpleDateTime.getDate();
}
Importing Script Include
ss.importIncludeScript('getDateWeekAfter');
setResult(getDateWeekAfter()); 
This field appears when the Field type field value is Reference.
Refer to TableNThis field allows specifying a referring table (this is helpful in case if you need to select all fields referring to any specified field of some specified table).

Option example


For example, we need an option that allows rapid choosing of the specified user from the employees' list when performing selections of managers. For this, start creating an option and fill in the fields as shown below:

FieldValue
TitleJohn Doe
ActiveYes
Field typeReference
Use for fieldManager
Use in tableEmployee
Use with operatorsIS

As a result, we have got a new option against the Employee table, as shown on the screenshot below.




  • No labels