Subform Setting
|
All scripting fields are of script editor type. They support the code intelligence autocomplete. They format your script in standard syntax as you type. At any time, you can validate your code against the supported ETQScript and Pythonscript syntax to avoid formulas run time errors by clicking Validate on your script field editor. |
Set Subform Name
Enter the display name of the subform in the Display Name field.
Make the Subform Required
Selecting the Make Subform Required option will prevent saving the related document unless the subform has at least one record with all required information filled in. This option does not apply when the subform is hidden or not editable.
Collapse records by default
This option is deselected by default to make the subform records expanded once the user opens the related document. To make the subform records collapse by default, select the Collapse records by default option. In the case of inner and outer subforms, if any of them is configured as required and collapsed by default, the system will keep the subform's added record collapsed and the user will have to expand it to fill it out.
The Collapse records by default option is not available in the decision tree and read-only subforms.
Set the Subform Capacity
Use the Max Records field to specify the maximum number of records that can be created in this subform. When the maximum number of records is reached, the Add record action becomes disabled. The specified Max Records number must not be less than 1.
Customize Add Record Label
Enter a value into the Add Record Label field to customize the label of that action.
Add New Record and Remove Actions Visibility
You can control the visibility of the subform's Add Record and Remove actions through the Subform Settings > Information> Subform Navigation section.
Hide Add Record:
When selected: The Add Record action is hidden from users.
When cleared: The Add Record action is visible to users.
Hide Delete:
When selected: The Remove action is hidden from users.
When cleared: The Remove action is visible to users.
The Hide Add Record and Hide Delete options in the Subform Settings are not available for Decision Tree and Read-Only Subform types. For these subform types, the Add Record and Remove actions are hidden by default.
Customize Subform Color
Customize the Subform color by selecting a color in the Color field.
Set up Subform Actions
Select the Actions you want to show in a more (…) menu at the subform header. The Subform Actions field shall list all action settings available in the system.
Define Keyboard Shortcuts
You can configure a keyboard shortcut, to navigate to add a new subform record to this subform and set the focus to the first editable field of the new record, using the Keyboard Shortcuts section in the Subform Setting > Basic tab by following the steps below:
- Select at least one of the Complex Shortcut options field: Ctrl, Alt, Shift.
- Select one key from the keyboard keys listed in the Hot Key field, including (0 – 9), (A – Z), and (F1 – F12).
- Click Apply button.
|
You can't set the Complex Shortcut Options without setting a Hot Key, except for when a Hot Key is set to any of the (F1-F12), you must set it without Complex Shortcut Options. The system will prevent you from configuring the same keyboard shortcut for another subform, section, or action of the parent form or any phase of the form's related workflows. |
|
Limitations: If the Subform is not editable, has the add record action disabled, or is not in the currently opened tab, the keyboard shortcut will not function. Configurable Keyboard Shortcuts are not supported for inner subforms. Configurable Keyboard Shortcuts are not supported for system subforms. The system cannot detect if the configured combination is reserved by the used browser; therefore, the browser shortcuts will override the configured shortcut. |
Control Subform Page Capacity
The following two options are used to set and control a subform's page capacity. You cannot use both options at the same subform. When an option is used, the other one is either disabled or hidden.
- Display one record at a time.
You can configure a subform to display one record. The user can toggle to the next or previous record using the forward and backward arrows.
- Subform Pagination.
Subform Pagination is set using the Pagination Options section of the Advanced tab.
By default, the feature is set to display 10 records per page. You can change the default number of records displayed per page according to your needs using the Number of Records per Page field. The specified number must not be less than 1.
You can also change the records default sorting from Oldest to Newest to Newest to Oldest by checking the option Set default sort to "Newest to oldest".
You can display all the subform’s record within one page and disable the Subform Pagination feature by selecting the Disable Subform Pagination option. This will hide the remaining fields of this section.
Enable Search
Searching subform records can be enabled by selecting fields in the Searchable Field field, these fields will be listed on the subform searched fields list, where the user can select one of these fields to search.
Leaving the Searchable Fields field empty disables the search feature on the subform’s records.
Custom Java Class
The Custom Java Class field, which is in the Advanced tab, is used to set a Custom Java Class that is used to customize the subform’s advanced functions.
Subform Properties
Within the Properties tab of the Subform Setting, a Design Name is automatically created for the Display Name you have specified in the Basic tab, prefixed by “ETQ”. However, it can be modified. The application is selected in the Parent Application(s) field. If the parent application has a corresponding archive application, parent application will be filled in the Parent Application(s) field along with the corresponding archive application. The parent form is also filled in the Parent Form field. If a Parent Form is specified for this Subform, the system will prevent adding a Parent Subform for this Subform Setting as its parent Form will reference it.
The Parent Subform field is filled in with the parent Outer Subform name when an Inner Subform is created. If the Parent Subform field is filled in, the system will prevent adding a Parent Form for this Subform Setting as it is referenced by its parent Outer Subform.
A table for data storage is created for each subform. Within the Database Attributes section, a Table Name is automatically generated in Edit mode on save along with a Primary Key column name which is assigned in Edit mode. The Primary Key is the same table name suffixed by “ID”. It is used to give each record a unique identification. If you changed the Database Attributes, entered values will be automatically capitalized.
Configure an Activity Creator Subform
An Activity Creator subform is a subform that is configured to create a certain activity using data filled in its records when the parent form is submitted to a certain phase.
Before setting an Activity Creator subform, make sure that:
- The Subform fields are built to match the fields in the target Activity form.
- The Activity form is set to 'required for creation' in the Target Phase of the document you are working on.
- The Activity form must have a direct workflow with at least three phases: two normal phases and one completed.
To configure the subform as an Activity Creator subform:
- Set the Subform Action: to the Create Activities option.
- Open the Advanced tab and select the form of the activity that will be created by this subform from the Subform Activity field.
A subform is displayed under the Subform Activity field.
- Optionally, use this subform to set a fields inheritance from the Subform and the Activity. For each field mapping:
Add a new record.
Under the Activity Source column, select the field of the Activity Subform from where the value will be inherited.
Under the Activity Target Field column, select the field of the Activity form to where the value will be inherited.
- Save and close the Subform Setting.
The form is refreshed to display the new Activity Creator subform with a ‘System Link’ field that automatically links the created activities to the subform.
- Open the Workflow Builder of the intended parent form workflow.
- Click on the Phase where you want the activity to be created to open its Phase Setting and set the activity as required for creation. Then save and close the Phase Setting.
- Open the Workflow Builder of the Activity form, click on the second phase to open its Phase Setting and set the assignment of this phase according to one of the following options:
Specify a certain user to be assigned to the Activity at this phase.
Set the Assignment to “Use users/groups from field” and specify a Single-Value Names field as an Assignment Field taking into consideration that the selected Single-Value Names field must be set as required.
Set the Assignment to “Use users/groups from field”, add a new (Required) Single-Value Name field to the Activity Creator subform, and select it as an Assignment Field in the Assignment Options.
- Fill in the Due Date Duration Day(s) field.
Having applied the configurations above, an activity of the specified Activity form will be created and linked to each record of the Activity Creator subform when the main form is routed to the phase specified in step six. Each of the created activities will be assigned to the user specified in step seven and the phase due date will be set based on the duration set in step eight.
Configure a Read-Only Subform
Read-only subforms are used for reading and presenting data. They are excluded from the deployment process. Read-Only subforms are useful in the following cases:
- Show recent (updated) data displayed from its original source, which avoids saving the data twice.
- Unnecessary tables and relations are not introduced; yet encourage the use of direct and real relations.
- Provide clear separation between data modeling and presentation.
- Provide a dedicated presentation object.
- Can be used to provide links between Forms and Fields, Views and Columns, etc.
- Read-Only subforms are filled in using an SQL Query.
An SQL Query can be filled in the Read Only Query section's SQL Query (SQL) field, which appears within the Advanced tab when the Read-Only option is selected.
The SQL statement must be written to automatically inherit information from a specified source and fill in the fields on the subform. The entered SQL statement will look up the values of multiple fields from one or more tables, at the same time.
If a new document is created, then the subform will look up data after saving then manually refreshing the document. If the document already exists, then the subform will look up data upon opening the document or refreshing it.
|
The ALIASES returned in the SQL Script (after the AS clause) should match the table field name of the field setting that will be populated. Make sure to add a where condition with a token that will be replaced with the value of the primary key of the subform parent document. |
Example: Using SQL Script to populate a Read-Only section:
In this example, we will use an SQL Script to fill in a read-only subform with information about the activities created from a Corrective Action document.
This will be accomplished by applying the following steps:
Within the Corrective Action form of the Corrective Action application, create a Read-Only subform.
Within the Subform you have just created, create an Activity Subject and Activity Description computed text fields.
Open the Subform Setting, of the subform that you have created, and populate the SQL Query (SQL) field with the following SQL statement:
SELECT
ACTION_ITEM.ACTION_ITEM_ID,
ACTION_ITEM.ACTIVITY_SUBJECT ACTIVITY_SUBJECT,
ACTION_ITEM.ACTION_ITEM_DESCRIPTION ACTIVITY_DESCRIPTION
FROM
CORRACT.CORRACT_DOCUMENT CORRACT_DOCUMENT
JOINCORRACT.ETQ$CORRACT_DOCUMENT_AL AL ON
(CORRACT_DOCUMENT.CORRACT_ID = AL.CORRACT_ID)
JOINCORRACT.ETQ$DOCUMENT_LINKS DOCUMENT_LINKS ON
(AL.ETQ$ACTIVITY_LINK = DOCUMENT_LINKS.LINK_ID)
JOINCORRACT.ACTION_ITEM ACTION_ITEM ON
(DOCUMENT_LINKS.DOCUMENT_ID = ACTION_ITEM.ACTION_ITEM_ID)
WHERE
CORRACT_DOCUMENT.CORRACT_ID = ?
Where:
The ? will be replaced with the ID of the document during the run-time.
ACTIVITY_SUBJECT is the Table Field Name of the Activity Subject field
ACTIVITY_DESCRIPTION is the Table Field Name of the Activity Description field
Configure a Lookup Subform
A Lookup subform is a subform that looks up information from a Reliance form according to either a SQL query or a defined field mapping and based on a specific View-Lookup field or View-Link field, which exist on the same subform, where when a value is selected in the lookup field that exists in the subform, the information of the related document will be filled in the subform's fields according to selected method.
Configure a Lookup SubForm using SQL Query
- Set the Subform Action: to the Lookup option.
- Open the Advanced tab and set the Lookup Using to the SQL query option.
- Select the Lookup Field from the list of all View-Link and View-Dialogs that exist on the subform.
- Determine how the subform will be refreshed to fill in the look up information after filling in the Lookup field. There are three options:
Automatic: The system will update all records in the subform every time the document is opened, refreshed, or saved.
Manual: You can change the looked-up data and save your changes. The system will not restore the default lookup data unless you select the lookup key again (by selecting a different lookup key, then selecting the original lookup key again, causing the lookup data to be re-initialized).
Conditional: The Conditional option will update all records in the subform based on an EtQScript Formula that you can fill in the Formula (EtqScript) field that is displayed when you select the Conditional option.
- Fill in the SQL Query (SQL) field with an SQL statement that fills in the subform’s field. If the selected Lookup field is configured to show options using an External Database Link, the SQL Query must be written to retrieve and read data from that external database.
Make sure that the aliases of the lookup query fields match the design names of the subform fields.
To prevent harmful queries, the system will prompt you with an error message upon applying a setting with a SQL statement that queries a restricted database table or includes one of the following reserved words: Update, Delete, Insert, Drop, and With.Configure a Lookup Subform using Form Fields Mapping.
Configure a Lookup Subform using Form Fields Mapping
- Set the Subform Action: to the Lookup option.
- Open the Advanced tab and set the Lookup Using to the Form fields mapping option.
- Select the Lookup Field from the list of all View-Link and View-Dialogs that exist on the subform.
- Determine how the subform will be refreshed to fill in the look up information after filling in the Lookup field. There are three options:
Automatic: The system will update all records in the subform every time the document is opened, refreshed, or saved.
Manual: You can change the looked-up data and save your changes. The system will not restore the default lookup data unless you select the lookup key again (by selecting a different lookup key, then selecting the original lookup key again, causing the lookup data to be re-initialized).
Conditional: The Conditional option will update all records in the subform based on an EtQScript Formula that you can fill in the Formula (EtqScript) field that is displayed when you select the Conditional option,
- Select the form from which information will be filled in the subform's fields in the Lookup Form field. The selected form must be displayed by the view used by the selected Lookup Field.
A subform is displayed under the Lookup Form.
- Use this subform to set a field inheritance from the Lookup Form into the Subform Fields. The fields mapped together must be of the same type. For each field inheritance to be set:
Add a new record.
Under the Lookup Source Field column, select the field of the Lookup Form from where the value will be inherited. Note that the Lookup Source Field column will only list its single value fields with the display types of 'Editable', 'Computed', and 'Computed when composed'.
Under the Subform Field (Target) column, select the field of the subform to where the value will be inherited.
Save and close the Subform Setting.
Configure a Lookup Subform to be filled in with Hierarchical values
The Populate subform from hierarchical link option is selected when the subform is to be configured to retrieve its data from documents hierarchically linked to the parent form of the subform is being configured. Once the Populate subform from hierarchical link option is selected, the Lookup Options section of the Advanced tab is refreshed to display the following fields and the Lookup Form, if used, is displayed in read-only mode:
- Hierarchical Link: Every link field added to the parent form of type 'Hierarchical' will be listed within this combobox. Select the intended hierarchical link, which will be displaying the documents that this subform will inherit values from.
- Populate subform with documents of the following types: This field is filled in with all the types of the selected parent form, if any. The values of the selected document type(s) will be the ones inherited into the subform.
Lookup subforms that are configured to retrieve data from a Hierarchical Link will fill in a record for each linked main document. Each linked document may have its own related documents linked to it. Subsequently, those related documents (links) will be shown as sub-records in the subform expanded using an arrow aligned next to the main record. 'Expand All' and 'Collapse All' actions are found to the top of the subform, which will be used to display and hide all rooted link records at once. The main linked document records in the subform will be editable where the rooted document link records are displayed in Read mode.
When a link is removed from the Hierarchical field, its related subform record will automatically be deleted.
Configure the Subform to be used as a container
You can utilize the subform to act as a container for the elements by setting the Subform Action Options to None.
Adding Inner Subforms
You can add an inner subform from the builder, all features that apply on the outer subform apply on the inner subform.
See Also
|
|
|