Related lists appear at the bottom of forms and contain records from the tables related to the current record. For example, an Employee (employee) record contains the User Role related list. It displays records from the User Roles (sys_user_has_role) table related to the current record.
There are two types of related lists:
In related lists, users can view and edit information like in any other list, and administrators can configure their appearance on forms by configuring the form layout.
When users do not have access to some records in the Related Lists area, the following message is displayed: |
|
To narrow the list of records in a related list, use the condition builder. Note that the set filters will not be saved as default. To apply a complex filter to a related list, use a scripted related list.
Role required: admin. |
To add a related list to a form, complete the steps below:
Configure sets of related lists by moving the elements in the heapselect:
|
The title before the arrow (→) stands for the table storing related records. The title after the arrow (→) stands for the field, referring to the current record. That is, Incident Task→Parent will display records from the Incident Task table that have the current record ID in the Parent field.
There may be more than one field in one table: the Change Request (itsm_change_request) table may contain references to the current record in the Caused by incidents, Parent, Related incidents, and Resolved incidents columns.
Related Lists are connected via the ID of the current record. That is, the condition for the related list is: [ |
You can create records related to the current one through related lists. For example, you can create a change task for a change request record.
The New button is not available for some related lists.
|
To create a record in a related list, complete the steps below:
You can add existing records to the related list of a current record. For example, you can add a user to existing groups:
The Edit button is not available for some related lists.
|
To edit records in a related list, complete the steps below:
Scripted related lists are different from referenced related lists – their connection is synthetic and provided by the script. That is, you can add relations between tables which do not reference one another in the Reference, List or Document ID column types. These lists can be configured via the Scripted Related Lists (sys_related_list_script) table.
To set up a scripted related list, complete the steps below:
Scripted Related List form fields
Field | Mandatory | Description |
---|---|---|
Name | Y | Specify the relationship name displayed in the list. |
Apply to | Y | Specify the table on which form this related list will be displayed. |
Query from | Y | Specify the table containing the source records for this list. |
Query with | Y | In this field, you can put down a script specifying the records to include from the specified table. |
In your scripts, you are free to use the current and parent objects. The main purpose of this script is to generate a query that will be applied to the table specified in the Query from field.
In other words, the parent object is a record form specified in the Apply to field, and a current object is a list from a table specified in the Query from field. You can use any SimpleRecord Server-Side methods as directives in the current and parent objects. |