bcquality/microsoft/knowledge/performance/avoid-cloning-records-before-modify-delete-in-loops.good.al
Jesper Schulz-Wedde bad62d2763 Add per-row performance guidance
Document SetAutoCalcFields for per-row FlowFields and direct writes on iterated records, with focused reviewer retrieval cues.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 85be3fc4-5253-47b8-ba1b-6b8fd188fcea
2026-07-14 11:41:47 +02:00

17 lines
571 B
AL

codeunit 50492 "Perf Record Clone Good"
{
procedure IncreaseCustomerCreditLimits(Percent: Decimal)
var
Customer: Record Customer;
begin
Customer.SetLoadFields("Credit Limit (LCY)");
Customer.SetFilter("Credit Limit (LCY)", '>0');
if Customer.FindSet(true) then
repeat
Customer.Validate(
"Credit Limit (LCY)",
Round(Customer."Credit Limit (LCY)" * (1 + Percent / 100)));
Customer.Modify(true);
until Customer.Next() = 0;
end;
}