5022

Entries Carrying These Dimensions

Filtering
Medium
Pro
dimensions
dimension-set-id
gl-entry

Entries Carrying These Dimensions

The controller's request sounds trivial: "show me every entry on this account that was booked to both this project and this department." Then you open the G/L Entry table and find no project column and no department column — a ledger entry carries exactly one clue, an integer called "Dimension Set ID". Business Central stores every combination of dimensions ever used exactly once, in a normalized side table, and every ledger entry just points at its combination. To answer the controller you have to resolve through that store.

Requirements

Create a codeunit named "Dimension Set Search" with one public procedure:

procedure FindEntriesWithDimensions(GLAccountNo: Code[20]; RequiredDimensions: Dictionary of [Code[20], Code[20]]): List of [Integer]

Rules:

  1. Only G/L Entry records whose "G/L Account No." equals GLAccountNo are candidates — entries on other accounts never appear in the result, however well their dimensions match.
  2. Each dictionary entry is one requirement: the key is a dimension code, the value is the dimension value code that dimension must carry. A ledger entry matches when its dimension set satisfies every requirement — for each key, the set contains that dimension code with exactly that value code.
The rest of the statement and 3 hints Unlock with Pro
ALBusiness Central 28.5
Pro
Pro problem

Solve it with Pro

You’re reading the opening of the statement. Pro unlocks the whole problem:

  • The full statement
  • Starter code in the browser editor
  • 12 grading tests, run on Business Central 28.5
  • 3 hints
  • The reference solution

Pro also opens all 92 Pro problems and lifts the daily limits on compile checks and submissions.

$10 / month
or $100 / year
Upgrade
This problem is part of Pro
Pro unlocks the full statement, tests, hints and solution. The code editor works on a computer.
Upgrade