Add Finance posting domain-knowledge pilot

Adds three atomic domain-rule knowledge files under community/knowledge/finance/ as a pilot for Type-A (normative) Business Central domain knowledge: post through the posting engine, treat posted ledger entries as immutable, and treat the Dimension Set ID as the source of truth for dimensions. Includes a good/bad AL sample pair for the posting rule.

These encode BC-specific invariants that LLMs reliably get wrong, fitting the existing remedial/atomic knowledge grain with no schema or contract changes. Passes the repo frontmatter validator and is discovered by the knowledge index.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Jesper Schulz-Wedde 2026-06-26 10:40:50 +02:00
parent 8904ce583b
commit 3cb00e4d2d
5 changed files with 116 additions and 0 deletions

View file

@ -0,0 +1,26 @@
// Demonstration only. Self-contained illustration, not derived from the
// Business Central base application source.
//
// GOOD: build a journal line and let the posting engine create the ledger
// entry. The platform assigns Entry No., writes the balancing entry, creates
// the register, and resolves dimensions and VAT.
codeunit 50100 "Post GL Adjustment"
{
procedure PostAdjustment(AccountNo: Code[20]; BalAccountNo: Code[20]; Amount: Decimal; PostingDate: Date)
var
GenJnlLine: Record "Gen. Journal Line";
GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line";
begin
GenJnlLine.Init();
GenJnlLine."Posting Date" := PostingDate;
GenJnlLine."Document Type" := GenJnlLine."Document Type"::" ";
GenJnlLine."Account Type" := GenJnlLine."Account Type"::"G/L Account";
GenJnlLine.Validate("Account No.", AccountNo);
GenJnlLine."Bal. Account Type" := GenJnlLine."Bal. Account Type"::"G/L Account";
GenJnlLine.Validate("Bal. Account No.", BalAccountNo);
GenJnlLine.Validate(Amount, Amount);
GenJnlLine."Source Code" := 'ADJUST';
GenJnlPostLine.Run(GenJnlLine);
end;
}