Link
Links within an application represent the relationship between its classes. This section introduces the process of creating a new link, and provides a detailed breakdown of its customization options.
Last updated
Links within an application represent the relationship between its classes. This section introduces the process of creating a new link, and provides a detailed breakdown of its customization options.
Last updated
Relationships between classes are defined by creating links in the class designer.
Starting in the Class Designer, click on the down arrow on the left side of the class you wish to work on. Next, expand the Links for the class. Click on Please select to choose the target class for the link. Click on the plus icon on the right of the textbox to create your link.
There are different types of links.
One-To-One Class A can only have one instance of Class B and vice-versa.
One-To-Many Class A has several instances of Class B, but Class B can only be related to a single instance of Class A.
Many-To-Many Class A has several instances of Class B and Class B is related to several instances of Class A as well.
The Common section contains general properties of a link. In this section, you can specify how the link is presented in your application by setting the name, description and other information.
Currently disabled as this feature is still in development
The parent link is used to specify the inheritance of abstract classes.
The link name is a user-friendly name that is normally generated automatically and set to the target class by default. This value usually does not require modifications.
Changing the value for the name causes the link will be called the same in both classes. The Name field is compulsory when creating a link.
The description is a short help text that could potentially be used as hover text for the link.
In the Link setup, you can configure the type and specifics of the link between the two classes.
By checking Use Link Service in this section, several aspects of your link is handled by the platform and allows you to have a simpler configuration.
The following options are disabled when Link Service is being used:
NM Class in Common > Link Setup
Controller in Advanced > Advanced
Type in Advanced > Advanced
Normally, Class 1 defines the origin class, while Class 2 defines the target class.
Field 1 identifies the field from Class 1 that should be used as a distinct identifier (foreign key) and normally should be set to the primary key of that class. Similarly, Field 2 specifies the distinct identifier (foreign key) for Class 2 and should be set to the primary key of that class.
The source setting defines the direction of a link. By selecting Is Source for a class, you can allow a user to navigate from that class to the other one.
By selecting Is Source for both classes, the user is allowed to navigate in both directions.
When configuring Many-To-Many link types, an extra intermediary table is required to cater for the complex relationship between both classes. The NM Class allows you to specify which table to use from the database. This table will be used to lookup the relations between the linked classes.
For more information about many-to-many data models, click on this link.
In the advanced section of a link, you can further customize the how the link is processed by the platform by linking it to additional code and configuring additional options.
The controller specifies additional code pertaining to the link that is running in the background.
This setting normally comes preconfigured as Default, which caters for most use cases and should only be modified to accommodate unique scenarios.
Link constraints refers to the restriction of links.
For example, Constraints will allow you to define a link as a one-to-many link type, despite having the NM Class - which defines it as a many-to-many link type.
This can be relevant if the target class does not contain a field that can be used to define a normal one-to-many link.
The link direction can be used to differentiate between two links.
For instance, if a class needs to be linked to itself, you can use Direction to define a parent and child in the link.
The class designer takes care of setting up most properties of your link. However, in this property, you can explicitly define a link type as one-to-many or many-to-many.
However, using the NM Class in the Common Attributes of a link instead can greatly simplify the configuration when creating your classes.
Class-Designer option to not delete linked instances when deleting an instance. Following delete behavior options are available:
Delete (default): Deletes all linked instances.
Retain: Does not delete linked instances.
This feature is still in development at this time.