Understanding Business Central’s Format Address Codeunit
Codeunit 365 (Format Address) handles address formatting across Business Central for customers, vendors, and contacts, applying global postal rules based on country configuration. The post explains its architecture, extensibility through integration events, and demonstrates how to extend it with custom logic for compliance or data correction.

post Aardvark Labs
Key points
- Format Address reads country-specific formatting rules from the Country Region table, making behavior configurable and safe for localization
- The codeunit is highly extensible with OnBefore integration events on each record-specific procedure, allowing custom logic without modifying core behavior
- Each formatted address returns an array of 8 text elements, with the 8th element intentionally left empty for extension use
- Custom extensions can hook into the formatting process to clean data, add location details, or apply region-specific rules without editing reports
AL objects mentioned
As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.
- codeunit 365 “Format Address”
- table “Country Region”
- table 18 “Customer”
- table 23 “Vendor”
- table 5050 “Contact”
- table 36 “Sales Header”
- table 14 “Location”
- table 98 “General Ledger Setup”
Not found in BC28-30: table “Country Region”.
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- Allow Posting Date Formula — possibly related: both name Table 98 “General Ledger Setup”
- Allow Posting From/To DateFormula: No More Monthly Date Updates from Business Central v28 — possibly related: both name Table 98 “General Ledger Setup”
- Automating Posting Periods in Business Central with Date Formulas — possibly related: both name Table 98 “General Ledger Setup”
- Business Central 2026 release wave 1 (BC28): Calculate withholding taxes for vendors (Withholding Tax) — possibly related: both name Table 98 “General Ledger Setup”
- Control Deferral Posting — possibly related: both name Table 98 “General Ledger Setup”
- Dynamics 365 Business Central: “Hide Company Bank Account” setup in General Ledger Setup (Update Company Bank Account on posted documents) — possibly related: both name Table 98 “General Ledger Setup”
- Dynamics 365 Business Central: How to prevent users from uploading duplicate files as attachments (Duplicate file names) — possibly related: both name Table 98 “General Ledger Setup”
- Dynamics 365 Business Central: How to quickly check whether the user has write (Insert, Delete, and Modify) permission for the table in AL — possibly related: both name Table 23 “Vendor”
- Dynamics 365 Business Central: How to set the minimum and maximum numeric values for a field — possibly related: both name Table 23 “Vendor”
- How to Use Date Formulas for Allowed Posting Periods in Business Central BC28. — possibly related: both name Table 98 “General Ledger Setup”
Heads up
- gotcha: “If you are not going to use the IsHandled flag and perform the address array population yourself, don’t do anything with the array.” (about codeunit Format Address)
Context
- Features: address formatting, country-specific postal rules, integration events, extensibility hooks, location-based details, multi-record type support
Source: Aardvark Labs, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.