Add lifecycle error and privacy knowledge

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 95c06ad8-377d-4faa-8d07-06300b1c81ec
This commit is contained in:
Jesper Schulz-Wedde 2026-07-14 12:02:49 +02:00
parent 9214f73819
commit 0c2a0ceb82
25 changed files with 457 additions and 37 deletions

View file

@ -3,23 +3,19 @@ codeunit 50234 "Upgrade With Validation"
Subtype = Upgrade;
trigger OnValidateUpgradePerCompany()
begin
CheckNoLegacyPostingGroups();
end;
local procedure CheckNoLegacyPostingGroups()
var
UpgradeTag: Codeunit "Upgrade Tag";
Customer: Record Customer;
begin
// Justification: regulatory compliance requires a full-table scan once
// per tenant after this release. Tag prevents re-runs.
if UpgradeTag.HasUpgradeTag(MyValidationUpgradeTag()) then
exit;
ValidateAllCustomers();
UpgradeTag.SetUpgradeTag(MyValidationUpgradeTag());
Customer.SetRange("Customer Posting Group", 'OLD');
if not Customer.IsEmpty() then
Error(MigrationIncompleteErr);
end;
local procedure ValidateAllCustomers() begin end;
local procedure MyValidationUpgradeTag(): Code[250]
begin
exit('MS-123456-CustomerValidation-20240101');
end;
var
MigrationIncompleteErr: Label 'The legacy customer posting group was not migrated.';
}