Information Sharing: Change log for AL Language Version 6.0.0 in Business Central 2020 release wave 2 update

Dynamics 365 Business Central

The article is selected from the website:

Version 6.0.0


We have introduced the ability to record AL execution on a Business Central server, also called snapshot debugging. To do snapshot debugging, you must be a delegated admin and part of the “D365 Snapshot Debug” permission group. When the AL execution has ended, you can download the recorded snapshot file and debug it with the new snapshot debugger in Visual Studio Code. F7 will initialize a snapshot debugging session, Shift+F7 provides status such as when the end-user connects to the Business Central server using the client and then if a snapshot debugging request was saved for that user, the user’s AL code in the specific client session will be recorded, and Alt+F7 ends snapshot debugging on the Business Central server and produces a debuggable snapshot file. In connection with this addition, please note that the existing “al.downloadsource” command for F7 has been remapped to Alt+F6.

Debugging Upgrade and Install code

It is now possible to debug upgrade and install codeunits. A new command “Publish extension without building” has been introduced that will allow for apps to be published while debugging. To debug upgrade or install code, first initiate an attach debug session. After the debugger has attached, invoke the new command or use Ctrl+F5 to publish the app file. If the version of the app has not been incremented, install codeunits will be invoked. If the version of the app has been incremented, or the forceUpgrade flag has been set to true in the launch.json file, upgrade codeunits will be invoked.

Indication of overloads in IntelliSense.

IntelliSense now includes the number of additional overloads together with the signature of the first method. Selecting the method allows you to browse through the different overloads.

Global warning suppression from app.json and the alc command-line

Warnings can be suppressed globally using the “suppressWarnings” option in the app.json file. The option takes a list of warning IDs as argument.

"suppressWarnings": [ "AL0604", "AA0215" ]

We also support global warning suppression from the alc command-line using the the /nowarn switch.

Captions for OData

With this release we have added a new attribute Caption that can be applied to procedures that are ServiceEnabled or defined in an API page. It makes it possible to provide translations in the OData metadata for procedures. Furthermore, we have added two new properties EntityCaption and EntitySetCaption that enable providing different translations for entities.

Documentation Comments

With this release we support documentation comments for AL similar to C#. Documentation comments are structured comments preceded with a three slashes (///) instead of the usual two slashes (//). The documentation comment a special syntax that contains XML text. The documentation comment must immediately precede a user-defined type that it annotates, for example a codeunit, table, or interface, or a member such as a field or method. There is IntelliSense support for writing documentation comments. Most importantly providing a template documentation comment when writing the third slash in the triple slash. Documentation comments are visible when hovering over source symbols, in completion lists, and in signature help. Improve your source code by adding documentation comments.

Preprocessor directives

AL now supports three types of preprocessor directives

  • Conditional directives (conditional compilation)
  • Regions (expand/collapse regions of code)
  • Pragmas (disable/enable warnings and implicitwith)

Improvements to the AppSourceCop and its documentation

Since the release of Business Central 2020 release wave 1, we have been working on the AppSourceCop code analyzer. We gathered the feedback we received on existing rules in order to improve them and create a more reliable experience. We have also added new rules covering aspects that were previously missing and improved our online documentation to be contain more examples and actionable information.


Copied title and URL