From 0f1592ed87528c9602f3e4bc90b2522c37bc9636 Mon Sep 17 00:00:00 2001 From: jaymckinney Date: Fri, 9 Feb 2024 08:39:38 -0500 Subject: [PATCH] Reverted changes to "Hybrid GP Errors Overview Fb" and marked it as obsolete. Replaced it with "Hybrid GP Overview Fb". --- .../pages/HybridGPErrorsOverviewFb.page.al | 110 +++----------- .../app/src/pages/HybridGPOverviewFb.Page.al | 134 ++++++++++++++++++ .../IntelligentCloudExtension.PageExt.al | 8 ++ 3 files changed, 159 insertions(+), 93 deletions(-) create mode 100644 Apps/W1/HybridGP/app/src/pages/HybridGPOverviewFb.Page.al diff --git a/Apps/W1/HybridGP/app/src/pages/HybridGPErrorsOverviewFb.page.al b/Apps/W1/HybridGP/app/src/pages/HybridGPErrorsOverviewFb.page.al index 73f032f71e..79043ec223 100644 --- a/Apps/W1/HybridGP/app/src/pages/HybridGPErrorsOverviewFb.page.al +++ b/Apps/W1/HybridGP/app/src/pages/HybridGPErrorsOverviewFb.page.al @@ -4,29 +4,21 @@ using Microsoft.DataMigration; page 40132 "Hybrid GP Errors Overview Fb" { - Caption = 'GP Migration Overview'; + Caption = 'GP Upgrade Errors'; PageType = CardPart; + InsertAllowed = false; + DelayedInsert = false; + ModifyAllowed = false; + SourceTable = "GP Migration Error Overview"; + ObsoleteState = Pending; + ObsoleteReason = 'Replaced by Hybrid GP Overview Fb'; + ObsoleteTag = '24.0'; layout { area(Content) { cuegroup(Statistics) - { - ObsoleteState = Pending; - ObsoleteReason = 'Reorganization of tiles'; - ObsoleteTag = '24.0'; - Visible = false; - } - cuegroup(FailedCompanies) - { - ObsoleteState = Pending; - ObsoleteReason = 'Reorganization of tiles'; - ObsoleteTag = '24.0'; - Visible = false; - } - - cuegroup(Errors) { ShowCaption = false; @@ -43,6 +35,10 @@ page 40132 "Hybrid GP Errors Overview Fb" Page.Run(Page::"GP Migration Error Overview"); end; } + } + cuegroup(FailedCompanies) + { + ShowCaption = false; field("Failed Companies"; FailedCompanyCount) { @@ -58,95 +54,23 @@ page 40132 "Hybrid GP Errors Overview Fb" end; } } - - cuegroup(Other) - { - ShowCaption = false; - - field("Failed Batches"; FailedBatchCount) - { - Caption = 'Failed Batches'; - ApplicationArea = All; - Style = Unfavorable; - StyleExpr = (FailedBatchCount > 0); - ToolTip = 'Indicates the total number of failed batches, for all migrated companies.'; - - trigger OnDrillDown() - begin - Message(FailedBatchMsg); - end; - } - - field("Migration Warnings"; MigrationWarningCount) - { - Caption = 'Migration Warnings'; - ApplicationArea = All; - ToolTip = 'Indicates the number of migration warning entries.'; - - trigger OnDrillDown() - begin - Page.Run(Page::"GP Migration Warnings"); - end; - } - } } } - trigger OnAfterGetRecord() - var - GPMigrationErrorOverview: Record "GP Migration Error Overview"; begin - MigrationErrorCount := GPMigrationErrorOverview.Count(); + MigrationErrorCount := Rec.Count(); end; trigger OnAfterGetCurrRecord() var - GPMigrationErrorOverview: Record "GP Migration Error Overview"; - HybridCompanyStatus: Record "Hybrid Company Status"; - GPMigrationWarnings: Record "GP Migration Warnings"; - HelperFunctions: Codeunit "Helper Functions"; - TotalGLBatchCount: Integer; - TotalItemBatchCount: Integer; - CompanyHasFailedBatches: Boolean; + HybridCompanyUpgrade: Record "Hybrid Company Status"; begin - FailedBatchCount := 0; - FailedBatchMsg := 'One or more batches failed to post.\'; - - MigrationErrorCount := GPMigrationErrorOverview.Count(); - HybridCompanyStatus.SetRange("Upgrade Status", HybridCompanyStatus."Upgrade Status"::Failed); - FailedCompanyCount := HybridCompanyStatus.Count(); - MigrationWarningCount := GPMigrationWarnings.Count(); - - HybridCompanyStatus.Reset(); - HybridCompanyStatus.SetRange("Upgrade Status", HybridCompanyStatus."Upgrade Status"::Completed); - if HybridCompanyStatus.FindSet() then - repeat - TotalGLBatchCount := 0; - TotalItemBatchCount := 0; - - HelperFunctions.GetUnpostedBatchCountForCompany(HybridCompanyStatus.Name, TotalGLBatchCount, TotalItemBatchCount); - FailedBatchCount := FailedBatchCount + TotalGLBatchCount + TotalItemBatchCount; - CompanyHasFailedBatches := (TotalGLBatchCount > 0) or (TotalItemBatchCount > 0); - if CompanyHasFailedBatches then begin - if (TotalGLBatchCount > 0) and (TotalItemBatchCount > 0) then - FailedBatchMsg := FailedBatchMsg + HybridCompanyStatus.Name + ': GL batches: ' + Format(TotalGLBatchCount) + ', Item batches: ' + Format(TotalItemBatchCount) + '\'; - - if (TotalGLBatchCount > 0) and (TotalItemBatchCount = 0) then - FailedBatchMsg := FailedBatchMsg + HybridCompanyStatus.Name + ': GL batches: ' + Format(TotalGLBatchCount) + '\'; - - if (TotalGLBatchCount = 0) and (TotalItemBatchCount > 0) then - FailedBatchMsg := FailedBatchMsg + HybridCompanyStatus.Name + ': Item batches: ' + Format(TotalItemBatchCount) + '\'; - end; - until HybridCompanyStatus.Next() = 0; - - if FailedBatchCount = 0 then - FailedBatchMsg := 'No failed batches'; + MigrationErrorCount := Rec.Count(); + HybridCompanyUpgrade.SetRange("Upgrade Status", HybridCompanyUpgrade."Upgrade Status"::Failed); + FailedCompanyCount := HybridCompanyUpgrade.Count(); end; var MigrationErrorCount: Integer; FailedCompanyCount: Integer; - FailedBatchCount: Integer; - FailedBatchMsg: Text; - MigrationWarningCount: Integer; } diff --git a/Apps/W1/HybridGP/app/src/pages/HybridGPOverviewFb.Page.al b/Apps/W1/HybridGP/app/src/pages/HybridGPOverviewFb.Page.al new file mode 100644 index 0000000000..9028474274 --- /dev/null +++ b/Apps/W1/HybridGP/app/src/pages/HybridGPOverviewFb.Page.al @@ -0,0 +1,134 @@ +page 40125 "Hybrid GP Overview Fb" +{ + ApplicationArea = All; + Caption = 'GP Migration Overview'; + PageType = CardPart; + + layout + { + area(Content) + { + cuegroup(Errors) + { + ShowCaption = false; + + field("Migration Errors"; MigrationErrorCount) + { + Caption = 'Migration Errors'; + ApplicationArea = Basic, Suite; + Style = Unfavorable; + StyleExpr = (MigrationErrorCount > 0); + ToolTip = 'Indicates the number of errors that occurred during the migration.'; + + trigger OnDrillDown() + begin + Page.Run(Page::"GP Migration Error Overview"); + end; + } + + field("Failed Companies"; FailedCompanyCount) + { + Caption = 'Failed Companies'; + ApplicationArea = Basic, Suite; + Style = Unfavorable; + StyleExpr = (FailedCompanyCount > 0); + ToolTip = 'Indicates the number of companies that failed to upgrade.'; + + trigger OnDrillDown() + begin + Page.Run(Page::"Hybrid GP Failed Companies"); + end; + } + } + + cuegroup(Other) + { + ShowCaption = false; + + field("Failed Batches"; FailedBatchCount) + { + Caption = 'Failed Batches'; + ApplicationArea = All; + Style = Unfavorable; + StyleExpr = (FailedBatchCount > 0); + ToolTip = 'Indicates the total number of failed batches, for all migrated companies.'; + + trigger OnDrillDown() + begin + Message(FailedBatchMsg); + end; + } + + field("Migration Warnings"; MigrationWarningCount) + { + Caption = 'Migration Warnings'; + ApplicationArea = All; + ToolTip = 'Indicates the number of migration warning entries.'; + + trigger OnDrillDown() + begin + Page.Run(Page::"GP Migration Warnings"); + end; + } + } + } + } + + trigger OnAfterGetRecord() + var + GPMigrationErrorOverview: Record "GP Migration Error Overview"; + begin + MigrationErrorCount := GPMigrationErrorOverview.Count(); + end; + + trigger OnAfterGetCurrRecord() + var + GPMigrationErrorOverview: Record "GP Migration Error Overview"; + HybridCompanyStatus: Record "Hybrid Company Status"; + GPMigrationWarnings: Record "GP Migration Warnings"; + HelperFunctions: Codeunit "Helper Functions"; + TotalGLBatchCount: Integer; + TotalItemBatchCount: Integer; + CompanyHasFailedBatches: Boolean; + begin + FailedBatchCount := 0; + FailedBatchMsg := 'One or more batches failed to post.\'; + + MigrationErrorCount := GPMigrationErrorOverview.Count(); + HybridCompanyStatus.SetRange("Upgrade Status", HybridCompanyStatus."Upgrade Status"::Failed); + FailedCompanyCount := HybridCompanyStatus.Count(); + MigrationWarningCount := GPMigrationWarnings.Count(); + + HybridCompanyStatus.Reset(); + HybridCompanyStatus.SetRange("Upgrade Status", HybridCompanyStatus."Upgrade Status"::Completed); + if HybridCompanyStatus.FindSet() then + repeat + TotalGLBatchCount := 0; + TotalItemBatchCount := 0; + + HelperFunctions.GetUnpostedBatchCountForCompany(HybridCompanyStatus.Name, TotalGLBatchCount, TotalItemBatchCount); + FailedBatchCount := FailedBatchCount + TotalGLBatchCount + TotalItemBatchCount; + CompanyHasFailedBatches := (TotalGLBatchCount > 0) or (TotalItemBatchCount > 0); + if CompanyHasFailedBatches then begin + if (TotalGLBatchCount > 0) and (TotalItemBatchCount > 0) then + FailedBatchMsg := FailedBatchMsg + HybridCompanyStatus.Name + ': GL batches: ' + Format(TotalGLBatchCount) + ', Item batches: ' + Format(TotalItemBatchCount) + '\'; + + if (TotalGLBatchCount > 0) and (TotalItemBatchCount = 0) then + FailedBatchMsg := FailedBatchMsg + HybridCompanyStatus.Name + ': GL batches: ' + Format(TotalGLBatchCount) + '\'; + + if (TotalGLBatchCount = 0) and (TotalItemBatchCount > 0) then + FailedBatchMsg := FailedBatchMsg + HybridCompanyStatus.Name + ': Item batches: ' + Format(TotalItemBatchCount) + '\'; + end; + until HybridCompanyStatus.Next() = 0; + + if FailedBatchCount = 0 then + FailedBatchMsg := 'No failed batches'; + end; + + var + MigrationErrorCount: Integer; + FailedCompanyCount: Integer; + FailedBatchCount: Integer; + FailedBatchMsg: Text; + MigrationWarningCount: Integer; +} \ No newline at end of file diff --git a/Apps/W1/HybridGP/app/src/pages/IntelligentCloudExtension.PageExt.al b/Apps/W1/HybridGP/app/src/pages/IntelligentCloudExtension.PageExt.al index df319a545d..a5ad1992da 100644 --- a/Apps/W1/HybridGP/app/src/pages/IntelligentCloudExtension.PageExt.al +++ b/Apps/W1/HybridGP/app/src/pages/IntelligentCloudExtension.PageExt.al @@ -17,6 +17,14 @@ pageextension 4015 "Intelligent Cloud Extension" extends "Intelligent Cloud Mana Visible = false; } part(Errors; "Hybrid GP Errors Overview Fb") + { + ApplicationArea = Basic, Suite; + Visible = false; + ObsoleteState = Pending; + ObsoleteReason = 'Replaced by Overview part.'; + ObsoleteTag = '24.0'; + } + part(Overview; "Hybrid GP Overview Fb") { ApplicationArea = Basic, Suite; Visible = FactBoxesVisible;