References

Data from other data groups (including data groups from other applications) can be easily referenced in Intrexx.

Referenced data can only be modified through the data group from which it originally came.

When changes are made to referenced data in the original data group, the records in the referencing data group are automatically updated.

Please note that while you can create input fields that display reference data, the values entered by the user in these fields are not saved.

If the referenced data group is changed, the internal reference field is regenerated. Any recorded record IDs for the previously referenced data group will be lost in the process.

As long as a record is referenced, it can be modified but not deleted.

Here you can see the structure of an application that uses references.

Categories are listed in the "Category" data group (1). These categories should be assigned to the values in the "Value" data group (2).

To do this, a reference to the "Category" data group is created in the "Value" data group. On the "Values" input page in the "Value" data group, a drop-down list displays the categories from the "Category" reference field for selection.

Here you can see the input page in the browser.

Create a reference

A reference can be created via the main menu or the context menu ("New / References") when a data group is selected in the application structure.

You will then be on the "References" tab in the data group's properties.

Click "Add Reference" at to create the reference.

General

Enter the title of the reference here. You can find information about multilingual titles here.

Select the application and data group whose data you want to reference.

Click "Next."

Data Fields

Here, drag the desired data fields from the "Available" column to the "Selected" column.

Click "OK" to save the changes and close the dialog box.

An existing reference can be deleted by clicking " " and then "Delete Reference." "Edit Reference" opens a dialog box where you can edit the currently selected reference.

Link Reference to Element

Now, for example, a drop-down list can be linked to the reference on an input page.

To do this, simply select the "Values from References" option on the "Entries" tab.

The desired data field from the reference (in this case, for example, "Category") can then be set as the display value. When a new record is entered on the input page in the browser, all corresponding values from the referenced data field are displayed in the drop-down list and can be selected.

The data in the list is always up to date because any changes made to the referenced data group are reflected immediately when a new record is created (when the input page is loaded). Changes to the referenced data group are also updated in the records that have already been created here.

The reference is established using the record ID of the referenced record. All elements linked to reference fields are automatically populated with the values from the reference data group when a record is saved.

Reference Data Field - Properties

You can access the Properties dialog box for a reference data field via the application structure.

You can edit the title of the reference data field here. You can find information about multilingual titles here.

The name and data type of the reference data field are displayed below.

References to External Data

In this example, an application that manages customer data along with orders, order lines, and products is mapped to a target application using external data groups.

You can find out how to set up connections to external data here.

You can find information on integrating external data into applications here.

The data structure in this example is identical in both applications. In the "Position" data group, a reference to the "Products" data group has been set up in both applications.

To map the relationship between child data groups and parent data groups using foreign key references, the foreign key must be defined in the child data group.

Here you can see the Properties dialog box for the external data group "Order."

The "fkstrid" data field is configured as a foreign key. It contains the ID of the parent record from the external data group "Customer."

By clicking "Foreign Key" under " ," you can define a data field as a foreign key. The field used as a foreign key must contain a value that uniquely identifies a parent record, such as a customer number.

Here you can see the Properties dialog box for the external data group "Position." The "fklid" data field is configured as a foreign key. It contains the ID of the parent record from the external data group "Order."

The data field used in the source application as a foreign key to reference the record from the "Product" data group must not be included in the data field list here.

References

You can find the "References" tab in the Properties dialog box for external data groups. All existing references to other data groups are listed here.

"Add Reference" opens a dialog box where you can create a new reference. "Edit Reference" opens a dialog box where you can edit the currently selected reference. "Delete Reference" removes a reference from the list.

In our example, the relationship to a reference data set is defined using a foreign key, whose values are compared across both data sets. The values of the foreign key usually correspond to the primary key of the referenced data set.

In the Properties dialog box for the "Position" external data group, the "Product" external data group is referenced on the "References" tab. Click "Edit Reference" at , and then switch to the "Relationships" tab.

Relationships

The primary keys of the referenced data group are displayed here along with their corresponding foreign keys. When creating a reference, this dialog box appears only if the source data group is an external data group or an Intrexx data group with more than one primary key. If assignments are not specified for all primary keys in an Intrexx source data group, they are automatically added when you exit the dialog page.

Make an assignment

When you create a new reference, you can open a dialog box by clicking " " here. Foreign keys can be assigned there as long as the reference has not yet been fully created.

In our example, the reference field—which contains the ID of the referenced product—is entered here as a foreign key for the relationship with the external data group "Products." Whenever a position is created, the product ID is automatically saved in this reference field.

Select Foreign Key

Primary Key

This field displays the primary key data field selected in the previous dialog box.

Foreign Key

Fields from user management, static values, or session variables can be selected as foreign keys.

The "Data Field" option allows you to select a reference data field. Its unique value is then used as a foreign key to identify the corresponding record.

External data groups that originate from the Intrexx standard connection can also reference all standard data groups. When integrating external data tables, including

  • multiple primary keys

  • multiple foreign keys

  • mixed primary and foreign keys

Not possible. Certain conditions apply to references to external data groups: If the external data group originates from the Intrexx system database—the SysDB connection—it is generally possible to create references, but only if the external data group is a physical data group. If the external data group is not the Intrexx system database, the reference is not possible.