Exercise: Assess a Business Central solution architecture

Completed

In this exercise, you assess the scenario architecture with evidence from a live Business Central online sandbox. You use supplied code, so the assessed outcome is your architecture decision rather than environment setup or original AL development.

Review the scenario and prerequisites

CRONUS needs a customer architecture review status that appears on the Customer Card. The value defaults to Draft when a user changes a customer name and the status is blank. The organization also needs an external reporting integration, predictable Business Central updates, and no direct database dependency.

The proposed solution uses Business Central online and one per-tenant extension. A later reporting app can consume a versioned API instead of accessing SQL. The extension adds a field to the Customer table, extends the Customer Card, and subscribes to a table field validation event. The architecture team needs evidence that the app compiles against downloaded Microsoft symbols, publishes to the sandbox, and owns its schema.

You need:

  • A Business Central online sandbox where you have permission to publish an extension.
  • Visual Studio Code with the current AL Language extension.
  • The sandbox environment name and Microsoft Entra credentials supplied by your administrator.
  • An empty local folder for the supplied project files.

Important

Use a sandbox only. Don't publish this training extension to a production environment.

Create the supplied starter project

Create the following folder structure. The object and field IDs from 70250 through 70252 are within the per-tenant extension range. Confirm that they don't conflict with another extension in your sandbox.

ArchitectureAssessment/
|-- .vscode/
|   `-- launch.json
|-- src/
|   |-- ArchitectureReview.TableExt.al
|   |-- ArchitectureReview.PageExt.al
|   `-- ArchitectureReviewSubscriber.Codeunit.al
`-- app.json

Create app.json with this content:

{
  "id": "5f37c54e-e7c8-4f3e-8861-e7ea47f533ea",
  "name": "Architecture Assessment",
  "publisher": "CRONUS Architecture Team",
  "version": "1.0.0.0",
  "brief": "Adds architecture review status to customers.",
  "description": "Training extension for assessing Business Central architecture boundaries.",
  "privacyStatement": "",
  "EULA": "",
  "help": "",
  "url": "",
  "logo": "",
  "dependencies": [],
  "screenshots": [],
  "platform": "26.0.0.0",
  "application": "26.0.0.0",
  "idRanges": [
    {
      "from": 70250,
      "to": 70259
    }
  ],
  "resourceExposurePolicy": {
    "allowDebugging": true,
    "allowDownloadingSource": true,
    "includeSourceInSymbolFile": true
  },
  "runtime": "15.0",
  "target": "Cloud",
  "features": [
    "NoImplicitWith"
  ]
}

The application, platform, and runtime values establish a minimum baseline. A newer sandbox accepts an extension that targets this compatible baseline. If the current AL compiler reports that it no longer supports this runtime, use AL: Go! in a temporary folder, select your sandbox, and copy the generated platform, application, and runtime values into this manifest. This compatibility adjustment doesn't change the extension design.

Create .vscode/launch.json. Replace <sandbox-name> with the supplied environment name.

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Business Central online sandbox",
      "type": "al",
      "request": "launch",
      "environmentType": "Sandbox",
      "environmentName": "<sandbox-name>",
      "startupObjectType": "Page",
      "startupObjectId": 22,
      "breakOnError": "All",
      "launchBrowser": true
    }
  ]
}

Create src/ArchitectureReview.TableExt.al:

tableextension 70250 "Architecture Review Customer" extends Customer
{
    fields
    {
        field(70250; "Architecture Review Status"; Text[30])
        {
            Caption = 'Architecture review status';
            DataClassification = CustomerContent;
        }
    }
}

Create src/ArchitectureReview.PageExt.al:

pageextension 70251 "Architecture Review Cust Card" extends "Customer Card"
{
    layout
    {
        addafter(Name)
        {
            field("Architecture Review Status"; Rec."Architecture Review Status")
            {
                ApplicationArea = All;
                ToolTip = 'Specifies the current architecture review status for the customer.';
            }
        }
    }
}

Create src/ArchitectureReviewSubscriber.Codeunit.al:

codeunit 70252 "Architecture Review Subscriber"
{
    [EventSubscriber(ObjectType::Table, Database::Customer, 'OnAfterValidateEvent', 'Name', false, false)]
    local procedure SetInitialReviewStatus(var Rec: Record Customer; var xRec: Record Customer; CurrFieldNo: Integer)
    begin
        if Rec."Architecture Review Status" = '' then
            Rec."Architecture Review Status" := 'Draft';
    end;
}

Download symbols and inspect boundaries

  1. Open the ArchitectureAssessment folder in Visual Studio Code.
  2. Open the command palette and run AL: Download symbols.
  3. Sign in with the supplied sandbox credentials when prompted.
  4. In the .alpackages folder, record the names and versions of the Microsoft symbol packages.
  5. In AL Explorer, inspect the Customer table and Customer Card page. Confirm that the starter objects extend published AL objects instead of changing their source.
  6. Inspect app.json. Record the target, application version, platform version, runtime, empty dependency array, and owned ID range.

The empty dependencies array means that this project doesn't declare a dependency on another independently installed extension. References to Microsoft application objects resolve through the application symbols selected by the manifest.

Capture this evidence:

Evidence Record
Microsoft symbol package names and versions Your findings
Base objects used Customer table and Customer Card page
Extension mechanisms Table extension, page extension, and event subscriber
Manifest boundary Cloud target, baseline versions, and ID range
Explicit app dependencies None

Publish and validate the extension

  1. Press F5 or run AL: Publish and select Business Central online sandbox.
  2. In the Business Central web client, open Extension Management.
  3. Confirm that Architecture Assessment version 1.0.0.0 appears as installed.
  4. Open Customers, select a customer, and open the customer card.
  5. Confirm that Architecture review status appears after Name.
  6. Clear the status, change the customer name, and move away from the field. Confirm that the status changes to Draft.
  7. Record the installed version and the observed field behavior. Remove the extension after you complete the exercise if your administrator requires cleanup.

If publishing reports an object ID conflict, update all three object IDs and the field ID to unused values within 50000 through 99999, and update the idRanges entry to contain those values. Keep each ID stable after the extension reaches a shared environment.

Complete the architecture decision record

Copy and complete this architecture decision record (ADR). Base each decision on the scenario, your sandbox evidence, and the principles from the preceding units.

## ADR: Business Central solution architecture

### Status
Proposed

### Context
- Business requirement:
- Deployment and integration constraints:
- Update predictability requirement:

### Decision
- Deployment choice and rationale:
- Extension boundary and owned AL objects:
- Event or API boundaries:
- App dependencies and minimum versions:

### Evidence
- Downloaded symbol versions:
- Published extension version:
- Observed object and behavior results:

### Update plan
- Service and app compatibility checks:
- Schema synchronization approach:
- Data upgrade requirement for version 1.0.0.0:
- Owner for monitoring, validation, deployment, and approval:

### Risks and follow-up actions
- Risk:
- Mitigation:
- Trigger for architecture review:

Your ADR should recommend Business Central online because the stated requirements use supported cloud extension points, avoid direct database access, and prioritize predictable service updates. It should identify the added field as extension-owned schema and the subscriber as a dependency on a published event contract. Version 1.0.0.0 only adds a field, so it doesn't require data transformation. A later version that derives, changes, or moves stored values might require upgrade code.

The completed ADR meets the exercise goal when it cites sandbox evidence, assigns lifecycle owners, identifies compatibility assumptions, and distinguishes schema synchronization from data upgrade work.