mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-05 06:36:55 +01:00
Preserve independent event seams, cover loop-carried handled state, strengthen checkpoint and UI-handler fixtures, and align DeleteAll fallback guidance. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 10646e50-2d8b-4cca-b02b-dfa78629e6a1
26 lines
931 B
AL
26 lines
931 B
AL
codeunit 50129 "Perf Sample CommitInLoop Bad"
|
|
{
|
|
procedure NormalizeCustomerNames()
|
|
var
|
|
Customer: Record Customer;
|
|
LastCustomerNo: Code[20];
|
|
ProcessedCount: Integer;
|
|
begin
|
|
Customer.SetFilter("No.", '>%1', LastCustomerNo);
|
|
if Customer.FindSet(true) then
|
|
repeat
|
|
Customer.Name := UpperCase(Customer.Name);
|
|
Customer.Modify();
|
|
|
|
// LastCustomerNo exists only in memory, so a retry cannot exclude
|
|
// work that was already committed.
|
|
LastCustomerNo := Customer."No.";
|
|
ProcessedCount += 1;
|
|
|
|
// This still opened a FindSet over the complete remaining tail;
|
|
// periodic commits do not turn retrieval into bounded TOP X.
|
|
if ProcessedCount mod 500 = 0 then
|
|
Commit();
|
|
until Customer.Next() = 0;
|
|
end;
|
|
}
|