community postAL Developmentcommunity - not Microsoftreviewed - checked by Opus

Dynamics 365 Business Central: How to add a “TAB” character to a string via AL

The post explains how to add a TAB character to a string in AL code by using its ASCII character code (9) instead of trying to type it directly. This technique is useful for barcode generation and string formatting when TAB characters are needed as delimiters.

post Dynamics 365 Lab

Yun Zhu · 2026-04-20 · 399 words · about 2 min

"The TAB key on the keyboard cannot actually be used to type TAB."

Key points

  • TAB character cannot be typed directly using the keyboard TAB key; use ASCII code 9 instead
  • Create a Char variable and assign it the value 9 to represent the TAB character
  • Concatenate the TAB character with other strings using the plus operator
  • TAB-delimited strings can be split later using appropriate string manipulation methods

Quotes

  • “The TAB key on the keyboard cannot actually be used to type TAB.” (Explains why direct keyboard entry doesn’t work and why an alternative approach is needed)
  • “First, you need to find the number for the TAB character, 9.” (Provides the specific ASCII code needed to represent a TAB character in 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.

Not found in BC28-30: report “Item Info”.

No source states these links: they share an object, a model read them, or a person found the same subject.

Context

  • Features: barcode generation, QR code encoding, string concatenation, character encoding, TAB character handling

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.