bcquality/microsoft/knowledge/testing/transactionmodel-attribute-governs-test-transactions.good.al
Jesper Schulz-Wedde bc8686d871 Fix lifecycle compatibility guidance
Correct high-confidence Business Central guidance and samples for upgrade tags, collectible errors, trigger semantics, obsoletion, events, interfaces, API contracts, and test transactions.

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

Copilot-Session: e05a43e7-6448-4d67-9c73-798523f5d945
2026-07-14 10:51:12 +02:00

37 lines
827 B
AL

codeunit 50153 "Test Sample TransModel Good"
{
Subtype = Test;
[Test]
[TransactionModel(TransactionModel::AutoRollback)]
procedure TestLogicThatDoesNotCommit()
var
Customer: Record Customer;
begin
Customer.Init();
Customer."No." := 'T-001';
Customer.Insert(true);
end;
[Test]
[TransactionModel(TransactionModel::AutoCommit)]
procedure TestLogicThatCommitsInternally()
var
PostingRoutine: Codeunit "Posting Routine With Commit";
begin
PostingRoutine.PostCustomer();
end;
}
codeunit 50155 "Posting Routine With Commit"
{
procedure PostCustomer()
var
Customer: Record Customer;
begin
Customer.Init();
Customer."No." := 'T-COMMIT';
Customer.Insert(true);
Commit();
end;
}