Number Plumbing, the Official Way
For twenty years every BC document got its number through the NoSeriesManagement codeunit — and since BC24 that API is obsolete, replaced by the "No. Series" module in Business Foundation. On this platform's BC version the old codeunit is gone entirely: a submission that so much as declares NoSeriesManagement will not compile. You will wire a small Service Ticket domain to the module the official way: date-dependent series lines, peeking without consuming, manual-number gating, and switching to a related series.
What you are given
The starter contains two files. Table "Service Ticket" is finished — submit it unchanged. Codeunit "Service Ticket Numbering" declares the four procedures below with empty bodies; implementing them is the task.
- Table
"Service Ticket": field"No."(Code[20], PK),Description(Text[100]),"Registration Date"(Date),"No. Series"(Code[20]).
A number series can have several "No. Series Line" rows, each with its own "Starting Date" and "Starting No." — the accountant's way of saying "from July 1st, tickets are numbered TB-0001 onwards". For any usage date, the line with the latest "Starting Date" on or before that date is the one that supplies numbers. The "No. Series" codeunit from Business Foundation does all of this for you — the exercise is calling it correctly, not rebuilding it.
Requirements
Implement the four procedures of codeunit "Service Ticket Numbering" exactly as declared in the starter:
procedure CreateTicket(SeriesCode: Code[20]; UsageDate: Date; TicketDescription: Text[100]): Code[20]
procedure PeekNextTicketNo(SeriesCode: Code[20]; UsageDate: Date): Code[20]
procedure CreateManualTicket(SeriesCode: Code[20]; ManualNo: Code[20]; UsageDate: Date; TicketDescription: Text[100])
procedure CreateTicketFromRelatedSeries(DefaultSeriesCode: Code[20]; ChosenSeriesCode: Code[20]; UsageDate: Date; TicketDescription: Text[100]): Code[20]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.
Already on Pro? Sign in