Skip to content

Commit

Permalink
Reverted changes to "Hybrid GP Errors Overview Fb" and marked it as o…
Browse files Browse the repository at this point in the history
…bsolete. Replaced it with "Hybrid GP Overview Fb".
  • Loading branch information
jaymckinney committed Feb 9, 2024
1 parent cab097b commit 0f1592e
Show file tree
Hide file tree
Showing 3 changed files with 159 additions and 93 deletions.
110 changes: 17 additions & 93 deletions Apps/W1/HybridGP/app/src/pages/HybridGPErrorsOverviewFb.page.al
Original file line number Diff line number Diff line change
Expand Up @@ -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';

This comment has been minimized.

Copy link
@nikolakukrika

nikolakukrika Feb 9, 2024

Contributor

You need clean tags around the page and where it is used.


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;

Expand All @@ -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)
{
Expand All @@ -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;
}
134 changes: 134 additions & 0 deletions Apps/W1/HybridGP/app/src/pages/HybridGPOverviewFb.Page.al
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

This comment has been minimized.

Copy link
@nikolakukrika

nikolakukrika Feb 9, 2024

Contributor

we need clean tags - #if not CLEAN24
...
#endif

Visible = false;
ObsoleteState = Pending;
ObsoleteReason = 'Replaced by Overview part.';
ObsoleteTag = '24.0';
}
part(Overview; "Hybrid GP Overview Fb")
{
ApplicationArea = Basic, Suite;
Visible = FactBoxesVisible;
Expand Down

0 comments on commit 0f1592e

Please sign in to comment.