Transaction and error handling in BC AL - new knowledge articles

This commit is contained in:
Volodymyr Dvernytskyi 2026-04-23 20:58:02 +03:00
parent 7dd3f4777d
commit 4ce7d816cc
19 changed files with 415 additions and 10 deletions

View file

@ -0,0 +1,21 @@
codeunit 50128 "Perf Sample CommitInLoop Good"
{
procedure NormalizeCustomerNames()
var
Customer: Record Customer;
RowsInChunk: Integer;
ChunkSize: Integer;
begin
ChunkSize := 500;
if Customer.FindSet(true) then
repeat
Customer.Name := UpperCase(Customer.Name);
Customer.Modify();
RowsInChunk += 1;
if RowsInChunk >= ChunkSize then begin
Commit();
RowsInChunk := 0;
end;
until Customer.Next() = 0;
end;
}