mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-05 14:46:55 +01:00
18 lines
684 B
AL
18 lines
684 B
AL
codeunit 50230 "Perf Sample SetCurrentKey Good"
|
|
{
|
|
// SetCurrentKey is used because the rows must be processed oldest-first.
|
|
// The sort is a functional requirement, so the ORDER BY it adds is justified.
|
|
procedure ApplyOldestEntriesFirst(CustomerNo: Code[20])
|
|
var
|
|
CustLedgerEntry: Record "Cust. Ledger Entry";
|
|
begin
|
|
CustLedgerEntry.SetRange("Customer No.", CustomerNo);
|
|
CustLedgerEntry.SetRange(Open, true);
|
|
CustLedgerEntry.SetCurrentKey("Posting Date");
|
|
if CustLedgerEntry.FindSet() then
|
|
repeat
|
|
// Apply entries in posting-date order ...
|
|
until CustLedgerEntry.Next() = 0;
|
|
end;
|
|
}
|
|
|