community postPlatform, DevOps & Performancecommunity - not Microsoftreviewed - checked by Opus

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

Marcel Chabot · 2026-09-04 · 984 words · about 4 min

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.

Not found in BC28-30: table “Country Region”.

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.