community postAL Developmentcommunity - not Microsoftreviewed - checked by Opus

Format Cheatsheet

A reference guide showing how the Format() function outputs different data types (DateTime, Date, Time, Guid, Decimal, Boolean, Option, Enum, Duration, RecordId, DateFormula) across nine format options (0-7 and 9), helping developers quickly find the correct format specification for their needs.

post Tech Adventures in Business Central | AL Development & AI Solutions

Tine Staric · 2025-10-07 · 293 words · about 1 min

Key points

  • Format() supports 9 different format codes (0-7 and 9) that produce different output styles for the same data type
  • Each data type behaves differently with each format option; some combinations return N/A (no meaningful output)
  • Format 3 returns GUID without curly braces; Format 4 returns GUID with hyphens; Format 5 returns GUID with parentheses
  • Some formats are language-dependent and produce localized results like month names
  • Format 9 returns ISO 8601 style output for DateTime and a fully qualified format for RecordId

Context

  • Features: Format() function, DateTime formatting, Date formatting, Time formatting, GUID formatting, Decimal formatting, Boolean formatting, Duration formatting

Source: Tech Adventures in Business Central, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.