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
"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.
- codeunit 10 “Type Helper”
- report “Item Info”
- enum 9205 “Barcode Symbology 2D”
- enum 9206 “Barcode Font Provider 2D”
- interface “Barcode Font Provider 2D”
Not found in BC28-30: report “Item Info”.
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- Dynamics 365 Business Central: How to add Filter by item attributes to the Item Ledger Entries page — possibly related: both name Codeunit 10 “Type Helper”
- Dynamics 365 Business Central: How to add Notes (System Parts) from FactBox to a report — possibly related: both name Codeunit 10 “Type Helper”
- Dynamics 365 Business Central: How to add or subtract hours from a DateTime field — possibly related: both name Codeunit 10 “Type Helper”
- Dynamics 365 Business Central: How to convert Month Name (Text) to Month Number (Integer) — possibly related: both name Codeunit 10 “Type Helper”
- Understanding AL Development: The Type Helper Code Unit — possibly related: both name Codeunit 10 “Type Helper”
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.