bcquality/microsoft/knowledge/finance/apply-ledger-entries-through-application-codeunits.bad.al
Jesper Schulz-Wedde fa63d5526c Expand Finance pilot into a source-verified review domain
Move Finance knowledge to the Microsoft-owned layer, add nine scoped rules with eighteen AL samples, and register bounded Finance review with complete paired evaluation coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-17 16:09:17 +02:00

33 lines
1.1 KiB
AL

// Demonstration only; independently authored, not copied from BaseApp.
codeunit 50104 "Customer Settlement Actions"
{
procedure RequestApplication(CustomerEntryNo: Integer)
var
CustomerEntry: Record "Cust. Ledger Entry";
begin
RequireInteractiveSession();
CustomerEntry.Get(CustomerEntryNo);
CustomerEntry.TestField(Open, true);
CustomerEntry.Open := false;
CustomerEntry.Modify(true);
end;
procedure RequestUnapplication(CustomerEntryNo: Integer)
var
DetailedCustomerEntry: Record "Detailed Cust. Ledg. Entry";
begin
RequireInteractiveSession();
DetailedCustomerEntry.SetRange("Cust. Ledger Entry No.", CustomerEntryNo);
DetailedCustomerEntry.SetRange("Entry Type", DetailedCustomerEntry."Entry Type"::Application);
DetailedCustomerEntry.ModifyAll(Unapplied, true);
end;
local procedure RequireInteractiveSession()
begin
if not GuiAllowed() then
Error(InteractiveSessionErr);
end;
var
InteractiveSessionErr: Label 'Request settlement from an interactive session.';
}