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,29 @@
codeunit 50142 "Perf Sample AtomicSub Good"
{
procedure ApplyDiscountToSelection(var Customer: Record Customer)
var
ApplyOne: Codeunit "Perf Sample Apply Discount";
begin
if Customer.FindSet() then
repeat
ClearLastError();
if not ApplyOne.Run(Customer) then
LogSkipped(Customer."No.", GetLastErrorText());
until Customer.Next() = 0;
end;
local procedure LogSkipped(CustomerNo: Code[20]; ErrorText: Text)
begin
end;
}
codeunit 50143 "Perf Sample Apply Discount"
{
TableNo = Customer;
trigger OnRun()
begin
Rec.Validate("Customer Price Group", 'VIP');
Rec.Modify(true);
end;
}