A reference can be created via the
New menu / References,
if a data group
is selected in the
application structure.
Click on
"Add reference" to open a
dialog
where an application and data group can be selected whose data should be
used in the current application. Other data groups from the current
application can also be selected here. Then click on "Next".
In this dialog, the data fields can be selected whose data should be
used in the current application. Click on "Finish".
The reference has now been created.
Now, a drop-down list
could be connected to the reference on an
edit page,
for example. This is done by selecting the option
"Values from references" on the
Entries tab.
You can define the data field from the reference (e.g. Full name of the user)
of your choice as the displayed value.
If a new data record is entered on the edit page in the browser,
all of the corresponding values from the reference data field
will be shown and can be selected. The data in the list is always up-to-date
because any changes made in the reference data field will be shown
in their latest state when a new data record is being created (i.e.
when the edit page is loaded). Changes made in the referenced data group
will also be updated in the data records that have already been created.
The reference is created using the data record ID of the referenced data
record. All elements,
which are linked to reference fields, will automatically be filled
with the values of the reference data group when the data record is saved.
Please note that although you can create edit elements
that show reference data, the values that are entered by users into
these elements will not be saved. If the referenced application or the referenced data group is changed, the
internal reference field will be generated again. Data record IDs that
have been entered for the previously referenced data group will thereby
be lost. If a data record is referenced by a third-party application,
the record cannot be deleted until the reference is removed.
2. References to external data sources
The following example shows how an application, where customer data is
managed with orders, order items, and products, is represented in a
target application using
external data groups.
Click here
to discover how to create connections to external data.
Click here
to discover how to integrate external data into applications.
The data structure is the same in both applications. The "Item" data group
contains a reference to the "Products" data group in both applications.
To represent the relationship from child data groups to parent data groups
using external data access, the
foreign key must be defined
in the child data group.
The properties dialog
of the external data group "Order" is shown here. The "fklid" field is
set as the foreign key.
It contains the ID of the parent data record from the "Customers"
external data group. Click on
Foreign key to define a
field as the foreign key field. The field used for this must contain a
value that can be used to uniquely identify a parent data record, such as
a customer number.
The properties dialog
of the external data group "Item" is shown here. The "fklid" field is
set as the foreign key.
It contains the ID of the parent data record from the "Order"
external data group.
The data field that is used in the source application as the
foreign key
for referencing the record from the "Products" data group
may not be added to the data field list here.
In the properties dialog
of the external data group "Item", the external data group "Product"
is referenced on the
References tab.
Click on Edit reference and
then switch to the Relations tab.
The "ref_product" field is entered in this example as the
foreign key for the relationship
to the "Products" external data group; corresponding to the data field
that contains the product ID. Thus, every time an order item is created,
the product ID is automatically saved to this reference field as well.
If you are creating a new reference, you can click on
Edit to open a
dialog
where a reference data field can be selected using the option
"Data field". This data field's unique value is then used as the
foreign key
for identifying the corresponding data record. Click
here
for more information about this dialog.
External data groups that come from the
portal database connection IxSysDb
can also reference all standard data groups. When integrating
external data tables, it is not possible to integrate the following: