MSBA-352 · Lesson 12 of 12 · 18 min

Case study: a warranty tracking extension

▶ Video coming soon A video version of this lesson is on the way.

On Monday, November 23, 2026, Joss presented version 1.0 of the Corbel & Finch Warranty extension in UPDATE-TEST. Callum ran the test script, Dovrin Mwangi-Ross posted shipments from the warehouse, and Bettina Szczepanik held a printed certificate up to the light and declared it good enough to hand to a customer. Noor sat at the back and said almost nothing, which Joss later learned was the highest praise she gave. This lesson walks through the whole extension as a case study: the requirements, the design decisions and the reasons for them, the objects, the build order, the tests, and what remains before production.

The requirements

Callum's requirements, agreed in October and refined through November, fitted on one page.

The warranty extension's requirements.
No.RequirementSource
R1Register a warranty for every serial number of a warranty item when it ships, with no manual stepCallum
R2Warranty period set per item; end date is the day before the anniversary of the ship dateCallum, manufacturers' terms
R3See a customer's warranties on the customer card, and all warranties in one searchable listSales team
R4Log claims with a resolution of repair, replace or refund, each with its own stepsCallum
R5Print a one-page certificate for the customerBettina
R6A monthly list of warranties ending in the next 60 days, in ExcelSales team
R7Claims by item and month for equipment decisionsYsmay Thorvaldsen
R8The web shop can show warranty status for a serial numberWeb shop contractor
R9Only the right people can see and change warranties; posting works for everyone who shipsCallum
R10Expire warranties automatically when they endCallum

Fit before build

Before any code, Noor had made Joss write a fit-gap note, the habit from functional consulting that runs through this track. It recorded what standard Business Central already did and why it was not enough.

  • Item tracking with SN-WARRANTY records serial numbers on every receipt and shipment, and Item Tracing follows a serial number from purchase to customer. The extension builds on this rather than duplicating it: registrations are created from item ledger entries.
  • Warranty Date Formula on the item tracking code gives a warranty date on ledger entries, but per tracking code, not per item. Grinders and brewers share SN-WARRANTY and have different terms (R2).
  • Service Management, with service items and contracts, covers warranties and repairs, but needs the Premium licence. Corbel & Finch runs Essentials, and upgrading nine users for one process was not worth it.
  • Returns from the inventory course already handle sales return orders, credit memos and the QUARANTINE location. The claim outcomes reuse them instead of inventing new documents.

The note ended with a short list of gaps: registrations per serial number and customer, claim logging with outcomes, the certificate, and the views and lists in R3, R6 and R7. That list became the scope.

The design

An architecture diagram of the warranty extension. At the top, users and systems: sales team, warehouse, Callum, Ysmay and the web shop. In the middle, the extension's layers: pages and page extensions; reports, report extension and query; the API page; codeunits CNF Warranty Mgt., CNF Warranty Subscribers and CNF Expire Warranties; the claim resolution interface with three implementations; tables and table extensions; permission sets. At the bottom, standard Business Central: Sales-Post publishing OnAfterPostSalesDoc, Item Ledger Entry, Item, Customer, returns documents and the job queue.
The warranty extension's architecture.

Each requirement maps to a lesson of this course and a small number of objects.

The objects in version 1.0, all within the range 50100 to 50149.
ObjectType and IDRequirementLesson
CNF Warranty Registrationtable 50100R1, R33
CNF Warranty Claimtable 50101R43, 9
CNF Warranty Setuptable 50102R4, R103, 10
CNF Item Warranty, CNF Customer Warrantytableextension 50100, 50101R2, R33
CNF Warranty Registrations, CNF Warranty Registrationpage 50101, 50102R34
CNF Customer Warranties, CNF Warranty Claims Partpage 50103, 50104R3, R44
CNF Item Card, CNF Customer Cardpageextension 50100, 50101R2, R34
CNF Warranty Mgt.codeunit 50100R1, R2, R45
CNF Warranty Installcodeunit 50101Setup2
CNF Expire Warrantiescodeunit 50102R105
CNF Warranty Subscriberscodeunit 50103R16
CNF Warranty Certificate, CNF Warranties Endingreport 50100, 50101R5, R67
CNF Shipment Warrantyreportextension 50100R57
CNF Claims by Item and Monthquery 50100R78
CNF Warranty APIpage 50110R88
CNF Warranty Status, CNF Claim Resolution Typeenum 50100, 50101R1, R49
CNF Claim Resolution and its implementationsinterface; codeunits 50120 to 50123R49
CNF WARRANTY VIEW, EDIT, SETUP, POSTpermissionset 50100 to 50103R910

Thirty-odd objects, about 1,400 lines of AL, and a dozen layout and configuration files. Noor pointed out that a quarter of the IDs in the range were still free, which was deliberate: version 1 should not use up the room version 2 will need.

Decisions and their reasons

Noor asked Joss to present the decisions, not the code. "Callum can't read AL," she said. "He can judge reasons." Joss chose six.

One registration per serial number per sale, created from posting. Registrations are created by the OnAfterPostSalesDoc subscriber from the shipment's item ledger entries, inside the posting transaction. If registration fails, the shipment fails, so a machine never leaves without a warranty. The cost is a small amount of time in every posting, which the profiler showed to be a few milliseconds.

The warranty period lives on the item. A DateFormula field on the Item table extension, with a Register Warranty switch, gives Callum per-item control without new tracking codes.

Data is referenced, not copied. Customer names, addresses and item descriptions are shown through FlowFields and links, so the registration never goes stale when a café changes its name.

Claim outcomes are pluggable. An extensible enum implementing an interface gives repair, replace and refund their own codeunits, and a future loaner app can add an outcome without changing this one.

Permissions are layered and posting uses indirect permissions. View, edit and setup sets map to security groups; a non-assignable posting set gives indirect insert so warehouse users can ship without being able to type registrations in.

Integration is read-only and versioned. The web shop reads warranty status through a v1.0 API page with SystemId keys and its own Entra ID app registration with view permissions only.

Build order

Joss built the app in the order of this course, and Noor said that order was not an accident. Data first, because everything depends on it and table design gets hard to change once there is data. Pages next, so Callum could see and test the data. Then logic in codeunits, tested by calling procedures directly from a test page. Then events, connecting the logic to posting only once it was known to work. Then outputs: reports, query and API. Enums and interfaces came when the claim outcomes grew complicated enough to need them. Permissions should have come earlier; Dovrin's failed posting in lesson 10 was the price of leaving them to the end. Joss's advice to the next junior developer was to write the permission sets the same day as the tables.

Testing with Callum

Callum's test script in UPDATE-TEST had 26 steps, run as four different users matching the security groups. The main paths were: ship two grinders and check two registrations with the right end dates; ship and invoice separately and check there are still two; ship a brewer to a second café; log a repair claim as a sales user; log a replacement and check the old registration is voided and the replacement creates a new one when shipped; print a certificate; run the ending-soon report; call the API from a test tool with the web shop's credentials; and try to edit a registration as a warehouse user, which should fail.

Three defects were found in November and all were fixed before the review: the off-by-one end date in lesson 5, the posting permission failure in lesson 10, and the duplicate registrations from a stale build in lesson 11. On November 23, every step passed.

Automated tests, written as test codeunits that run without a person clicking, will replace much of Callum's script. They belong to the next course, together with pipelines that run them on every pull request. Joss had already listed the first twenty test cases from the script so that work could start in December.

Review comments from Noor

Noor's code review before the demo raised five points, which make a useful checklist for any extension.

Code review checklist and results.
AreaCommentOutcome
NamingEvery object and every added field and action carries the CNF affix; captions are user friendlyPassed
AnalyzersCodeCop, UICop and PerTenantExtensionCop clean, with the Quarrystone rulesetTwo tooltip warnings fixed
EventsSubscribers are small, do not commit or interact, and use event parameters rather than header fieldsPassed after the lesson 11 fix
PermissionsEvery object is covered by a permission set; tested as non-SUPER usersPassed after the lesson 10 fix
Upgrade readinessTables designed for growth; no breaking changes planned; install code safe to rerunPassed

What happens next

The review on November 23 was the last session of this course. Everything after it is a plan. Before go-live on January 1, 2027, Quarrystone plans to move the repository onto the AL-Go per-tenant extension template, add automated tests, and deploy version 1.0 to PROD as a per-tenant extension. Callum plans to migrate about 120 active warranties from the old spreadsheet in December with a one-off import that calls RegisterSerialNo, with the posting subscriber unbound during the import. Automatic certificate emails and the loaner outcome are on the list for after go-live, and the Sales Order Agent pilot planned for spring 2027 may one day create sales orders for grinders, which will register warranties through the same posting event without any change.

Bettina asked the last question of the session: "When Microsoft updates Business Central, does Joss have to fix this every month?" Noor's answer summed up the course. "No. It extends; it does not modify. It subscribes to a published event, extends tables and pages through their extension points, and keeps its own data in its own tables. Microsoft can change everything around those points. We test each update in UPDATE-TEST before it reaches PROD, and if Microsoft ever retires the event we use, the compiler will warn us a release ahead."

Worked problem

Applying the design to a new request

After the demo, Ysmay asks whether the extension could also track warranties on equipment Corbel & Finch buys for its own cafés and roastery, such as the roaster and the café grinders, where Corbel & Finch is the customer and the manufacturer is the warrantor. How would Joss approach it?

Show solution
  1. Fit first: the roaster is a fixed asset from the finance course, not an inventory item, and is not shipped to a customer. The registration-from-shipment design does not apply.
  2. Check standard: fixed assets have a warranty date field and maintenance ledger entries, which may cover most of the need without code.
  3. If there is a gap, design new data: a supplier warranty table linked to fixed assets and vendors, not a reuse of customer registrations with blank customers.
  4. Write it down as a separate requirement for version 2, with its own fit-gap note.

Answer: Start with a fit-gap check against fixed assets; do not stretch the customer warranty design to a different process.

What Joss took away

At the end of the review, Noor asked Joss for the three lessons a junior developer should hear on day one. Joss's answers were short. First, the business problem decides the design: the warranty app is small because Callum's requirements were clear and the fit-gap note removed everything standard already did. Second, the platform rewards discipline: extension points, events, permission sets and versioned APIs are what let the app survive updates, and each shortcut, such as testing as SUPER, came back as a bug. Third, most bugs are misunderstandings, not typos: the end date, the posting permission and the duplicate registrations were all about what something meant, and each was found by testing with real people doing real work. Noor added a fourth, which became Quarrystone's standard advice: keep a short design note in the repository, updated with every decision, so the next developer inherits the reasons along with the code.

Common mistakes

  • MistakeStarting an extension with code before checking what standard features already do.

    InsteadWrite a fit-gap note and build only the gaps.

  • MistakePresenting a design to the business as a list of objects.

    InsteadPresent decisions and their reasons; keep the object list for developers.

  • MistakeLeaving permissions to the end of the build.

    InsteadWrite permission sets with the tables and test as real users from the start.

  • MistakeUsing up the whole object ID range in version 1.

    InsteadLeave room for growth.

  • MistakeStretching an existing design to fit a different process.

    InsteadTreat a new process as a new requirement with its own design.

Summary and key terms

  • The warranty extension fills a real gap: per-item warranty terms, registrations, claims and certificates without the Premium licence.
  • Fit-gap analysis kept the scope small and reused item tracking, returns and the QUARANTINE location.
  • The design rests on six decisions: posting-driven registration, item-level periods, referenced data, pluggable outcomes, layered permissions and a versioned read-only API.
  • The build order follows data, pages, logic, events, outputs, extensibility and permissions, with permissions best done early.
  • Testing as real users with a written script found three defects before the review.
  • An extension that only extends and subscribes survives Microsoft's updates with testing rather than rewriting.
Fit-gap note
A record of what standard features cover and which gaps need development.
Architecture diagram
A picture of an extension's layers, objects and the standard features it connects to.
Code review
A second developer's check of code against agreed standards before release.
Test script
An ordered list of steps and expected results for testing a feature.
Upgrade readiness
Designing an app so future versions can be installed without breaking changes.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Why did Corbel & Finch not use Service Management for warranties?

    Show answer

    It requires the Premium licence; Corbel & Finch runs Essentials, and a small extension cost less.

  2. Which requirement drove the interface and extensible enum?

    Show answer

    R4, claims with different outcomes, plus the likely loaner outcome in a future app.

  3. What did Joss say should have come earlier in the build, and why?

    Show answer

    Permission sets, because testing as SUPER hid the posting failure until a warehouse user tried it.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz