Who Called Me?
Support keeps asking the same question about your app's diagnostic log: which code path wrote this entry? A raw stack-trace blob pasted into a text field is impossible to filter, so your logging framework needs the answer as structured data — one record per frame, with the object, the procedure and the line. Business Central happily prints a call stack when something crashes; producing one while everything is running fine, and turning its text into records, is the exercise.
What you get
The starter ships two objects to keep exactly as given — include both in your submission, the grading tests reference them by name.
- Table
"Call Stack Frame"— aTableType = Temporarybuffer (it never touches the database) with the fields"Entry No."(Integer, primary key),"Object Type"(Text[30]),"Object ID"(Integer),"Object Name"(Text[150]),"Procedure Name"(Text[150]) and"Line No."(Integer). - Codeunit
"Stack Probe"— the known call chain the tests walk through:OutercallsMiddle,MiddlecallsInner, andInnercalls yourCapture. A fourth procedure,CaptureFromSite, reachesInnerfrom one of two different call sites inside the same procedure, chosen by itsSiteparameter — the tests use it to check your line numbers.
Requirements
Implement the codeunit named "Call Stack Inspector" with one public procedure:
procedure Capture(var Frame: Record "Call Stack Frame")Rules:
CapturefillsFramewith one record per frame of the current call stack, innermost first:"Entry No."1 isCapture's direct caller, 2 is that procedure's caller, and so on all the way down — deeper frames below your objects (in the platform's test runner) are stored too, in order, with no gaps in the numbering.
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.
Already on Pro? Sign in