Skip to main content

Grid Element

A complex display element is a grid that allows you to record multiple of an object on a record. For example storing multiple email addresses on a people, instead of defining an input multiple times.

Ex: Form Example

{ 
"name": ["Invoice Lines"],
"label": "Invoice Lines",
"primary_key": "invoices.invoice_lines.id",
"sequence_column_label": "seq",
"seq_column": "seq",
"deleted_column": "deleted",
"show_labels": "1",
"layout": "table",
"alignment": "horizontal",
"is_web_compatible": "1",
"allow_row_delete": "1",
"allow_row_create": "1",
"helper": "\\kernel\\form",
"method": "grid",
"show_sequence_column": "0",
"seq": "0",
"show_collapsed": "0",
"is_mobile_compatible": "0",
"template": "grid",
"packaged_with_module": "accounting",
"mw": false,
"children": [{}]
}

Invoice lines becomes a grid, where the value on the record object is an array of grid entries. The value can be found by using the primary_key and removing the last value in this case id. The resulting value is invoices.invoice_lines.

"invoice_lines": [
{
"created": "2025-01-03 21:18:03",
"created_by": "739",
"description": "EU",
"id": "421",
"invoice_reference": "52",
"modified": "2025-01-06 13:52:33",
"modified_by": "739",
"owned_by": "739",
"price_per_unit": "2000000.00",
"primary_acl_group": "2629",
"product_id": "201",
"quantity": "1",
"total_amount": "2000000.00",
"uom_id": "113",
"_acl": "",
"_acl_delete": "",
"_acl_edit": "",
"_acl_tmp": "",
"_acl_tmp_delete": "",
"_acl_tmp_edit": "",
"account_id": null,
"amount": null,
"analytic_account_id": null,
"asset_category_id": null,
"deleted": "0",
"discount": null,
"flags": null,
"invoice_id": null,
"is_demo_data": "0",
"organization_id": null,
"revision": "2",
"sequence": null,
"source_document": null,
"tax_id": null,
"unit_of_measure": null,
"_acl_comment": null,
"__created_by": "Michael Ilao",
"created_by_user_name": "michael@fiyge.com",
"__modified_by": "Michael Ilao",
"modified_by_user_name": "michael@fiyge.com",
"__account_id": "",
"account_id_business_key": null,
"__analytic_account_id": "",
"__product_id": "Citizenship by Investment - Cyprus",
"__owned_by": "Michael Ilao",
"owned_by_user_name": "michael@fiyge.com",
"__uom_id": "Family",
"__organization_id": "",
"__invoice_reference": "",
"created_by_model": "created_by_user",
"modified_by_model": "modified_by_user",
"product_id_model": "products",
"owned_by_model": "owned_by_user",
"uom_id_model": "config_uom",
}
]

This is an example of the data in the invoices record.

Permission flags​

Create and Delete are always enabled by default, but if the flag exists and the value is "0", then you must disable them

const allowCreate = !(element.allow_row_create === "0") && !readOnly;
const allowDelete = !(element.allow_row_delete === "0") && !readOnly;