AL Object Types

Complete guide to all AL object types — Tables, Pages, Reports, Codeunits, Queries, XmlPorts, and more.

25 minBeginner

Learning Objectives

  • Match each AL object type to its primary purpose
  • Differentiate data storage objects from presentation objects
  • Understand when to use Codeunits, Queries, and XmlPorts

Overview

Objects are the fundamental building blocks of AL programming in Business Central. Each object type serves a specific architectural or functional purpose.

Core AL Object Types

ObjectPurposeStores Data?
TableData structure and storageYes
PageUser interface (Card, List, Document, Role Center)No
ReportFormatted output, printing, data exportNo
CodeunitBusiness logic, procedures, event subscribersNo
QueryOptimized read-only data retrieval (SQL-like)No
XmlPortImport/export XML, CSV, and text dataNo
EnumFixed set of named values (replaces Option)Yes
Control Add-inCustom HTML/JavaScript UI on pagesNo
ProfileRole Centers and user-specific page customizationsNo
Permission SetSecurity permissions for objects and dataNo
Table ExtensionAdd fields/keys to existing tablesYes
Page ExtensionAdd fields/actions to existing pagesNo

Data vs Presentation

Store data: Table, Table Extension, Enum

Present or process data: Page, Report, Query, XmlPort

Business logic: Codeunit

Extension Objects

Table Extension, Page Extension, Report Extension, and Enum Extension let you customize the base application without modifying Microsoft code.

When to Use Each Object

Table

Define new data structures. Every custom entity starts with a table.

Page

Show data to users. Every table needs at least a List and Card page.

Codeunit

Encapsulate business logic that doesn't belong to a specific table. Posting routines, validations, integrations.

Report

Generate printable documents or export data. Invoices, statements, analysis reports.

Query

Read-only data aggregation optimized for performance. Used in charts, OData APIs, and reporting.

XmlPort

Import/export data in XML, CSV, or fixed-width formats. Data migration and EDI integrations.

Object ID Ranges

Your extension's app.json defines allocated ID ranges:

"idRanges": [
    { "from": 50100, "to": 50149 }
]

All custom objects must use IDs within your allocated range.

Key Revision Points (MB-820)

  • Be able to match object type to purpose
  • Tables store data; Pages/Reports present it
  • Codeunits encapsulate business logic
  • Extension objects customize without modifying base app
Open Source

Help improve this platform

NAVBC Learning is open source. Report issues, suggest improvements, or join discussions on GitHub.