Restricted Accounts, Stamped Documents
The auditors flagged a handful of G/L accounts — legal settlements, restructuring reserves — as restricted: nothing may reach them without a controlled document number issued by the audit desk, and those numbers always start with CTRL-. Journal lines are keyed in by many people and posted by more than one routine, so the rule cannot live in a page or in one posting report — it has to sit where every general journal line is checked on its way to the ledger. That check is base application code you cannot modify; extend it from the outside.
Requirements
- Create a table extension for the
G/L Accounttable with a field namedRestrictedof typeBoolean. Grading reads and writes it in code — no page work is needed. - Put your rule in a new codeunit — its name is up to you (not graded); the starter calls it
"Journal Check Rule". - The rule guards both sides of a general journal line: when
"Account Type"isG/L Accountand"Account No."names a restricted account, or"Bal. Account Type"isG/L Accountand"Bal. Account No."does, the line may only post if its"Document No."starts withCTRL-— the first five characters, so aCTRL-buried in the middle does not count.
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
- 9 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
Already on Pro? Sign in
This problem is part of Pro
Pro unlocks the full statement, tests, hints and solution. The code editor works on a computer.
Upgrade