Work with multiline strings in AL

Important

Some of the functionality described in this release plan has not been released. Delivery timelines may change and projected functionality may not be released (see Microsoft policy). Learn more: What's new and planned

Enabled for Public preview General availability
Users, automatically Apr 2025 Apr 2025

Business value

When developing AL, very long strings are sometimes used. Previously these had to be written in one line, making it hard to easily read content. In this release, we've added support for writing out strings spanning multiple lines, allowing developers to format the string content in a more human readable form. This especially helps when working with more structured string content, like JSON content.

Feature details

You can now write a string in AL that spans multiple lines by prefixing it with @. This allows you to write the string in a more human readable form—for example, when the content is a structured format like JSON content.

When using this option, remember that any added white space (such as trying to indent lines) will become part of the string, and is therefore not recommended.

Below is an example of using this capability when assigning a JSON template structure to a text variable. Notice the use of @ at the beginning of the string to indicate a multiline string.

Example of using the new multiline string feature in AL

Tell us what you think

Help us improve Dynamics 365 Business Central by discussing ideas, providing suggestions, and giving feedback. Use the forum at https://aka.ms/bcideas.