{"title":"Designing Indented Hierarchy Lists","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/devenv-indented-hierarchy-lists/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-indented-hierarchy-lists, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-indented-hierarchy-lists","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"This article explains how to indent rows in a repeater control to design hierarchical lists. You can nest records that users can navigate, expand, and collapse.","date":"2021-04-01","meta":{"topic":"concept-article"},"outline":[{"level":1,"title":"Designing Indented Hierarchy Lists","slug":"designing-indented-hierarchy-lists","at":0,"chars":7261},{"level":2,"title":"Overview","slug":"overview","at":98,"chars":704},{"level":2,"title":"Setting up a fixed indented hierarchy","slug":"setting-up-a-fixed-indented-hierarchy","at":802,"chars":2154},{"level":3,"title":"Example","slug":"example","at":1561,"chars":1395},{"level":2,"title":"Setting up a collapsible indented hierarchy","slug":"setting-up-a-collapsible-indented-hierarchy","at":2956,"chars":2892},{"level":3,"title":"Example","slug":"example-1","at":3985,"chars":1461},{"level":3,"title":"Collapsed or Expanded lists","slug":"collapsed-or-expanded-lists","at":5446,"chars":402},{"level":2,"title":"Design and behavior considerations","slug":"design-and-behavior-considerations","at":5848,"chars":1140},{"level":2,"title":"Related information","slug":"related-information","at":6988,"chars":273}],"text":"# Designing Indented Hierarchy Lists\nThis article explains how to indent specific rows in a list.\n## Overview\nUsing the indentation properties in AL, you can display rows in a parent-child structure.\n![Fixed indented list.]\nA row that's indented from a row above is considered a child of that row. The row above is considered the parent. Indenting rows can help organize related records in the list and make it more readable for the user.\nYou can display indented hierarchy lists on any page type, including List pages, Worksheets, and ListParts. Pages can also be editable.\nThere are two kinds of indented hierarchy lists: fixed and collapsible. In a fixed hierarchy, rows that are indented are always shown. In a collapsible, users can collapse and expand parent rows to show and hide child records.\n## Setting up a fixed indented hierarchy\nIn a fixed hierarchy, child rows are always shown, as illustrated in the following figure.\nIn the figure, indentation is applied to the second column. Setting up the fixed indented hierarchy involves configuring two properties on the page object: IndentColumn and IndentationControls.\n The properties/devenv-indentationcolumn-property determines which records get indented and by how much. You set the property to either a field in the page's source table or to a variable. The important thing, is that property resolves to an integer. This integer determines the indentation level.\n The properties/devenv-indentationcontrols-property specifies which column in the list gets indented. You can only specify one column.\n### Example\nIn this example, you indent records based on the value of the Indent column and apply the indentation to Name column. You set the IndentationColumn and IndentationControls on the repeater of the page, as shown in the following code:\n```al\npage 50100 MyPage\n{\n    PageType = List;\n    ApplicationArea = All;\n    UsageCategory = Lists;\n    SourceTable = MyTable;\n    Editable = true;\n\n    layout\n    {\n        area(Content)\n        {\n            repeater(Control1)\n            {\n                IndentationColumn = Indent;// IndentationColumn = IndentVariable;\n                IndentationControls = Name;\n\n                field(Number; Number)\n                {\n                }\n                field(Name; Name)\n                {\n                }\n                field(Indent; Indent)\n                {\n                }\n            }\n        }\n    }\n\n    //trigger OnAfterGetRecord()\n        //begin\n          //IndentVariable := Indent;\n        //end;\n\n        //var\n           //IndentVariable: Integer;\n}\n```\nYou can achieve the same results using a variable instead of the table field for the IndentationColumn property. Look at the commented lines of code in the example above.\nFor a more detailed implementation example, see the Chart of Accounts<https://businesscentral.dynamics.com/?page=16> page in the base application (link requires sign-in to Business Central online).\n## Setting up a collapsible indented hierarchy\nIn a collapsible hierarchy, users can collapse and expand parent rows to show and hide child records.\nSetting up a collapsible hierarchy is similar to the fixed indented list, except for the properties that you set. A collapsible hierarchy involves three properties: IndentColumn, ShowsAsTree, and TreeInitialState.\n Like in fixed indented hierarchy, the properties/devenv-indentationcolumn-property is an integer data type field or variable that determines which records get indented and by how much.\n The properties/devenv-showastree-property makes the hierarchy collapsible.\n The properties/devenv-treeinitialstate-property, which is optional, specifies whether the list is collapsed or expanded when the page opens.\nUnlike fixed indented lists, a collapsible hierarchy always indents the left-most visible column in the repeater. The IndentationControls property is ignored. If users customize the page by moving another column first, the moved column will be indented instead.\n### Example\nIn this example, you'll indent records based on the value of the Indent column. Records will indent on the Number column and parent records will be collapsible. You add the IndentationColumn, ShowAsTree, and TreeInitialState properties to the pages' repeater:\n```al\npage 50100 MyPage\n{\n    PageType = List;\n    ApplicationArea = All;\n    UsageCategory = Lists;\n    SourceTable = MyTable;\n    Editable = true;\n\n    layout\n    {\n        area(Content)\n        {\n            repeater(Control1)\n            {\n                IndentationColumn = Indent; // IndentationColumn = IndentVariable;\n                ShowAsTree = true;\n                TreeInitialState = CollapseAll;\n\n                field(Number; Number)\n                {\n                }\n                field(Name; Name)\n                {\n                }\n                field(Indent; Indent)\n                {\n                }\n            }\n        }\n    }\n\n    //trigger OnAfterGetRecord()\n        //begin\n          //IndentVariable := Indent;\n        //end;\n\n        //var\n           //IndentVariable: Integer;\n}\n```\nYou can achieve the same results using a variable instead of the table field for the IndentationColumn property. Look at the commented lines of code in the example above.\nFor a more detailed implementation example, see the Assisted Setup<https://businesscentral.dynamics.com/?page=1801> page in the base application (link requires sign-in to Business Central online).\n### Collapsed or Expanded lists\nUsers can change whether the page opens with rows collapsed or expanded, essentially overriding the TreeInitialState property. They change the behavior by selecting the Toggle Expand All / Collapse All button in the header of the first column, or using the button in the top-left corner of the repeater. It stays this way, until they delete personalization on the page.\n## Design and behavior considerations\nWhen using an indented hierarchy, consider the following behavior:\n When indentation is specified, it's no longer possible to use sorting on the columns in the repeater control or display the list as tiles.\n Right-aligned data in columns, such as the integer data type, won't appear as indented.\n Indentation is used to visually communicate structure, without modifying the table of records itself. There's no tightly defined parent-child relationship between records, so you must implement additional logic if records need to relate together. For example, if a user deletes a parent record, Business Central won't delete all of its child records.\n Indenting records in a list doesn't automatically apply any additional styling to emphasize parent records and distinguish them from child records. You can implement styling using style expressions. For example, you could format all fields on parent records to display bold values. Learn more about properties/devenv-styleexpr-property.\n> NOTE\n> Having more than 1000 nested rows under the root level row can cause performance issues in the web client.\n## Related information\nproperties/devenv-indentationcolumn-property\nproperties/devenv-indentationcontrols-property\nproperties/devenv-showastree-property\nproperties/devenv-treeinitialstate-property\nPage and Page Extension Properties<properties/devenv-page-property-overview>"}