Define a relationship from one entity to another with a relation entity.
- Right-click on an entity, such as a Program, and select New
Relation.
- Click and drag the Relation arrow to the entity to which you want to set the relationship, such
as a Form. If you try to set an invalid relation, for example from a Form entity to a Program, you will
see the constraint icon indicating that this relation is not valid.
- Repeat this step until all relationships have been defined.
Positioning
When a form is opened from another form, the current position is
always set to the first row. With positioning, you can control the row that is preselected when the
form is opened. For example, an account form and a country form may have a relation between them
that specifies the account.country_id as the positioning Source Field. While running the account
form, suppose the user is on the "John Doe" account with a country of "USA". If the user then opens
the country form, the country_id ("USA") will be preselected in the form.
Often this will be a
field that corresponds to a foreign key. (For example, the account table has a foreign key to the
country table). The Source Field must match the target form field in number and type for the
positioning to work.
Filtering
The Filter properties are used on relations between forms to apply a SQL
filter while opening a form. The SQL filter consists of the Destination Field to filter on (for
example, country.id) and the Source Field values to use for filtering (for
example, account.country_id). When the form is opened, it will filter the results
displayed based on the filter.