From f6827a2017186b126346950fb1746af74d419623 Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Wed, 17 Dec 2025 10:30:27 +1100 Subject: [PATCH 01/20] Added ABC Analysis Setup page & table --- .../Inventory/Pages/ABCAnalysisSetup.Page.al | 174 ++++++++++++++++++ .../Tables/ABCAnalysisSetup.Table.al | 65 +++++++ 2 files changed, 239 insertions(+) create mode 100644 src/Apps/W1/PowerBIReports/App/Inventory/Pages/ABCAnalysisSetup.Page.al create mode 100644 src/Apps/W1/PowerBIReports/App/Inventory/Tables/ABCAnalysisSetup.Table.al diff --git a/src/Apps/W1/PowerBIReports/App/Inventory/Pages/ABCAnalysisSetup.Page.al b/src/Apps/W1/PowerBIReports/App/Inventory/Pages/ABCAnalysisSetup.Page.al new file mode 100644 index 0000000000..a828624c66 --- /dev/null +++ b/src/Apps/W1/PowerBIReports/App/Inventory/Pages/ABCAnalysisSetup.Page.al @@ -0,0 +1,174 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.Inventory.PowerBIReports; + +page 36982 "ABC Analysis Setup" +{ + Caption = 'ABC Analysis Setup'; + SourceTable = "ABC Analysis Setup"; + PageType = Card; + ApplicationArea = All; + UsageCategory = Administration; + DeleteAllowed = false; + InsertAllowed = false; + + layout + { + area(content) + { + group(General) + { + Caption = 'General'; + Editable = true; + + field("Category A"; Rec."Category A") + { + ApplicationArea = All; + Caption = 'A Category'; + + trigger OnValidate() + begin + StyleExpr := GetStatusStyleExpr(); + CalculateBoundaries(); + end; + } + field("Category B"; Rec."Category B") + { + ApplicationArea = All; + Caption = 'B Category'; + + trigger OnValidate() + begin + StyleExpr := GetStatusStyleExpr(); + CalculateBoundaries(); + end; + } + field("Category C"; Rec."Category C") + { + ApplicationArea = All; + Caption = 'C Category'; + + trigger OnValidate() + begin + StyleExpr := GetStatusStyleExpr(); + CalculateBoundaries(); + end; + } + field(Sum; Rec."Category A" + Rec."Category B" + Rec."Category C") + { + ApplicationArea = All; + Caption = 'Sum'; + AutoFormatType = 0; + Editable = false; + StyleExpr = StyleExpr; + } + } + group("Category A Setup") + { + Caption = 'Category A'; + Editable = false; + + field(CatALowerBound; CatALowerBound) + { + ApplicationArea = All; + AutoFormatType = 0; + Caption = 'Lower Bound (%)'; + Editable = false; + } + field(CatAUpperBound; CatAUpperBound) + { + ApplicationArea = All; + AutoFormatType = 0; + Caption = 'Upper Bound (%)'; + Editable = false; + } + } + group("Category B Setup") + { + Caption = 'Category B'; + Editable = false; + + field(CatBLowerbound; CatBLowerbound) + { + ApplicationArea = All; + AutoFormatType = 0; + Caption = 'Lower Bound (%)'; + Editable = false; + } + field(CatBUpperBound; CatBUpperBound) + { + ApplicationArea = All; + AutoFormatType = 0; + Caption = 'Upper Bound (%)'; + Editable = false; + } + } + group("Category C Setup") + { + Caption = 'Category C'; + Editable = false; + + field(CatCLowerbound; CatCLowerbound) + { + ApplicationArea = All; + AutoFormatType = 0; + Caption = 'Lower Bound (%)'; + Editable = false; + } + field(CatCUpperBound; CatCUpperBound) + { + ApplicationArea = All; + AutoFormatType = 0; + Caption = 'Upper Bound (%)'; + Editable = false; + } + } + } + } + + var + CatALowerbound: Decimal; + CatAUpperBound: Decimal; + CatBLowerbound: Decimal; + CatBUpperBound: Decimal; + CatCLowerbound: Decimal; + CatCUpperBound: Decimal; + StyleExpr: Text; + + trigger OnOpenPage() + begin + CalculateBoundaries(); + end; + + trigger OnQueryClosePage(CloseAction: Action): Boolean + begin + Rec.ValidateCategoryFields(); + end; + + trigger OnAfterGetRecord() + begin + StyleExpr := GetStatusStyleExpr(); + end; + + local procedure GetStatusStyleExpr(): Text + begin + if (Rec."Category A" + Rec."Category B" + Rec."Category C" = 100) then + exit('Favorable'); + + exit('Unfavorable'); + end; + + local procedure CalculateBoundaries() + begin + CatALowerbound := 0; + CatAUpperBound := Rec."Category A"; + + CatBLowerbound := CatAUpperBound; + CatBUpperBound := CatBLowerbound + Rec."Category B"; + + CatCLowerbound := CatBUpperBound; + CatCUpperBound := CatCLowerbound + Rec."Category C"; + end; +} \ No newline at end of file diff --git a/src/Apps/W1/PowerBIReports/App/Inventory/Tables/ABCAnalysisSetup.Table.al b/src/Apps/W1/PowerBIReports/App/Inventory/Tables/ABCAnalysisSetup.Table.al new file mode 100644 index 0000000000..3eb3534c3a --- /dev/null +++ b/src/Apps/W1/PowerBIReports/App/Inventory/Tables/ABCAnalysisSetup.Table.al @@ -0,0 +1,65 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.Inventory.PowerBIReports; + +table 36956 "ABC Analysis Setup" +{ + Access = Internal; + Caption = 'ABC Analysis Setup'; + DataClassification = CustomerContent; + + fields + { + field(1; "Primary Key"; Code[10]) + { + Caption = 'Primary Key'; + } + field(2; "Category A"; Decimal) + { + Caption = 'Category A'; + AutoFormatType = 0; + InitValue = 0; + MinValue = 0; + MaxValue = 100; + DecimalPlaces = 0 : 5; + } + field(3; "Category B"; Decimal) + { + Caption = 'Category B'; + AutoFormatType = 0; + InitValue = 0; + MinValue = 0; + MaxValue = 100; + DecimalPlaces = 0 : 5; + } + field(4; "Category C"; Decimal) + { + Caption = 'Category C'; + AutoFormatType = 0; + InitValue = 0; + MinValue = 0; + MaxValue = 100; + DecimalPlaces = 0 : 5; + } + } + + keys + { + key(PK; "Primary Key") + { + Clustered = true; + } + } + + internal procedure ValidateCategoryFields() + var + Sum: Decimal; + SumErr: Label 'The total of Category A, B, and C percentages must equal 100. Please adjust the values accordingly.'; + begin + Sum := Rec."Category A" + Rec."Category B" + Rec."Category C"; + if (Sum <> 100) then + Error(SumErr); + end; +} \ No newline at end of file From 9a6c487d24cb49e4adf13f06bc221ce93de6b6d7 Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Wed, 17 Dec 2025 10:30:38 +1100 Subject: [PATCH 02/20] Added ABC Analysis Setup query --- .../APIs/ABCAnalysisSetupPBIAPI.Query.al | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/Apps/W1/PowerBIReports/App/Inventory/APIs/ABCAnalysisSetupPBIAPI.Query.al diff --git a/src/Apps/W1/PowerBIReports/App/Inventory/APIs/ABCAnalysisSetupPBIAPI.Query.al b/src/Apps/W1/PowerBIReports/App/Inventory/APIs/ABCAnalysisSetupPBIAPI.Query.al new file mode 100644 index 0000000000..06f187600e --- /dev/null +++ b/src/Apps/W1/PowerBIReports/App/Inventory/APIs/ABCAnalysisSetupPBIAPI.Query.al @@ -0,0 +1,34 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.Inventory.PowerBIReports; + +query 37022 "ABC Analysis Setup - PBI API" +{ + Access = Internal; + Caption = 'Power BI ABC Analysis Setup'; + QueryType = API; + APIPublisher = 'microsoft'; + APIGroup = 'analytics'; + ApiVersion = 'v1.0'; + EntityName = 'abcAnalysisSetup'; + EntitySetName = 'abcAnalysisSetups'; + DataAccessIntent = ReadOnly; + + elements + { + dataitem(abcAnalysisSetup; "ABC Analysis Setup") + { + column(categoryA; "Category A") + { + } + column(categoryB; "Category B") + { + } + column(categoryC; "Category C") + { + } + } + } +} \ No newline at end of file From fd75492b232702f3fbae95eedc65e693899727bc Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Wed, 17 Dec 2025 10:32:11 +1100 Subject: [PATCH 03/20] Added ABC Analysis Setup during app installation & upgrade --- .../Core/Codeunits/Initialization.Codeunit.al | 16 ++++++++++++++++ .../Core/Codeunits/PowerBIUpgrade.Codeunit.al | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/Apps/W1/PowerBIReports/App/Core/Codeunits/Initialization.Codeunit.al b/src/Apps/W1/PowerBIReports/App/Core/Codeunits/Initialization.Codeunit.al index 3c313c3071..a77198c3bf 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/Codeunits/Initialization.Codeunit.al +++ b/src/Apps/W1/PowerBIReports/App/Core/Codeunits/Initialization.Codeunit.al @@ -7,6 +7,7 @@ namespace Microsoft.PowerBIReports; using Microsoft.Finance.PowerBIReports; using Microsoft.Foundation.AuditCodes; using Microsoft.Foundation.Period; +using Microsoft.Inventory.PowerBIReports; using System.Diagnostics; using System.Environment.Configuration; using System.Media; @@ -34,6 +35,7 @@ codeunit 36951 Initialization InitializeDimSetEntryLastUpdated(); InitializeSetupFinancePowerBIReports(); InitializeCloseIncomeSourceCodes(); + InitializeABCAnalysisSetup(); end; internal procedure RestoreDimensionSetEntryCollectionJobQueueEntry() @@ -230,6 +232,20 @@ codeunit 36951 Initialization end; end; + internal procedure InitializeABCAnalysisSetup() + var + ABCAnalysisSetup: Record "ABC Analysis Setup"; + begin + if not ABCAnalysisSetup.Get() then begin + ABCAnalysisSetup.Init(); + ABCAnalysisSetup."Category A" := 50; + ABCAnalysisSetup."Category B" := 30; + ABCAnalysisSetup."Category C" := 20; + ABCAnalysisSetup.Insert(); + end; + end; + + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Change Log Management", 'OnAfterIsAlwaysLoggedTable', '', false, false)] local procedure OnAfterIsAlwaysLoggedTable(TableID: Integer; var AlwaysLogTable: Boolean) begin diff --git a/src/Apps/W1/PowerBIReports/App/Core/Codeunits/PowerBIUpgrade.Codeunit.al b/src/Apps/W1/PowerBIReports/App/Core/Codeunits/PowerBIUpgrade.Codeunit.al index edb23430c5..b9def50809 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/Codeunits/PowerBIUpgrade.Codeunit.al +++ b/src/Apps/W1/PowerBIReports/App/Core/Codeunits/PowerBIUpgrade.Codeunit.al @@ -16,6 +16,7 @@ codeunit 36957 "PowerBI Upgrade" TransferDimensionSetEntries(); InitialSetupUpgrade(); CloseIncomeSourceCodeUpgrade(); + InitializeABCAnalysisSetupUpgrade(); end; local procedure TransferDimensionSetEntries() @@ -59,6 +60,17 @@ codeunit 36957 "PowerBI Upgrade" UpgradeTag.SetUpgradeTag(CloseIncomeSourceCodeUpgradeTag()); end; + local procedure InitializeABCAnalysisSetupUpgrade() + var + Initialization: Codeunit Initialization; + UpgradeTag: Codeunit "Upgrade Tag"; + begin + if UpgradeTag.HasUpgradeTag(InitializeABCAnalysisSetupUpgradeTag()) then + exit; + Initialization.InitializeABCAnalysisSetup(); + UpgradeTag.SetUpgradeTag(InitializeABCAnalysisSetupUpgradeTag()); + end; + local procedure TransferDimensionSetEntriesUpgradeTag(): Code[250] begin exit('MS-561310-POWERBI-TRANSFER-DIMENSION-SET-ENTRIES-20250110'); @@ -74,10 +86,16 @@ codeunit 36957 "PowerBI Upgrade" exit('MS-GH-PY-529-POWERBI-CLSINCOME-UPGRADE-20250123'); end; + local procedure InitializeABCAnalysisSetupUpgradeTag(): Code[250] + begin + exit('MS-TEMP-POWERBI-ABC-ANALYSIS-SETUP-20251216'); //TODO: To be confirmed with Microsoft team. + end; + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Upgrade Tag", 'OnGetPerCompanyUpgradeTags', '', false, false)] local procedure RegisterPerCompanyTags(var PerCompanyUpgradeTags: List of [Code[250]]) begin PerCompanyUpgradeTags.Add(TransferDimensionSetEntriesUpgradeTag()); + PerCompanyUpgradeTags.Add(InitializeABCAnalysisSetupUpgradeTag()); end; } \ No newline at end of file From 50ba99f9c0c8b9b229816a779a5d0ac5ca988c35 Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Wed, 17 Dec 2025 10:35:28 +1100 Subject: [PATCH 04/20] Updated ABC Analysis Setup objects to permission sets --- .../Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al | 4 +++- .../Core/PermissionSets/PowerBiReportBasic.PermissionSet.al | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al index 0391d1e926..4c43db489b 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al +++ b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al @@ -5,6 +5,7 @@ namespace Microsoft.PowerBIReports; using Microsoft.Finance.PowerBIReports; +using Microsoft.Inventory.PowerBIReports; permissionset 36950 "PowerBI Report Admin" { @@ -17,5 +18,6 @@ permissionset 36950 "PowerBI Report Admin" tabledata "PowerBI Flat Dim. Set Entry" = RIMD, tabledata "PowerBI Reports Setup" = RIMD, tabledata "Working Day" = RIMD, - tabledata "Account Category" = RM; + tabledata "Account Category" = RMID, + tabledata "ABC Analysis Setup" = RMID; } \ No newline at end of file diff --git a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBiReportBasic.PermissionSet.al b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBiReportBasic.PermissionSet.al index 1daaf790fa..c571ebbdf3 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBiReportBasic.PermissionSet.al +++ b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBiReportBasic.PermissionSet.al @@ -21,10 +21,12 @@ permissionset 36951 "PowerBi Report Basic" tabledata "PowerBI Reports Setup" = R, tabledata "Working Day" = R, tabledata "Account Category" = R, + tabledata "ABC Analysis Setup" = R, table "PowerBI Flat Dim. Set Entry" = X, table "PowerBI Reports Setup" = X, table "Working Day" = X, table "Account Category" = X, + table "ABC Analysis Setup" = X, codeunit "Finance Filter Helper" = X, codeunit Initialization = X, codeunit "Installation Handler" = X, @@ -50,10 +52,12 @@ permissionset 36951 "PowerBi Report Basic" page "Working Days Setup" = X, page "Working Days Subform" = X, page "Account Categories" = X, + page "ABC Analysis Setup" = X, query "Account Categories" = X, query "Resources - PBI API" = X, query "Assembly Headers - Order" = X, query "Assembly Lines - Item" = X, + query "ABC Analysis Setup - PBI API" = X, query Bins = X, query "Calendar Entries" = X, query "Capacity Ledger Entries" = X, From 007c9b4b8687f4c6a7730b3d385294271a926be9 Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Wed, 17 Dec 2025 10:44:05 +1100 Subject: [PATCH 05/20] Added ABC Analysis embedded page --- .../PowerBIEmbeddedObjects.PermissionSet.al | 1 + .../WarehouseManagerRoleCenter.PageExt.al | 8 +++ .../WhseBasicRoleCenter.PageExt.al | 8 +++ .../Embedded/Inventory/ABCAnalysis.Page.al | 58 +++++++++++++++++++ 4 files changed, 75 insertions(+) create mode 100644 src/Apps/W1/PowerBIReports/App/Inventory/Embedded/Inventory/ABCAnalysis.Page.al diff --git a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIEmbeddedObjects.PermissionSet.al b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIEmbeddedObjects.PermissionSet.al index ab8a26a39d..f59ff85976 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIEmbeddedObjects.PermissionSet.al +++ b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIEmbeddedObjects.PermissionSet.al @@ -62,6 +62,7 @@ permissionset 36955 "Power BI Embedded - Objects" page "Inventory by Serial No." = X, page "PowerBI Bin Contents" = X, page "Bin Contents by Item Tracking" = X, + page "ABC Analysis" = X, page "Projects Overview" = X, page "Project Tasks" = X, page "Project Profitability" = X, diff --git a/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WarehouseManagerRoleCenter.PageExt.al b/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WarehouseManagerRoleCenter.PageExt.al index 8244777958..08a3c8b46b 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WarehouseManagerRoleCenter.PageExt.al +++ b/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WarehouseManagerRoleCenter.PageExt.al @@ -121,6 +121,14 @@ pageextension 36962 "Warehouse Manager Role Center" extends "Warehouse Manager R RunObject = page "Inventory Forecasting"; Tooltip = 'Open the Power BI Report that predicts your inventory trends, including forecasting of quantity across item, location and inventory posting groups.'; } + action("ABC Analysis (Power BI)") + { + ApplicationArea = Basic, Suite; + Caption = 'ABC Analysis (Power BI)'; + Image = "PowerBI"; + RunObject = page "ABC Analysis"; + Tooltip = 'Open the Power BI Report that performs an ABC analysis of your sales data, categorizing customers based on their contribution to total sales.'; + } } } } diff --git a/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WhseBasicRoleCenter.PageExt.al b/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WhseBasicRoleCenter.PageExt.al index 2f7e04caba..1a9b158ef1 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WhseBasicRoleCenter.PageExt.al +++ b/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WhseBasicRoleCenter.PageExt.al @@ -121,6 +121,14 @@ pageextension 36956 "Whse. Basic Role Center" extends "Whse. Basic Role Center" RunObject = page "Inventory Forecasting"; Tooltip = 'Open the Power BI Report that predicts your inventory trends, including forecasting of quantity across item, location and inventory posting groups.'; } + action("ABC Analysis (Power BI)") + { + ApplicationArea = Basic, Suite; + Caption = 'ABC Analysis (Power BI)'; + Image = "PowerBI"; + RunObject = page "ABC Analysis"; + Tooltip = 'Open the Power BI Report that performs an ABC analysis of your sales data, categorizing customers based on their contribution to total sales.'; + } } } } diff --git a/src/Apps/W1/PowerBIReports/App/Inventory/Embedded/Inventory/ABCAnalysis.Page.al b/src/Apps/W1/PowerBIReports/App/Inventory/Embedded/Inventory/ABCAnalysis.Page.al new file mode 100644 index 0000000000..178b35c2f1 --- /dev/null +++ b/src/Apps/W1/PowerBIReports/App/Inventory/Embedded/Inventory/ABCAnalysis.Page.al @@ -0,0 +1,58 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.PowerBIReports; + +using System.Integration.PowerBI; + +page 37111 "ABC Analysis" +{ + UsageCategory = ReportsAndAnalysis; + ApplicationArea = All; + PageType = UserControlHost; + Caption = 'ABC Analysis'; + AboutTitle = 'About ABC Analysis'; + AboutText = 'The ABC Analysis page provides insights into customer segmentation based on sales volume, helping to identify key customers and prioritize sales efforts.'; + + layout + { + area(Content) + { + usercontrol(PowerBIAddin; PowerBIManagement) + { + ApplicationArea = All; + + trigger ControlAddInReady() + begin + SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageLbl); + end; + + trigger ReportLoaded(ReportFilters: Text; ActivePageName: Text; ActivePageFilters: Text; CorrelationId: Text) + begin + SetupHelper.LogReportLoaded(CorrelationId); + end; + + trigger ErrorOccurred(Operation: Text; ErrorText: Text) + begin + SetupHelper.LogError(Operation, ErrorText); + SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText); + end; + } + } + } + + var + SetupHelper: Codeunit "Power BI Report Setup"; + ReportId: Guid; + ReportPageLbl: Label 'a476d6afc8d5d544193b', Locked = true; + + trigger OnOpenPage() + var + PowerBIReportsSetup: Record "PowerBI Reports Setup"; + begin + SetupHelper.EnsureUserAcceptedPowerBITerms(); + ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Sales Report Id")); + end; +} + From d0d713a2c9be9b1a7535d27f7fa66eec6db177b9 Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Fri, 2 Jan 2026 15:09:45 +1100 Subject: [PATCH 06/20] Renamed & improved ABC Analysis Setup objects --- .../App/Core/Codeunits/Initialization.Codeunit.al | 2 +- .../App/Core/Pages/PowerBIReportsSetup.Page.al | 12 ++++++++++++ .../PowerBIReportAdmin.PermissionSet.al | 2 +- .../PowerBiReportBasic.PermissionSet.al | 6 +++--- .../Inventory/APIs/ABCAnalysisSetupPBIAPI.Query.al | 2 +- .../App/Inventory/Pages/ABCAnalysisSetup.Page.al | 8 ++++---- .../App/Inventory/Tables/ABCAnalysisSetup.Table.al | 12 +++++------- 7 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/Apps/W1/PowerBIReports/App/Core/Codeunits/Initialization.Codeunit.al b/src/Apps/W1/PowerBIReports/App/Core/Codeunits/Initialization.Codeunit.al index a77198c3bf..2ff8c0e7f3 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/Codeunits/Initialization.Codeunit.al +++ b/src/Apps/W1/PowerBIReports/App/Core/Codeunits/Initialization.Codeunit.al @@ -234,7 +234,7 @@ codeunit 36951 Initialization internal procedure InitializeABCAnalysisSetup() var - ABCAnalysisSetup: Record "ABC Analysis Setup"; + ABCAnalysisSetup: Record "PowerBI ABC Analysis Setup"; begin if not ABCAnalysisSetup.Get() then begin ABCAnalysisSetup.Init(); diff --git a/src/Apps/W1/PowerBIReports/App/Core/Pages/PowerBIReportsSetup.Page.al b/src/Apps/W1/PowerBIReports/App/Core/Pages/PowerBIReportsSetup.Page.al index 1cef0db07c..3c12f5d3f0 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/Pages/PowerBIReportsSetup.Page.al +++ b/src/Apps/W1/PowerBIReports/App/Core/Pages/PowerBIReportsSetup.Page.al @@ -5,6 +5,7 @@ namespace Microsoft.PowerBIReports; using Microsoft.Finance.PowerBIReports; +using Microsoft.Inventory.PowerBIReports; using System.DateTime; using System.Environment; @@ -580,6 +581,14 @@ page 36951 "PowerBI Reports Setup" Image = CodesList; RunObject = page "PBI Close Income Stmt. SC."; } + action(SetupABCAnalysis) + { + ApplicationArea = All; + Caption = 'ABC Analysis Setup'; + ToolTip = 'Set up the percentage boundaries for ABC Analysis categories in the Power BI Inventory reports.'; + Image = AnalysisView; + RunObject = page "PowerBI ABC Analysis Setup"; + } } area(Promoted) @@ -598,6 +607,9 @@ page 36951 "PowerBI Reports Setup" actionref(CloseIncomeStatementSourceCodes_Promoted; CloseIncomeStatementSourceCodes) { } + actionref(SetupABCAnalysis_Promoted; SetupABCAnalysis) + { + } } } } diff --git a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al index 4c43db489b..6c9d660171 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al +++ b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al @@ -19,5 +19,5 @@ permissionset 36950 "PowerBI Report Admin" tabledata "PowerBI Reports Setup" = RIMD, tabledata "Working Day" = RIMD, tabledata "Account Category" = RMID, - tabledata "ABC Analysis Setup" = RMID; + tabledata "PowerBI ABC Analysis Setup" = RMID; } \ No newline at end of file diff --git a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBiReportBasic.PermissionSet.al b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBiReportBasic.PermissionSet.al index c571ebbdf3..07d5f32ba7 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBiReportBasic.PermissionSet.al +++ b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBiReportBasic.PermissionSet.al @@ -21,12 +21,12 @@ permissionset 36951 "PowerBi Report Basic" tabledata "PowerBI Reports Setup" = R, tabledata "Working Day" = R, tabledata "Account Category" = R, - tabledata "ABC Analysis Setup" = R, + tabledata "PowerBI ABC Analysis Setup" = R, table "PowerBI Flat Dim. Set Entry" = X, table "PowerBI Reports Setup" = X, table "Working Day" = X, table "Account Category" = X, - table "ABC Analysis Setup" = X, + table "PowerBI ABC Analysis Setup" = X, codeunit "Finance Filter Helper" = X, codeunit Initialization = X, codeunit "Installation Handler" = X, @@ -52,7 +52,7 @@ permissionset 36951 "PowerBi Report Basic" page "Working Days Setup" = X, page "Working Days Subform" = X, page "Account Categories" = X, - page "ABC Analysis Setup" = X, + page "PowerBI ABC Analysis Setup" = X, query "Account Categories" = X, query "Resources - PBI API" = X, query "Assembly Headers - Order" = X, diff --git a/src/Apps/W1/PowerBIReports/App/Inventory/APIs/ABCAnalysisSetupPBIAPI.Query.al b/src/Apps/W1/PowerBIReports/App/Inventory/APIs/ABCAnalysisSetupPBIAPI.Query.al index 06f187600e..35b72de49e 100644 --- a/src/Apps/W1/PowerBIReports/App/Inventory/APIs/ABCAnalysisSetupPBIAPI.Query.al +++ b/src/Apps/W1/PowerBIReports/App/Inventory/APIs/ABCAnalysisSetupPBIAPI.Query.al @@ -18,7 +18,7 @@ query 37022 "ABC Analysis Setup - PBI API" elements { - dataitem(abcAnalysisSetup; "ABC Analysis Setup") + dataitem(abcAnalysisSetup; "PowerBI ABC Analysis Setup") { column(categoryA; "Category A") { diff --git a/src/Apps/W1/PowerBIReports/App/Inventory/Pages/ABCAnalysisSetup.Page.al b/src/Apps/W1/PowerBIReports/App/Inventory/Pages/ABCAnalysisSetup.Page.al index a828624c66..494f3ba678 100644 --- a/src/Apps/W1/PowerBIReports/App/Inventory/Pages/ABCAnalysisSetup.Page.al +++ b/src/Apps/W1/PowerBIReports/App/Inventory/Pages/ABCAnalysisSetup.Page.al @@ -4,15 +4,15 @@ // ------------------------------------------------------------------------------------------------ namespace Microsoft.Inventory.PowerBIReports; -page 36982 "ABC Analysis Setup" +page 36982 "PowerBI ABC Analysis Setup" { Caption = 'ABC Analysis Setup'; - SourceTable = "ABC Analysis Setup"; + SourceTable = "PowerBI ABC Analysis Setup"; PageType = Card; - ApplicationArea = All; - UsageCategory = Administration; DeleteAllowed = false; InsertAllowed = false; + AboutTitle = 'About ABC Analysis Setup'; + AboutText = 'Set up the percentage boundaries for ABC Analysis categories in the Power BI Inventory reports. Category A typically represents the most valuable items, Category B represents moderately valuable items, and Category C represents the least valuable items. The sum of the percentages for all three categories must equal 100%.'; layout { diff --git a/src/Apps/W1/PowerBIReports/App/Inventory/Tables/ABCAnalysisSetup.Table.al b/src/Apps/W1/PowerBIReports/App/Inventory/Tables/ABCAnalysisSetup.Table.al index 3eb3534c3a..a2591ed568 100644 --- a/src/Apps/W1/PowerBIReports/App/Inventory/Tables/ABCAnalysisSetup.Table.al +++ b/src/Apps/W1/PowerBIReports/App/Inventory/Tables/ABCAnalysisSetup.Table.al @@ -4,10 +4,10 @@ // ------------------------------------------------------------------------------------------------ namespace Microsoft.Inventory.PowerBIReports; -table 36956 "ABC Analysis Setup" +table 36956 "PowerBI ABC Analysis Setup" { Access = Internal; - Caption = 'ABC Analysis Setup'; + Caption = 'Power BI ABC Analysis Setup'; DataClassification = CustomerContent; fields @@ -55,11 +55,9 @@ table 36956 "ABC Analysis Setup" internal procedure ValidateCategoryFields() var - Sum: Decimal; - SumErr: Label 'The total of Category A, B, and C percentages must equal 100. Please adjust the values accordingly.'; + CategoriesSumErr: Label 'The total of Category A, B, and C percentages must equal 100. Please adjust the values accordingly.'; begin - Sum := Rec."Category A" + Rec."Category B" + Rec."Category C"; - if (Sum <> 100) then - Error(SumErr); + if (Rec."Category A" + Rec."Category B" + Rec."Category C" <> 100) then + Error(CategoriesSumErr); end; } \ No newline at end of file From b6bc6c71cc41a15da4a180f92a2e71df493a6c05 Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Fri, 2 Jan 2026 15:12:30 +1100 Subject: [PATCH 07/20] Renamed PowerBI ABC Analysis embedded page --- .../Core/PermissionSets/PowerBIEmbeddedObjects.PermissionSet.al | 2 +- .../RoleCenterExtensions/WarehouseManagerRoleCenter.PageExt.al | 2 +- .../Core/RoleCenterExtensions/WhseBasicRoleCenter.PageExt.al | 2 +- .../App/Inventory/Embedded/Inventory/ABCAnalysis.Page.al | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIEmbeddedObjects.PermissionSet.al b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIEmbeddedObjects.PermissionSet.al index f59ff85976..f84542e219 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIEmbeddedObjects.PermissionSet.al +++ b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIEmbeddedObjects.PermissionSet.al @@ -62,7 +62,7 @@ permissionset 36955 "Power BI Embedded - Objects" page "Inventory by Serial No." = X, page "PowerBI Bin Contents" = X, page "Bin Contents by Item Tracking" = X, - page "ABC Analysis" = X, + page "PowerBI ABC Analysis" = X, page "Projects Overview" = X, page "Project Tasks" = X, page "Project Profitability" = X, diff --git a/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WarehouseManagerRoleCenter.PageExt.al b/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WarehouseManagerRoleCenter.PageExt.al index 08a3c8b46b..32f2ee409e 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WarehouseManagerRoleCenter.PageExt.al +++ b/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WarehouseManagerRoleCenter.PageExt.al @@ -126,7 +126,7 @@ pageextension 36962 "Warehouse Manager Role Center" extends "Warehouse Manager R ApplicationArea = Basic, Suite; Caption = 'ABC Analysis (Power BI)'; Image = "PowerBI"; - RunObject = page "ABC Analysis"; + RunObject = page "PowerBI ABC Analysis"; Tooltip = 'Open the Power BI Report that performs an ABC analysis of your sales data, categorizing customers based on their contribution to total sales.'; } } diff --git a/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WhseBasicRoleCenter.PageExt.al b/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WhseBasicRoleCenter.PageExt.al index 1a9b158ef1..151c33b3c5 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WhseBasicRoleCenter.PageExt.al +++ b/src/Apps/W1/PowerBIReports/App/Core/RoleCenterExtensions/WhseBasicRoleCenter.PageExt.al @@ -126,7 +126,7 @@ pageextension 36956 "Whse. Basic Role Center" extends "Whse. Basic Role Center" ApplicationArea = Basic, Suite; Caption = 'ABC Analysis (Power BI)'; Image = "PowerBI"; - RunObject = page "ABC Analysis"; + RunObject = page "PowerBI ABC Analysis"; Tooltip = 'Open the Power BI Report that performs an ABC analysis of your sales data, categorizing customers based on their contribution to total sales.'; } } diff --git a/src/Apps/W1/PowerBIReports/App/Inventory/Embedded/Inventory/ABCAnalysis.Page.al b/src/Apps/W1/PowerBIReports/App/Inventory/Embedded/Inventory/ABCAnalysis.Page.al index 178b35c2f1..b5b5a603e3 100644 --- a/src/Apps/W1/PowerBIReports/App/Inventory/Embedded/Inventory/ABCAnalysis.Page.al +++ b/src/Apps/W1/PowerBIReports/App/Inventory/Embedded/Inventory/ABCAnalysis.Page.al @@ -6,7 +6,7 @@ namespace Microsoft.PowerBIReports; using System.Integration.PowerBI; -page 37111 "ABC Analysis" +page 37111 "PowerBI ABC Analysis" { UsageCategory = ReportsAndAnalysis; ApplicationArea = All; From 311dfec1a8ba5be4d1ad5aeaae83f043260405df Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Wed, 21 Jan 2026 14:13:33 +1100 Subject: [PATCH 08/20] Renamed files --- ...sis.Page.al => PowerBIABCAnalysis.Page.al} | 116 +++++++++--------- ...age.al => PowerBIABCAnalysisSetup.Page.al} | 0 ...le.al => PowerBIABCAnalysisSetup.Table.al} | 0 3 files changed, 58 insertions(+), 58 deletions(-) rename src/Apps/W1/PowerBIReports/App/Inventory/Embedded/Inventory/{ABCAnalysis.Page.al => PowerBIABCAnalysis.Page.al} (97%) rename src/Apps/W1/PowerBIReports/App/Inventory/Pages/{ABCAnalysisSetup.Page.al => PowerBIABCAnalysisSetup.Page.al} (100%) rename src/Apps/W1/PowerBIReports/App/Inventory/Tables/{ABCAnalysisSetup.Table.al => PowerBIABCAnalysisSetup.Table.al} (100%) diff --git a/src/Apps/W1/PowerBIReports/App/Inventory/Embedded/Inventory/ABCAnalysis.Page.al b/src/Apps/W1/PowerBIReports/App/Inventory/Embedded/Inventory/PowerBIABCAnalysis.Page.al similarity index 97% rename from src/Apps/W1/PowerBIReports/App/Inventory/Embedded/Inventory/ABCAnalysis.Page.al rename to src/Apps/W1/PowerBIReports/App/Inventory/Embedded/Inventory/PowerBIABCAnalysis.Page.al index b5b5a603e3..17c4ce180b 100644 --- a/src/Apps/W1/PowerBIReports/App/Inventory/Embedded/Inventory/ABCAnalysis.Page.al +++ b/src/Apps/W1/PowerBIReports/App/Inventory/Embedded/Inventory/PowerBIABCAnalysis.Page.al @@ -1,58 +1,58 @@ -// ------------------------------------------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// ------------------------------------------------------------------------------------------------ -namespace Microsoft.PowerBIReports; - -using System.Integration.PowerBI; - -page 37111 "PowerBI ABC Analysis" -{ - UsageCategory = ReportsAndAnalysis; - ApplicationArea = All; - PageType = UserControlHost; - Caption = 'ABC Analysis'; - AboutTitle = 'About ABC Analysis'; - AboutText = 'The ABC Analysis page provides insights into customer segmentation based on sales volume, helping to identify key customers and prioritize sales efforts.'; - - layout - { - area(Content) - { - usercontrol(PowerBIAddin; PowerBIManagement) - { - ApplicationArea = All; - - trigger ControlAddInReady() - begin - SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageLbl); - end; - - trigger ReportLoaded(ReportFilters: Text; ActivePageName: Text; ActivePageFilters: Text; CorrelationId: Text) - begin - SetupHelper.LogReportLoaded(CorrelationId); - end; - - trigger ErrorOccurred(Operation: Text; ErrorText: Text) - begin - SetupHelper.LogError(Operation, ErrorText); - SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText); - end; - } - } - } - - var - SetupHelper: Codeunit "Power BI Report Setup"; - ReportId: Guid; - ReportPageLbl: Label 'a476d6afc8d5d544193b', Locked = true; - - trigger OnOpenPage() - var - PowerBIReportsSetup: Record "PowerBI Reports Setup"; - begin - SetupHelper.EnsureUserAcceptedPowerBITerms(); - ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Sales Report Id")); - end; -} - +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.PowerBIReports; + +using System.Integration.PowerBI; + +page 37111 "PowerBI ABC Analysis" +{ + UsageCategory = ReportsAndAnalysis; + ApplicationArea = All; + PageType = UserControlHost; + Caption = 'ABC Analysis'; + AboutTitle = 'About ABC Analysis'; + AboutText = 'The ABC Analysis page provides insights into customer segmentation based on sales volume, helping to identify key customers and prioritize sales efforts.'; + + layout + { + area(Content) + { + usercontrol(PowerBIAddin; PowerBIManagement) + { + ApplicationArea = All; + + trigger ControlAddInReady() + begin + SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageLbl); + end; + + trigger ReportLoaded(ReportFilters: Text; ActivePageName: Text; ActivePageFilters: Text; CorrelationId: Text) + begin + SetupHelper.LogReportLoaded(CorrelationId); + end; + + trigger ErrorOccurred(Operation: Text; ErrorText: Text) + begin + SetupHelper.LogError(Operation, ErrorText); + SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText); + end; + } + } + } + + var + SetupHelper: Codeunit "Power BI Report Setup"; + ReportId: Guid; + ReportPageLbl: Label 'a476d6afc8d5d544193b', Locked = true; + + trigger OnOpenPage() + var + PowerBIReportsSetup: Record "PowerBI Reports Setup"; + begin + SetupHelper.EnsureUserAcceptedPowerBITerms(); + ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Sales Report Id")); + end; +} + diff --git a/src/Apps/W1/PowerBIReports/App/Inventory/Pages/ABCAnalysisSetup.Page.al b/src/Apps/W1/PowerBIReports/App/Inventory/Pages/PowerBIABCAnalysisSetup.Page.al similarity index 100% rename from src/Apps/W1/PowerBIReports/App/Inventory/Pages/ABCAnalysisSetup.Page.al rename to src/Apps/W1/PowerBIReports/App/Inventory/Pages/PowerBIABCAnalysisSetup.Page.al diff --git a/src/Apps/W1/PowerBIReports/App/Inventory/Tables/ABCAnalysisSetup.Table.al b/src/Apps/W1/PowerBIReports/App/Inventory/Tables/PowerBIABCAnalysisSetup.Table.al similarity index 100% rename from src/Apps/W1/PowerBIReports/App/Inventory/Tables/ABCAnalysisSetup.Table.al rename to src/Apps/W1/PowerBIReports/App/Inventory/Tables/PowerBIABCAnalysisSetup.Table.al From e9e900b43624ddf0e5badab046d885a89ef3a036 Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Wed, 21 Jan 2026 14:14:18 +1100 Subject: [PATCH 09/20] Reordered RIMD permissions --- .../Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al index 6c9d660171..52c5f3d891 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al +++ b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al @@ -18,6 +18,6 @@ permissionset 36950 "PowerBI Report Admin" tabledata "PowerBI Flat Dim. Set Entry" = RIMD, tabledata "PowerBI Reports Setup" = RIMD, tabledata "Working Day" = RIMD, - tabledata "Account Category" = RMID, - tabledata "PowerBI ABC Analysis Setup" = RMID; + tabledata "Account Category" = RIMD, + tabledata "PowerBI ABC Analysis Setup" = RIMD; } \ No newline at end of file From 821bb6cc05b0e38f3412702cdeed94be40c93362 Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Wed, 21 Jan 2026 14:14:54 +1100 Subject: [PATCH 10/20] Reverted Account Category permissions --- .../App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al index 52c5f3d891..93dad71a69 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al +++ b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al @@ -18,6 +18,6 @@ permissionset 36950 "PowerBI Report Admin" tabledata "PowerBI Flat Dim. Set Entry" = RIMD, tabledata "PowerBI Reports Setup" = RIMD, tabledata "Working Day" = RIMD, - tabledata "Account Category" = RIMD, + tabledata "Account Category" = RM, tabledata "PowerBI ABC Analysis Setup" = RIMD; } \ No newline at end of file From f8c62c382af2e29509f51c6947ac8eb80eeec8dc Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Wed, 28 Jan 2026 10:56:22 +1100 Subject: [PATCH 11/20] Updated upgrade tag for ABC Analysis Setup --- .../App/Core/Codeunits/PowerBIUpgrade.Codeunit.al | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Apps/W1/PowerBIReports/App/Core/Codeunits/PowerBIUpgrade.Codeunit.al b/src/Apps/W1/PowerBIReports/App/Core/Codeunits/PowerBIUpgrade.Codeunit.al index b9def50809..135df82918 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/Codeunits/PowerBIUpgrade.Codeunit.al +++ b/src/Apps/W1/PowerBIReports/App/Core/Codeunits/PowerBIUpgrade.Codeunit.al @@ -88,7 +88,7 @@ codeunit 36957 "PowerBI Upgrade" local procedure InitializeABCAnalysisSetupUpgradeTag(): Code[250] begin - exit('MS-TEMP-POWERBI-ABC-ANALYSIS-SETUP-20251216'); //TODO: To be confirmed with Microsoft team. + exit('MS-606229-PowerBIABCAnalysisSetup-20251216'); end; [EventSubscriber(ObjectType::Codeunit, Codeunit::"Upgrade Tag", 'OnGetPerCompanyUpgradeTags', '', false, false)] From b183688a6bf4bc7ce4d73cddac9544cf707ed5cd Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Mon, 2 Feb 2026 16:57:13 +1100 Subject: [PATCH 12/20] Updated dataitem to reference ABC Analysis Setup from Base App --- .../App/Inventory/APIs/ABCAnalysisSetupPBIAPI.Query.al | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Apps/W1/PowerBIReports/App/Inventory/APIs/ABCAnalysisSetupPBIAPI.Query.al b/src/Apps/W1/PowerBIReports/App/Inventory/APIs/ABCAnalysisSetupPBIAPI.Query.al index 35b72de49e..947e26e460 100644 --- a/src/Apps/W1/PowerBIReports/App/Inventory/APIs/ABCAnalysisSetupPBIAPI.Query.al +++ b/src/Apps/W1/PowerBIReports/App/Inventory/APIs/ABCAnalysisSetupPBIAPI.Query.al @@ -4,6 +4,8 @@ // ------------------------------------------------------------------------------------------------ namespace Microsoft.Inventory.PowerBIReports; +using Microsoft.Inventory.Analysis; + query 37022 "ABC Analysis Setup - PBI API" { Access = Internal; @@ -18,7 +20,7 @@ query 37022 "ABC Analysis Setup - PBI API" elements { - dataitem(abcAnalysisSetup; "PowerBI ABC Analysis Setup") + dataitem(abcAnalysisSetup; "ABC Analysis Setup") { column(categoryA; "Category A") { From 4edf426a72e2dace51597ffe3b6223d817ff0860 Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Mon, 2 Feb 2026 16:58:22 +1100 Subject: [PATCH 13/20] Removed ABC Analysis Setup table & page (Migrated to Base App) --- .../Pages/PowerBIABCAnalysisSetup.Page.al | 174 ------------------ .../Tables/PowerBIABCAnalysisSetup.Table.al | 63 ------- 2 files changed, 237 deletions(-) delete mode 100644 src/Apps/W1/PowerBIReports/App/Inventory/Pages/PowerBIABCAnalysisSetup.Page.al delete mode 100644 src/Apps/W1/PowerBIReports/App/Inventory/Tables/PowerBIABCAnalysisSetup.Table.al diff --git a/src/Apps/W1/PowerBIReports/App/Inventory/Pages/PowerBIABCAnalysisSetup.Page.al b/src/Apps/W1/PowerBIReports/App/Inventory/Pages/PowerBIABCAnalysisSetup.Page.al deleted file mode 100644 index 494f3ba678..0000000000 --- a/src/Apps/W1/PowerBIReports/App/Inventory/Pages/PowerBIABCAnalysisSetup.Page.al +++ /dev/null @@ -1,174 +0,0 @@ -// ------------------------------------------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// ------------------------------------------------------------------------------------------------ -namespace Microsoft.Inventory.PowerBIReports; - -page 36982 "PowerBI ABC Analysis Setup" -{ - Caption = 'ABC Analysis Setup'; - SourceTable = "PowerBI ABC Analysis Setup"; - PageType = Card; - DeleteAllowed = false; - InsertAllowed = false; - AboutTitle = 'About ABC Analysis Setup'; - AboutText = 'Set up the percentage boundaries for ABC Analysis categories in the Power BI Inventory reports. Category A typically represents the most valuable items, Category B represents moderately valuable items, and Category C represents the least valuable items. The sum of the percentages for all three categories must equal 100%.'; - - layout - { - area(content) - { - group(General) - { - Caption = 'General'; - Editable = true; - - field("Category A"; Rec."Category A") - { - ApplicationArea = All; - Caption = 'A Category'; - - trigger OnValidate() - begin - StyleExpr := GetStatusStyleExpr(); - CalculateBoundaries(); - end; - } - field("Category B"; Rec."Category B") - { - ApplicationArea = All; - Caption = 'B Category'; - - trigger OnValidate() - begin - StyleExpr := GetStatusStyleExpr(); - CalculateBoundaries(); - end; - } - field("Category C"; Rec."Category C") - { - ApplicationArea = All; - Caption = 'C Category'; - - trigger OnValidate() - begin - StyleExpr := GetStatusStyleExpr(); - CalculateBoundaries(); - end; - } - field(Sum; Rec."Category A" + Rec."Category B" + Rec."Category C") - { - ApplicationArea = All; - Caption = 'Sum'; - AutoFormatType = 0; - Editable = false; - StyleExpr = StyleExpr; - } - } - group("Category A Setup") - { - Caption = 'Category A'; - Editable = false; - - field(CatALowerBound; CatALowerBound) - { - ApplicationArea = All; - AutoFormatType = 0; - Caption = 'Lower Bound (%)'; - Editable = false; - } - field(CatAUpperBound; CatAUpperBound) - { - ApplicationArea = All; - AutoFormatType = 0; - Caption = 'Upper Bound (%)'; - Editable = false; - } - } - group("Category B Setup") - { - Caption = 'Category B'; - Editable = false; - - field(CatBLowerbound; CatBLowerbound) - { - ApplicationArea = All; - AutoFormatType = 0; - Caption = 'Lower Bound (%)'; - Editable = false; - } - field(CatBUpperBound; CatBUpperBound) - { - ApplicationArea = All; - AutoFormatType = 0; - Caption = 'Upper Bound (%)'; - Editable = false; - } - } - group("Category C Setup") - { - Caption = 'Category C'; - Editable = false; - - field(CatCLowerbound; CatCLowerbound) - { - ApplicationArea = All; - AutoFormatType = 0; - Caption = 'Lower Bound (%)'; - Editable = false; - } - field(CatCUpperBound; CatCUpperBound) - { - ApplicationArea = All; - AutoFormatType = 0; - Caption = 'Upper Bound (%)'; - Editable = false; - } - } - } - } - - var - CatALowerbound: Decimal; - CatAUpperBound: Decimal; - CatBLowerbound: Decimal; - CatBUpperBound: Decimal; - CatCLowerbound: Decimal; - CatCUpperBound: Decimal; - StyleExpr: Text; - - trigger OnOpenPage() - begin - CalculateBoundaries(); - end; - - trigger OnQueryClosePage(CloseAction: Action): Boolean - begin - Rec.ValidateCategoryFields(); - end; - - trigger OnAfterGetRecord() - begin - StyleExpr := GetStatusStyleExpr(); - end; - - local procedure GetStatusStyleExpr(): Text - begin - if (Rec."Category A" + Rec."Category B" + Rec."Category C" = 100) then - exit('Favorable'); - - exit('Unfavorable'); - end; - - local procedure CalculateBoundaries() - begin - CatALowerbound := 0; - CatAUpperBound := Rec."Category A"; - - CatBLowerbound := CatAUpperBound; - CatBUpperBound := CatBLowerbound + Rec."Category B"; - - CatCLowerbound := CatBUpperBound; - CatCUpperBound := CatCLowerbound + Rec."Category C"; - end; -} \ No newline at end of file diff --git a/src/Apps/W1/PowerBIReports/App/Inventory/Tables/PowerBIABCAnalysisSetup.Table.al b/src/Apps/W1/PowerBIReports/App/Inventory/Tables/PowerBIABCAnalysisSetup.Table.al deleted file mode 100644 index a2591ed568..0000000000 --- a/src/Apps/W1/PowerBIReports/App/Inventory/Tables/PowerBIABCAnalysisSetup.Table.al +++ /dev/null @@ -1,63 +0,0 @@ -// ------------------------------------------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// ------------------------------------------------------------------------------------------------ -namespace Microsoft.Inventory.PowerBIReports; - -table 36956 "PowerBI ABC Analysis Setup" -{ - Access = Internal; - Caption = 'Power BI ABC Analysis Setup'; - DataClassification = CustomerContent; - - fields - { - field(1; "Primary Key"; Code[10]) - { - Caption = 'Primary Key'; - } - field(2; "Category A"; Decimal) - { - Caption = 'Category A'; - AutoFormatType = 0; - InitValue = 0; - MinValue = 0; - MaxValue = 100; - DecimalPlaces = 0 : 5; - } - field(3; "Category B"; Decimal) - { - Caption = 'Category B'; - AutoFormatType = 0; - InitValue = 0; - MinValue = 0; - MaxValue = 100; - DecimalPlaces = 0 : 5; - } - field(4; "Category C"; Decimal) - { - Caption = 'Category C'; - AutoFormatType = 0; - InitValue = 0; - MinValue = 0; - MaxValue = 100; - DecimalPlaces = 0 : 5; - } - } - - keys - { - key(PK; "Primary Key") - { - Clustered = true; - } - } - - internal procedure ValidateCategoryFields() - var - CategoriesSumErr: Label 'The total of Category A, B, and C percentages must equal 100. Please adjust the values accordingly.'; - begin - if (Rec."Category A" + Rec."Category B" + Rec."Category C" <> 100) then - Error(CategoriesSumErr); - end; -} \ No newline at end of file From 450cf516617c82baaef218c629e5090c3e7e2ce6 Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Mon, 2 Feb 2026 16:59:48 +1100 Subject: [PATCH 14/20] Updated permission sets --- .../Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al | 3 +-- .../Core/PermissionSets/PowerBiReportBasic.PermissionSet.al | 3 --- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al index 93dad71a69..28cc336752 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al +++ b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al @@ -18,6 +18,5 @@ permissionset 36950 "PowerBI Report Admin" tabledata "PowerBI Flat Dim. Set Entry" = RIMD, tabledata "PowerBI Reports Setup" = RIMD, tabledata "Working Day" = RIMD, - tabledata "Account Category" = RM, - tabledata "PowerBI ABC Analysis Setup" = RIMD; + tabledata "Account Category" = RM; } \ No newline at end of file diff --git a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBiReportBasic.PermissionSet.al b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBiReportBasic.PermissionSet.al index 07d5f32ba7..9a8ad3d7f5 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBiReportBasic.PermissionSet.al +++ b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBiReportBasic.PermissionSet.al @@ -21,12 +21,10 @@ permissionset 36951 "PowerBi Report Basic" tabledata "PowerBI Reports Setup" = R, tabledata "Working Day" = R, tabledata "Account Category" = R, - tabledata "PowerBI ABC Analysis Setup" = R, table "PowerBI Flat Dim. Set Entry" = X, table "PowerBI Reports Setup" = X, table "Working Day" = X, table "Account Category" = X, - table "PowerBI ABC Analysis Setup" = X, codeunit "Finance Filter Helper" = X, codeunit Initialization = X, codeunit "Installation Handler" = X, @@ -52,7 +50,6 @@ permissionset 36951 "PowerBi Report Basic" page "Working Days Setup" = X, page "Working Days Subform" = X, page "Account Categories" = X, - page "PowerBI ABC Analysis Setup" = X, query "Account Categories" = X, query "Resources - PBI API" = X, query "Assembly Headers - Order" = X, From 52c19904fe92be0204e703d0e86e65e45f30f569 Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Mon, 2 Feb 2026 17:00:07 +1100 Subject: [PATCH 15/20] Removed ABC Analysis Setup upgrade & initialization --- .../App/Core/Codeunits/Initialization.Codeunit.al | 15 --------------- .../App/Core/Codeunits/PowerBIUpgrade.Codeunit.al | 12 ------------ 2 files changed, 27 deletions(-) diff --git a/src/Apps/W1/PowerBIReports/App/Core/Codeunits/Initialization.Codeunit.al b/src/Apps/W1/PowerBIReports/App/Core/Codeunits/Initialization.Codeunit.al index 2ff8c0e7f3..82a33c329c 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/Codeunits/Initialization.Codeunit.al +++ b/src/Apps/W1/PowerBIReports/App/Core/Codeunits/Initialization.Codeunit.al @@ -35,7 +35,6 @@ codeunit 36951 Initialization InitializeDimSetEntryLastUpdated(); InitializeSetupFinancePowerBIReports(); InitializeCloseIncomeSourceCodes(); - InitializeABCAnalysisSetup(); end; internal procedure RestoreDimensionSetEntryCollectionJobQueueEntry() @@ -232,20 +231,6 @@ codeunit 36951 Initialization end; end; - internal procedure InitializeABCAnalysisSetup() - var - ABCAnalysisSetup: Record "PowerBI ABC Analysis Setup"; - begin - if not ABCAnalysisSetup.Get() then begin - ABCAnalysisSetup.Init(); - ABCAnalysisSetup."Category A" := 50; - ABCAnalysisSetup."Category B" := 30; - ABCAnalysisSetup."Category C" := 20; - ABCAnalysisSetup.Insert(); - end; - end; - - [EventSubscriber(ObjectType::Codeunit, Codeunit::"Change Log Management", 'OnAfterIsAlwaysLoggedTable', '', false, false)] local procedure OnAfterIsAlwaysLoggedTable(TableID: Integer; var AlwaysLogTable: Boolean) begin diff --git a/src/Apps/W1/PowerBIReports/App/Core/Codeunits/PowerBIUpgrade.Codeunit.al b/src/Apps/W1/PowerBIReports/App/Core/Codeunits/PowerBIUpgrade.Codeunit.al index 135df82918..afe40426ba 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/Codeunits/PowerBIUpgrade.Codeunit.al +++ b/src/Apps/W1/PowerBIReports/App/Core/Codeunits/PowerBIUpgrade.Codeunit.al @@ -16,7 +16,6 @@ codeunit 36957 "PowerBI Upgrade" TransferDimensionSetEntries(); InitialSetupUpgrade(); CloseIncomeSourceCodeUpgrade(); - InitializeABCAnalysisSetupUpgrade(); end; local procedure TransferDimensionSetEntries() @@ -60,17 +59,6 @@ codeunit 36957 "PowerBI Upgrade" UpgradeTag.SetUpgradeTag(CloseIncomeSourceCodeUpgradeTag()); end; - local procedure InitializeABCAnalysisSetupUpgrade() - var - Initialization: Codeunit Initialization; - UpgradeTag: Codeunit "Upgrade Tag"; - begin - if UpgradeTag.HasUpgradeTag(InitializeABCAnalysisSetupUpgradeTag()) then - exit; - Initialization.InitializeABCAnalysisSetup(); - UpgradeTag.SetUpgradeTag(InitializeABCAnalysisSetupUpgradeTag()); - end; - local procedure TransferDimensionSetEntriesUpgradeTag(): Code[250] begin exit('MS-561310-POWERBI-TRANSFER-DIMENSION-SET-ENTRIES-20250110'); From 81e6d957b33965987ded58b68a137076b11773e9 Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Mon, 2 Feb 2026 17:01:09 +1100 Subject: [PATCH 16/20] Removed ABC Analysis Setup action --- .../App/Core/Pages/PowerBIReportsSetup.Page.al | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/Apps/W1/PowerBIReports/App/Core/Pages/PowerBIReportsSetup.Page.al b/src/Apps/W1/PowerBIReports/App/Core/Pages/PowerBIReportsSetup.Page.al index 3c12f5d3f0..c103edbdf9 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/Pages/PowerBIReportsSetup.Page.al +++ b/src/Apps/W1/PowerBIReports/App/Core/Pages/PowerBIReportsSetup.Page.al @@ -581,14 +581,6 @@ page 36951 "PowerBI Reports Setup" Image = CodesList; RunObject = page "PBI Close Income Stmt. SC."; } - action(SetupABCAnalysis) - { - ApplicationArea = All; - Caption = 'ABC Analysis Setup'; - ToolTip = 'Set up the percentage boundaries for ABC Analysis categories in the Power BI Inventory reports.'; - Image = AnalysisView; - RunObject = page "PowerBI ABC Analysis Setup"; - } } area(Promoted) @@ -607,9 +599,6 @@ page 36951 "PowerBI Reports Setup" actionref(CloseIncomeStatementSourceCodes_Promoted; CloseIncomeStatementSourceCodes) { } - actionref(SetupABCAnalysis_Promoted; SetupABCAnalysis) - { - } } } } From 882c436b514061e91b180a2601d5b3cfe169c0fa Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Mon, 2 Feb 2026 17:03:16 +1100 Subject: [PATCH 17/20] Removed InitializeABCAnalysisSetupUpgradeTag function --- .../App/Core/Codeunits/PowerBIUpgrade.Codeunit.al | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/Apps/W1/PowerBIReports/App/Core/Codeunits/PowerBIUpgrade.Codeunit.al b/src/Apps/W1/PowerBIReports/App/Core/Codeunits/PowerBIUpgrade.Codeunit.al index afe40426ba..edb23430c5 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/Codeunits/PowerBIUpgrade.Codeunit.al +++ b/src/Apps/W1/PowerBIReports/App/Core/Codeunits/PowerBIUpgrade.Codeunit.al @@ -74,16 +74,10 @@ codeunit 36957 "PowerBI Upgrade" exit('MS-GH-PY-529-POWERBI-CLSINCOME-UPGRADE-20250123'); end; - local procedure InitializeABCAnalysisSetupUpgradeTag(): Code[250] - begin - exit('MS-606229-PowerBIABCAnalysisSetup-20251216'); - end; - [EventSubscriber(ObjectType::Codeunit, Codeunit::"Upgrade Tag", 'OnGetPerCompanyUpgradeTags', '', false, false)] local procedure RegisterPerCompanyTags(var PerCompanyUpgradeTags: List of [Code[250]]) begin PerCompanyUpgradeTags.Add(TransferDimensionSetEntriesUpgradeTag()); - PerCompanyUpgradeTags.Add(InitializeABCAnalysisSetupUpgradeTag()); end; } \ No newline at end of file From 3c899f66d7a954ecf860e0e7f46d194ef586e282 Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Mon, 2 Feb 2026 17:03:30 +1100 Subject: [PATCH 18/20] Removed unused using --- .../PowerBIReports/App/Core/Codeunits/Initialization.Codeunit.al | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Apps/W1/PowerBIReports/App/Core/Codeunits/Initialization.Codeunit.al b/src/Apps/W1/PowerBIReports/App/Core/Codeunits/Initialization.Codeunit.al index 82a33c329c..3c313c3071 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/Codeunits/Initialization.Codeunit.al +++ b/src/Apps/W1/PowerBIReports/App/Core/Codeunits/Initialization.Codeunit.al @@ -7,7 +7,6 @@ namespace Microsoft.PowerBIReports; using Microsoft.Finance.PowerBIReports; using Microsoft.Foundation.AuditCodes; using Microsoft.Foundation.Period; -using Microsoft.Inventory.PowerBIReports; using System.Diagnostics; using System.Environment.Configuration; using System.Media; From 279eb8854d7d928791d8ab623b76a12524a1bd9e Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Mon, 2 Feb 2026 17:03:54 +1100 Subject: [PATCH 19/20] Removed using --- .../App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al index 28cc336752..0391d1e926 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al +++ b/src/Apps/W1/PowerBIReports/App/Core/PermissionSets/PowerBIReportAdmin.PermissionSet.al @@ -5,7 +5,6 @@ namespace Microsoft.PowerBIReports; using Microsoft.Finance.PowerBIReports; -using Microsoft.Inventory.PowerBIReports; permissionset 36950 "PowerBI Report Admin" { From 1d4fe34796b21a9137bbed43bae54da43d0b76a8 Mon Sep 17 00:00:00 2001 From: Tuan Nguyen Date: Mon, 2 Feb 2026 17:04:19 +1100 Subject: [PATCH 20/20] Cleaned up using --- .../W1/PowerBIReports/App/Core/Pages/PowerBIReportsSetup.Page.al | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Apps/W1/PowerBIReports/App/Core/Pages/PowerBIReportsSetup.Page.al b/src/Apps/W1/PowerBIReports/App/Core/Pages/PowerBIReportsSetup.Page.al index c103edbdf9..1cef0db07c 100644 --- a/src/Apps/W1/PowerBIReports/App/Core/Pages/PowerBIReportsSetup.Page.al +++ b/src/Apps/W1/PowerBIReports/App/Core/Pages/PowerBIReportsSetup.Page.al @@ -5,7 +5,6 @@ namespace Microsoft.PowerBIReports; using Microsoft.Finance.PowerBIReports; -using Microsoft.Inventory.PowerBIReports; using System.DateTime; using System.Environment;