📌 Handle your subrecord line items.
Overview
The subrecord-table tile allows you to handle Subrecord line items easily. It allows you to add, edit and view the Subrecord line items.
Object Properties
The table provides a summary of the object properties associated with the sub-record table tile type, including their types, mandatory or optional status, and descriptions.
| Field | Type | Mandatory/ Optional | Description |
|---|---|---|---|
type | string | Mandatory | Always set to subrecord-table. |
title | string | Optional | If omitted, the Subrecord's name will be used. Use a string for the tile’s title; set it to false to hide the title. |
record | string | Mandatory | Specifies the internal ID of the Subrecord (e.g. line-items) |
content | array | Mandatory | An array of objects describing subrecord table columns. |
subtotals | array | Optional | An array of objects for calculating subtotals that are displayed below the subrecord table. |
Explanation of Object Properties:
- Content
The content array which is utilised to describe the columns of the subrecord table.
The example displays the configuration for the most basic column, but we have the alternative to introduce additional settings for modifying different elements of the subrecord table.
{
"type": "field",
"field": "task"
}
- Content object (column)
The table provides an insight into the various object properties of the content objects within the column of a subrecord table:
| Field | Type | Requirement | Description |
|---|---|---|---|
type | string | Mandatory | Always set to field. |
field | string | Mandatory | The internal ID of the subrecord’s field to be utilised in the column. |
label | string | Optional | The label for display. |
width | number | Optional | Column width in pixels defaults to 200 and is adjusted based on the field type. |
minWidth | number | Optional | The minimum column resize width in pixels defaults to 150 and is adjusted based on field type. |
options | object | Optional | Additional options for the content objects within the column. |
readonly | boolean | Optional | If true, the field is displayed without input, showing only the value; the value can be changed by utilising the rules, etc. |
mandatory | boolean | Optional | Specifies the default mandatory state for the field; if present (as true or false) will take precedence against field’s mandatory setting. |
noValueText | string | Optional | Text displayed when the field's value is blank; If omitted, it defaults to No LABEL (e.g. No due date for a field with the label “Due date”). |
placeholder | string | Optional | Designated placeholder for the input field. If set, it takes precedence over the field’s placeholder. If it is omitted, the field’s placeholder is used. |
errorText | string | Optional | Text displayed when the field has an error (e.g. mandatory and blank after form submission). |
disableAdd | boolean | Optional | If set to true, it hides the + button for the selects field. |
- Subtotals
Subtotals is an array of objects used for calculating subtotals and is displayed beneath the subrecord table. They simplify understanding and analysis of the subtotals content within the subrecord table. The table provides an insight into the various object properties of the subtotals:
| Field | Type | Requirement | Description |
|---|---|---|---|
| label | string | Mandatory | The label displayed before the calculated number. |
| field | string | Mandatory | Specifies the internal ID of the field to sum. |
| icon | string | Optional | Indicates the fontawesome icon (e.g. fa-solid fa-circle) present in front of the label. |
Example:
The example demonstrates the syntax for subtotals in Subrecord table:
{
...
"subtotals": [
{
"label":"Tax total",
"icon":"fa fa-scale-unbalanced-flip",
"field":"tax-amount"
},
{
"label":"Total amount",
"field":"amount"
}
]
}Sample Configuration
Here is a sample configuration for incorporation of thesubrecord table:
{
"type": "subrecord-table",
"record": "kalysys-dependencies",
"content": [
{
"type": "field",
"field": "task"
},
{
"type": "field",
"field": "type"
},
{
"type": "field",
"field": "offset",
"options": {
"mandatory": true
}
},
{
"type": "field",
"field": "date"
},
{
"type": "field",
"field": "time",
"options": {
"readonly": true
}
},
{
"type": "field",
"field": "datetime"
}
]
}
📌 Need Help?
