By using references, a direct connection to the data of other data groups will be established. The data can even come from another application. When data is changed, the changes will automatically be applied to the original data of the referenced data group. The reference will be created by using the data set ID of the referenced data set. All view and edit elements that are connected to reference fields will be automatically populated with the values of the reference data group when a 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 set 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.

A new reference can be created via the context menu of a data group.

References to external data sources

The following example shows how an Intrexx source application, in which customer data is managed with orders, order items, and products, is represented in a target application using external data access. The data structure is the same in both applications. The Item data group is configured in both applications as a reference to the Products data group.

Source application

Target application

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 box 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 foreign data group.

Click Foreign key to define a field as the foreign key field. The field used as the Foreign Key must contain a value that can be used to uniquely identify a parent data record, such as a customer number.

The properties dialog box of the Item external data group is shown here. The fklid field is set as the Foreign Key. It contains the ID of the parent data record from the Auftrag 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.

Select the reference to the Product foreign data group in the properties of the Item foreign data group.

The relationship is defined in the properties of the reference.

The ref_product field is entered in this example as the Foreign key for the relationship to the Products foreign 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.

The properties dialog box for a relationship, which you open by clicking on Edit, is where the reference data field is assigned.

Select the Data field option to select a data field from the data group to be referenced here. Its unique value is then used as the Foreign key to identify the corresponding data record. If you reference a data group that contains products, for example, the product number could be selected here.

By selecting the User option here, a field from the user manager could also be used as the Foreign key. The Static value option allows you to use a fixed value, and Session variable lets you use the value of a session variable.

External data groups that come from the Intrexx default connection can also reference all standard data groups. When integrating external data tables, it is not possible to integrate the following:
  • multiple primary keys
  • multiple foreign keys
  • mixed primary and foreign keys