Relation Editor
Reference documentation for the Relation Editor
Last updated
Reference documentation for the Relation Editor
Last updated
The Relation Editor is a graphical interface that allows the creation of relations between two tables at Servoy level, not database level, which can be used as a filtered data source in multiple places i.e. show a related form in a tab using the Tabpanel component
Source and Destination tables can be any Database Table, Database View, or In-Memory Table, View Foundsets can be used only as Destination, and the same table can be used as Source and Destination as well. Table selection can be done by entering manually the database name and table name or using the Datasource Selection Wizard.
Once Source and Destination are selected the relation name is automatically generated but it can be edited.
There is a list of empty rows where you can select any field from the Source table to match a field on the Destination table indicating what type of operator should be used to compare them, the two fields on a single row must be the same type.
A Source field can also be a scope variable and the variable type must also match the type of the Destination field.
The available operators are:
For each operator, there are some modifiers that can be applied:
There are a number of options that can change the behavior of a relation and how Servoy handles records in either the Source or Destination table.
Operator | Description |
---|---|
Modifier | Description |
---|---|
Option | Description |
---|---|
=
Equal. This is the default operator.
This is also an IN
operator when the Source field is an array variable
>
Greater than
<
Less than
>=
Greater or equal than
<=
Less or equal than
!=
Not equal
like
Contains
not like
Not Contains
or-is-null
The Destination field can also be null
besides the operator specified
case-insensitive
When the fields are text, the comparison is done without considering uppercase or lowercase
remove-when-null
When the Source field is a scope variable and it's null
the criterion is removed from the relation when querying the table
Join type
It can be either inner join or left outer join
Initial sort
Allows to define the default sorting used the first time the relation is created using the Sorting Fields Wizard
Deprecated
Flag to indicate that the relation should not be used
Encapsulation
Determine the scope of the relation: Public, Hide in Scripting: Module Scope, or Module Scope
Allow creation of related records
Flag to indicate if new records can be added in the Destination table using the relation criteria
Allow parent delete when having related records
Flag to indicate if a record in the Source table can be deleted when there are still records in the Destination table that match the relation criteria
Delete related records
Flag to indicate if all records in the Destination table that match the relation criteria must be deleted when a record in the Source table is deleted
Comment
Free text box to enter a comment about the relation