community postAL Developmentcommunity - not Microsoftreviewed - checked by Opus

Dynamics 365 Business Central: Formatting Boolean Values (Yes/No, true/false, and 1/0)

Boolean fields in Business Central display as checkboxes by default, but converting them to text for pages or reports requires specific methods. The post demonstrates how to use ToText() and Format() functions with different parameters to display Boolean values as Yes/No, true/false, or 1/0.

post Dynamics 365 Lab

Yun Zhu · 2026-07-07 · 283 words · about 1 min

"Boolean field in the database is automatically rendered as a Checkbox/Toggle on the page (UI) by default"

Key points

  • Boolean fields automatically render as toggles on UI, but need conversion for text display in reports
  • Use ToText() method or Format() function with parameter combinations (0,9) and (0,2) to convert Boolean to text
  • Follow naming conventions using prefixes like Is, Has, or Allow for Boolean variables to improve code readability
  • Avoid comparing Boolean values to true/false unnecessarily; use if IsPosted then instead of if IsPosted = true then

Quotes

  • “Boolean field in the database is automatically rendered as a Checkbox/Toggle on the page (UI) by default” (Explains default UI behavior for Boolean fields, establishing why conversion methods are needed)
  • “Since a Boolean is already a truth value, do not compare it to true or false unnecessarily.” (Core best practice for writing cleaner, more readable AL code)

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.

  • other “CustomerListExt”

Context

  • Features: Boolean data type, Format function, ToText method, checkbox rendering, text conversion

Source: Dynamics 365 Lab - Yun Zhu, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.