{"title":"Package analysis views in AL extensions","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/devenv-analysis-view-package/","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-analysis-view-package, 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-analysis-view-package","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":"Learn how to export analysis views from Analysis Mode, add their definitions to AL projects, and package them in Business Central extensions.","date":"2026-10-08","meta":{"topic":"how-to"},"outline":[{"level":1,"title":"Package analysis views in AL extensions","slug":"package-analysis-views-in-al-extensions","at":0,"chars":6355},{"level":2,"title":"Export an analysis view definition","slug":"export-an-analysis-view-definition","at":927,"chars":915},{"level":2,"title":"Define analysis views on pages","slug":"define-analysis-views-on-pages","at":1842,"chars":1037},{"level":2,"title":"Define analysis views in page extensions","slug":"define-analysis-views-in-page-extensions","at":2879,"chars":712},{"level":2,"title":"Define analysis views in page customizations","slug":"define-analysis-views-in-page-customizations","at":3591,"chars":763},{"level":2,"title":"Handle table structure changes","slug":"handle-table-structure-changes","at":4354,"chars":617},{"level":2,"title":"Packaged analysis views in Analysis Mode","slug":"packaged-analysis-views-in-analysis-mode","at":4971,"chars":1159},{"level":2,"title":"Related information","slug":"related-information","at":6130,"chars":225}],"text":"# Package analysis views in AL extensions\n> APPLIES TO: Business Central 2026 release wave 1 and later\nBusiness Central allows you to export analysis views that are created in Analysis Mode for list and worksheet pages, package them, and deliver them as part of your AL extensions. This article describes how to export a view definition, add it to your AL project, and define it on a page, page extension, or page customization.\nThe end-to-end process for delivering analysis views with your extension is:\n1. Design and export<#export-an-analysis-view-definition> the analysis view definition from the client.\n2. Add the exported JSON file to your AL extension project.\n3. Reference the file<#define-analysis-views-on-pages> from a page, pageextension, or pagecustomization object using the analysisviews construct.\n4. Compile and publish the extension.\nLearn more about using analysis views in Analysis views</analysis-mode>.\n## Export an analysis view definition\nAnalysis Mode in the Business Central client acts as the editor for designing analysis views; you use it to define columns, grouping, filtering, and other data layout settings. Once you have the view you want, you can export it by following these steps:\n1. Open the list or worksheet page with the analysis view that you want to export.\n2. Enter Analysis Mode.\n3. On the analysis view tab, open the tab menu and choose Export Definition.\nThis action downloads a JSON file that contains the serialized definition of the analysis view. Add this file to your AL extension project.\n> TIP\n> Avoid filtering packaged analysis views on specific data values, such as customer numbers or posting groups. These values might not exist in the environment or company where the extension is installed. Instead, limit the view definition to column layout, grouping, and aggregation settings.\n## Define analysis views on pages\nUse the analysisviews construct on a page object to add analysis views. Point each view to its exported definition file by using the DefinitionFile property.\nThe following example shows how to define an analysis view on a list page:\n```al\npage 50100 ListPageWithAnalysisView\n{\n    PageType = List;\n    ApplicationArea = All;\n    UsageCategory = Lists;\n    SourceTable = Customer;\n\n    layout\n    {\n        area(Content)\n        {\n            repeater(Group)\n            {\n                field(\"No.\"; Rec.\"No.\")\n                {\n                    ApplicationArea = All;\n                }\n                field(\"Description\"; Rec.Name)\n                {\n                    ApplicationArea = All;\n                }\n            }\n        }\n    }\n\n    analysisviews\n    {\n        analysisview(MyAnalysisView)\n        {\n            Caption = 'Customer Analysis View';\n            ToolTip = 'My Analysis View description';\n            DefinitionFile = 'BasePage/Base.analysis.json';\n        }\n    }\n}\n```\n## Define analysis views in page extensions\nYou can also add analysis views through page extension objects. Use the addlast keyword to add a new view, or the modify keyword to change properties on an existing view.\nThe following example adds a new analysis view and hides an existing one:\n```al\npageextension 50101 MyExtension extends \"Sales Order List\"\n{\n    analysisviews\n    {\n        addlast\n        {\n            analysisview(SalesAnalysisView)\n            {\n                Caption = 'Sales Order Analysis';\n                DefinitionFile = 'PageExt/SalesOrderExt.analysis.json';\n            }\n        }\n\n        modify(\"Expected sales volume\")\n        {\n            Visible = false;\n        }\n    }\n}\n```\n## Define analysis views in page customizations\nYou can add analysis views through page customizations to target specific profiles. This approach lets you provide analysis views that are relevant for specific roles.\nThe following example defines an analysis view in a page customization and assigns it to a profile through a profile extension:\n```al\npagecustomization MyCust customizes \"Sales Order List\"\n{\n    analysisviews\n    {\n        addlast\n        {\n            analysisview(SalesAnalysisView)\n            {\n                Caption = 'Sales Order Analysis';\n                DefinitionFile = 'PageExt/SalesOrderExt.analysis.json';\n            }\n        }\n    }\n}\n\nprofileextension MyProfileExt extends \"ORDER PROCESSOR\"\n{\n    Customizations = MyCust;\n}\n```\n## Handle table structure changes\nAn analysis view definition references columns from the underlying page source table. If the table structure changes after the analysis view is exported, for example, if a field is removed, renamed, or has its type changed, the affected columns are ignored at runtime. The analysis view still loads, but any columns that no longer match a field on the page are silently dropped from the view.\nTo avoid broken or incomplete views, update and re-export the analysis view definition whenever you make changes to the source table or page layout that affect the columns used in the view.\n## Packaged analysis views in Analysis Mode\nWhen a user installs an app that includes analysis views, the views appear as tabs when the user enters Analysis Mode. Packaged analysis views are visually distinguished from user-defined views by a Locked icon on the tab. This icon signals that the view is read-only: sorting, filtering, grouping, and other data manipulation is blocked on the view. To do further data analysis based on a packaged view, users can create a copy of it and modify the copy freely.\nUnlike user-defined analysis views, packaged views:\n Can't be deleted or moved by the user.\n Are consistent across users-every user who has the extension installed sees the same set of packaged views.\n Survive user personalization resets, because they're defined in AL code rather than stored as user data.\nYou can hide and unhide packaged analysis views by using:\n devenv-inclient-designer, which applies to all users\n /ui-personalization-user, for the current user\n Page customizations for profiles<devenv-page-customization-object>, for a specific role\nYou can also rename the tab and change its description through the tab menu by choosing Rename.\n## Related information\nAnalysis views</analysis-mode>\ndevenv-pages-overview\nPage extension object<devenv-page-ext-object>\ndevenv-page-customization-object\ndevenv-profile-object\nDeveloping extensions in AL<devenv-dev-overview>"}