From ee6837d16d5fb18b44a39de4a28c285aa10d7323 Mon Sep 17 00:00:00 2001 From: jaymckinney Date: Mon, 25 Nov 2024 08:19:01 -0500 Subject: [PATCH] Warning message if company is configured to migrate without seeting the Oldest G/L Year. --- .../src/pages/GPMigrationConfiguration.Page.al | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Apps/W1/HybridGP/app/src/pages/GPMigrationConfiguration.Page.al b/Apps/W1/HybridGP/app/src/pages/GPMigrationConfiguration.Page.al index 42615d8a98..dcb7a8c9c0 100644 --- a/Apps/W1/HybridGP/app/src/pages/GPMigrationConfiguration.Page.al +++ b/Apps/W1/HybridGP/app/src/pages/GPMigrationConfiguration.Page.al @@ -863,6 +863,10 @@ page 4050 "GP Migration Configuration" if (not Confirm(AllModulesDisabledExitQst)) then exit(false); + if SettingsHasCompanyGLYearZero() then + if (not Confirm(CompanyGLYearZeroExitQst)) then + exit(false); + if ShowManagementPromptOnClose then if Confirm(OpenCloudMigrationPageQst) then Page.Run(page::"Intelligent Cloud Management"); @@ -889,6 +893,16 @@ page 4050 "GP Migration Configuration" exit(false); end; + local procedure SettingsHasCompanyGLYearZero(): Boolean + var + GPCompanyAdditionalSettingsCompanies: Record "GP Company Additional Settings"; + begin + GPCompanyAdditionalSettingsCompanies.SetFilter("Name", '<>%1', ''); + GPCompanyAdditionalSettingsCompanies.SetRange("Migration Completed", false); + GPCompanyAdditionalSettingsCompanies.SetRange("Oldest GL Year to Migrate", 0); + exit(not GPCompanyAdditionalSettingsCompanies.IsEmpty()); + end; + local procedure AssignDimension(DimensionNumber: Integer; DimensionLabel: Text[30]) var GPCompanyAdditionalSettingsCompanies: Record "GP Company Additional Settings"; @@ -953,6 +967,7 @@ page 4050 "GP Migration Configuration" OpenCloudMigrationPageQst: Label 'Would you like to open the Cloud Migration Management page to manage your data migrations?'; ResetAllQst: Label 'Are you sure? This will reset all company migration settings to their default values.'; AllModulesDisabledExitQst: Label 'All modules are disabled and nothing will migrate (with the exception of the Snapshot if configured). Are you sure you want to exit?'; + CompanyGLYearZeroExitQst: Label 'One or more companies selected for migration have an Oldest G/L Year value set to zero. This will prevent beginning balances from being migrated. Are you sure you want to exit?'; MasterDataOnlyWarningMsg: Label 'Enabling the master data only settings will make the migration not migrate transactions for the configured areas.'; EnableDisableAllHistTrx: Boolean; } \ No newline at end of file