Single Record control allows users to select a single record from a predefined list of records in a table.
By using this control, one-to-many relationship is created between the selected table and the current table. For example, if you have a Project table and a Client table, you can use the Single Record control in the Project table to link each project to one client from the Client table. This allows one client to be linked to multiple projects, but each project will only be associated with a single client.
Add a Single Record Control
Add a New Element
Click the + button in your desired location on the form to add a new element.Set Property Name and Data Type
Click New Property and enter the name of the property.
Select the data type as Reference, then click NEXT.
Note: If creating a form from an existing data source, you can choose from available unbound reference properties instead of creating a new property.
Choose Control Type
Select Single Record control, then click NEXT.
Select Data Source (in case create new property)
Under the DATA section, click Select Data Source.
Select the dataset you want to link to and click SELECT. For example, if you want users to select departments within the form, choose the Department table as your data source.
Configure Other Settings (Optional)
Adjust any necessary settings for the control.Save
Click SAVE to add the Text Entry control to your form.
Single Record Control Settings
Besides the general form control settings, Single Select Control supports the following settings:
Data Type
Data type: Reference
Sub-type: Model Ref
Appearance
The reference field will be displayed in the form as a card.
You can customise the card view to display specific fields from the reference object. This layout is managed in the View Designer.
By default, the Default Card View will be used. You can change this by clicking the dropdown icon to select an alternative card view from the list of available options. If the available options do not meet your requirements, click Add/Edit Options to create a new card view or modify an existing one.
Data
These settings manage how data is entered and validated within the form.
Data Source
This setting allows you to select the specific object to retrieve data for the reference field. For example, if you want users to select a employee within the form, you would choose the Employee table as your data source.
Options
This setting allows you to define the specific records displayed to users within the selected data source. Engyn supports the following options:
Defined List: This option allows you to manually specify a fixed list of records or values that users can choose from. The list is predefined, and users can only select from these available options. This is useful when you want to control the choices strictly.
Query (Default): This option allows you to use a query to filter the data displayed in the list. By default, the system uses the “All Items” query to display all records. Additionally, you can customize this query to filter the available data based on specific conditions:
Linked to another selection: When your form has related fields, you can link them together to ensure that users see only relevant options based on their previous choices.
Parent-Child Relationship: For example, if you have a Department field and an Employee field where each department has multiple employees, you can link Employee to Department. By doing this, users will first select a Department, and then the Employee field will automatically update to show only employees from that selected department.
Multiple Fields Sharing the Same Parent: If you have multiple fields linked to the same parent, the same logic applies. For example, both Employee and Manager fields are linked to the Department parent. In this scenario, you can link the Employee field to the Manager field by selecting Employee/Department under Manager. When a user selects a Manager, the Employee field will automatically display only those employees who belong to the same department as the selected manager.
Add Conditions: You can further refine the available records by adding additional conditions to the selected query. This allows for more specific data filtering based on your form’s requirements.
Required to be: When this option is enabled, you are specifying a list of records that the user must select from. Users will still see the list of available options, which could come from a Defined List or a Query, but only the items in the "Required to be" list are valid selections. If the user selects an option that is not in the "Required to be" list, an error will be triggered and the form will not be submitted until a valid choice is made.
Constraints
Unique: When enabled, this setting updates a one-to-many relationship to a one-to-one relationship. This means that once a source record is linked to a record in the current dataset, it cannot be linked to any other records within that same dataset.
Duplication Behavior
This setting controls whether linked records should be duplicated when the main record is duplicated. For example, if you have a Project with multiple Tasks and enable duplication for Tasks, duplicating the project will also duplicate all associated tasks.
Deletion Behavior
This setting controls whether linked records should be deleted when the main record is deleted. For instance, if a Project is deleted and the deletion for Tasks is enabled, all tasks associated with that project will be deleted automatically.
More information about duplication and deletion here.
Default Value
Predefined values to simplify user input and maintain consistency
None
No default value is applied.
Initial Selection: When the control is clicked, this value will be pre-selected as the initial choice in the list of records.
Pre-Selected
Choose a value that will be automatically selected when the form is opened. You have the option to set a fixed value or map to a current context, such as the current user.
Control
These settings define the control’s internal settings and functionality.
Open Record on Click
When enabled, this option allows users to click on the reference field and open the linked record to view more details. For example, if a supplier is selected in a form, the user can click on the field to open and view the supplier's full record, providing easy access to additional information without navigating away from the current form.
Allow New Record Creation
When enabled, this option allows users to add new records directly from the form if they can't find an existing option that meets their needs. For example, when creating a new Purchase Order, if a user can't find a supplier in the existing list, they can add a new supplier record immediately.
Additionally, when allowing new record creation, you can prefill certain fields in the new record form. This means that some information can be automatically populated based on the context of the current form, saving users time and ensuring consistency in data entry.
For more information, please refer to form prefill.
Object Search Options
These settings allow you to customize how users search for and select linked records in the Single Select form control.
For more information, please refer to Object search customization.