Hi, Readers.
The public preview for Dynamics 365 Business Central 2026 release wave 1 (BC28) is available. Learn more: Link.
I will continue to test and share some new features that I hope will be helpful. In this post, I would like to talk about Support for packaging analysis views in extensions.
Support for packaging analysis views in extensions:
Analysis views can now be packaged and delivered as part of AL extensions for list pages, including extensions and customizations. This feature enables developers to create standardized data analysis views that can be easily distributed and reused across different Business Central environments.
https://marketplace.visualstudio.com/items/ms-dynamics-smb.al/changelog
Data analysis mode lets you calculate and analyze data directly from a list page, without having to run a report or switch to another application, such as Excel.
This new feature was detailed in last month’s ‘What’s Cooking in Business Central’. More details: What’s Cooking in Business Central: Delivering Analysis Views in AL extensions
Let’s see more details. Simply put, it only takes three steps.
1. Use Analysis Mode in the web client to create and export your analysis view as a .analysis.json file.
I created a simple Comparing Years (Year-Over-Year) report in Analysis Mode. More details: Dynamics 365 Business Central: Comparing Years (Year-Over-Year) in Analysis Mode: A Simple 4-Step Guide
Then choose Share -> Export definition
This will export a JSON file.
You can open and edit it directly using text editing tools such as VS Code.
2. Include the .analysis.json file in your AL extension project.
3. Add an analysisview component within the analysisviews section to your page to reference the analysis view definition.
Test code:
pageextension 50121 "GeneralLedgerEntries Analysis" extends "General Ledger Entries"
{
analysisviews
{
addlast
{
analysisview(ComparingYears)
{
DefinitionFile = 'ComparingYears.analysis.json';
Caption = 'Comparing Years';
}
}
}
}The keywords addbefore and addafter define a new analysis view and place it relatively to the specified analysis view. The keywords addfirst and addlast define a new analysis view and place it relatively to the analysis views section.
Done.
This tab comes from an extension and is read-only. To perform additional data analysis, duplicate the tab.
This is fantastic. Prior to this release, sharing Analysis views required the ‘Copy Link’ function, which was incredibly cumbersome for large teams. More details: Business Central 2023 wave 2 (BC23): Share a data analysis with a co-worker (Copy link in the Analysis mode)
This feature perfectly addresses that pain point. Give it a try!!!😁
PS:
1. In addition to extending the standard page, this also supports adding directly to new pages.
Test code:
page 50120 "My Sales Analysis Page"
{
PageType = List;
SourceTable = "Sales Line";
analysisviews
{
analysisview(SalesPerformanceView)
{
DefinitionFile = 'ComparingYears.analysis.json';
Caption = 'Sales Performance Analysis';
}
}
}2. Note that the targetObjectId must be the same as the one you are extending.
The value ’20’ for the property ‘TargetObjectId’ in DefinitionFile ‘Comparing Years.analysis.json’ must match ’22’, given by the object containing the analysis view ‘ComparingYears’. AL AL0902
3. If the file cannot be found, the following error message will be displayed.
Missing file ‘Comparing Years.analysis.json’. AL AL0327
4. If your Analysis view contains fields other than the standard extensions, the following warning will appear.
The analysis view definition file for ‘ComparingYears’ has a dependency on app ‘Subscription Billing’ by ‘Microsoft’ with version ‘28.0.46665.46777’, which is missing on this project. This might result in the analysis view to ignore unresolved columns. To avoid this, make sure that the app reference is included in the dependencies of the app.json and the symbols are downloaded. AL AL0909
This warning can be resolved by adjusting the dependencies settings and re-downloading the symbol file.
END
Hope this will help.
Thanks for reading.
ZHU
コメント