Skip to content

Commit

Permalink
GP - Config Oldest G/L Year warning message (#27683)
Browse files Browse the repository at this point in the history
This change enhances the migration configuration page to display a
warning message if a company is configured to migrate without setting
the Oldest G/L Year.

Fixes #26487
Fixes
[AB#558913](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/558913)

Co-authored-by: jaymckinney <[email protected]>
  • Loading branch information
jaymckinney-enavate and jaymckinney authored Dec 3, 2024
1 parent 4a45f90 commit 83d72b0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Apps/W1/HybridGP/app/src/pages/GPMigrationConfiguration.Page.al
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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";
Expand Down Expand Up @@ -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;
}

0 comments on commit 83d72b0

Please sign in to comment.