Linked Forms allow connecting a main form (Parent Form) with multiple subforms (Child Forms). These relationships are modeled as 1-n links in Wonderful Relations, meaning multiple entries of a Child Form can be linked to a single entry of the Parent Form. The entries of the Child Form are displayed in a datatable embedded within the Parent Form.
Visual Example
This concept is used throughout the system. For example, when creating a query, you will see the main form titled “Query” along with its associated “Fields” and “Wheres” linked to the query.
Parameters
Title
Defines the title displayed for the linked form within the Parent Form.
Form
Defines the Form, which we use for e.g. “New Entry (+)” oder “Edit”
Child Entity
In most cases, the Child Entity corresponds to the Entity of the linked Form.
However, there are special scenarios where this can differ.
For example, consider a Form called “Persons” used to create and edit person records. If you have a Workshop Form that uses this linked form to associate with different entities, such as “Attendees” or “Waitlist,” you need to differentiate the Child Entity here.
Even though the Child Entity is different (e.g., “Attendees” or “Waitlist”), you might still want to use the same “Persons” form for adding and editing records. This allows for reusing the same form across different linked contexts while maintaining distinct associations.
DataTable
The DataTable for the linked form can be selected and customized to fit the specific requirements of the use case. This allows you to define which fields are necessary and relevant for this particular scenario (used as a linked DataTable).
Filters and other configurations can be applied to ensure the displayed data matches the intended purpose.
DataTable LinkModal
You can create a separate DataTable specifically for the Link Modal. This allows you to display more, fewer, or entirely different information compared to the main DataTable, depending on what is needed to make linking decisions effectively.
Link Button
Determines if existing entries can be linked
Show Unlinked Entries Only
This option ensures that entries from the Child Entity cannot be linked multiple times. Entries from the Child Entity will only be displayed if no existing link already exists between the Parent Form’s entity and the Child Entity. This helps maintain data consistency and prevents redundant associations.
Minimum and Maximum Links
Allows specifying the minimum and maximum number of links that can be created between the Parent Form and Child Form.
Description
Adds an optional description for the linked form.
CSS Class
Allows customizing the appearance of the linked form. For instance, using the class col-md-6
can display two linked tables side by side. If this is empty, it will be col-md-12
by default.
Info URL
If an info URL is provided, an info icon will be displayed, which users can click to view additional information.
Options
disable_filter_by_link
Option disable_filter_by_link
: true
disables the feature that automatically filters linked and unlinked entries. This is useful when linked and unlinked entries (or their union) need to be displayed.
Key: disable_filter_by_link Value: true
Example Use Case:
Suppose you have a list of persons and want to show both linked categories and calculated entries. By default, only linked entries would be shown. Disabling this option allows to show the full table ignoring Wonderful Relations links between Parent and Child Form.
To Filter them manually you can use the replacement value ##parent_id##
in the query.
link_as_entity
Option link_as_entity
: entity_identifier
links as a different entity defined in the Linked Form options. This allows you to use a different “Linked Entity” then the DataTable and Forms.
Key: link_as_entity Value: entity_identifier
hide_row_link_button
Option hide_row_link_button
: true
disables the Link Button in the DataTable for specific use cases.
Key: hide_row_link_button Value: true