AL extension release · 13.0AL Developmentofficial - Microsoftderived - from the source, no model text

AL Language extension 13.0

AL Language extension 13.0 for Business Central 2024 release wave 1 (BC24): previewed 2023-09-11, released 2024-03-18; 18 changelog entries, 25 GitHub issues linked.

Changelog on the Visual Studio Marketplace · Business Central 2024 release wave 1 · BC24

Support for multiple extensions to same target and extensions and target in same app

We have expanded the support for extension objects to help achieve better separation of concerns in large apps. The following changes have been made:

  • Extensions can now exist in the same app as their target.
  • Multiple extensions to the same target can exist in the same app.

For table extensions in the same app as their target, the fields and keys will be moved to the base table to prevent SQL-joins at runtime.

Since extension objects from a given app are applied on the target following the extension object ID, the following compiler validation was introduced:

  • The base object cannot reference members from extension objects.
  • Extension objects can reference members from other extension objects in the same app only if the other extension object has a lower object ID.

Changes to AL Table Proxy Generator tool (altpgen)

AL Table Proxy Generator tool (altpgen) now requires two additional arguments: ClientId and RedirectUri. Due to security measures, the default Microsoft Entra application is removed from the tool. Users are now required to register their own Microsoft Entra application as described at aka.ms/altpgen.

Script/Css/Image paths on control add-ins can be relative to the control add-in source file.

Control add-in resources can also be stored relative to the file containing the control add-in source.

The search order for resources is now:

  1. Relative to the project root
  2. Relative to the control add-in source.

The following example shows the two options.

file: MyControlAddIn.al

controladdin MyControlAddIn
{
    Scripts = './js/myscript.js';
    StyleSheets = 'css/mystyle.css';
    ...
}

Resources are relative to project root:

.
[src]
    MyControlAddIn.al
[resources]
    [js]
        myscript.js
    [css]
        mystyle.css
app.json

Resources are relative to controladdin source:

.
[src]
    MyControlAddIn.al
    [resources]
        [js]
            MyScript.js
        [css]
            MyStyle.css
app.json

New “Create AL Project” button

When no folders are opened, the Primary Side Bar for Explorer now has a button named “Create AL Project”. Clicking this button invokes the AL:Go command to create a new project.

Isolated Storage - New method overloads for use with the SecretText type

We have introduced new overloads for the built-in methods of IsolatedStorage type to allow its use with the SecretText type. When values are added as SecretText, the runtime will ensure they can only be retrieved in the same type. This makes it possible to ensure that they are protected from debugging throughout their entire lifetime. In addition, a new overload to the Contains method was added to allow checking if a value was added as a SecretText.

AlDoc supports overwrite files

Generated documentation can be updated or augmented by including markdown files during build. E.g. a summary can be added during the AlDoc build process to the following enum

namespace MyNS;
enum 50100 MyEnum
{
}

by including a markdown file with the following content

---
uid: O:Enum::MyNS#MyEnum
summary: This is my new comment
---

Support ended for debugging Business Central server versions less than 20

Business Central server versions released before the April 2022 release (version 20) cannot be debugged with AL extension package versions that are greater than or equal to version 13.

Folding usings

It’s now possible to use the “editor.foldingImportsByDefault” setting. When set to true it collapses all of the using statements when a file is opened.

New AlterKey on database

Added new AL database api for disabling and re-enabling keys within the current transaction.

Tooltips on table fields

Introduced the tooltip property on table fields, which like the caption will be applied on page controls that reference the table field. This includes a code action that helps with moving the tooltip from page controls to table fields or cleans them up from the page in case of duplicates.

FileUploads and Drag & Drop

Added new action type and a new file type for handling uploading files.

fileUploadAction(MyUploadAction)
{
    trigger OnAction(files: List of [FileUpload])
    begin
        // Insert code here.
    end;
}

Placeholder text on Page Fields

Page fields can now leverage the InstructionalText and InstructionalTextML properties to define placeholders. These values will be showed when the field would otherwise be empty.

Using this new capability, you can provide example values to your users. This feature is currently supported only for text types like Text, BigText, Code, and Guid.

Prompt Guides

PromptDialog pages now support defining a prompt guide, which contains a list of pre-defined text prompts. This allows users to easily select a prompt guide to use as input to generate content, rather than creating their own prompt from scratch. Prompt guides are written in AL as standard actions within the PromptGuide action area as follows.

page 50100 MyCopilotPage
{
    PageType = PromptDialog;
    PromptMode = Prompt; //Prompt guides are only rendered on prompt mode.
    Extensible = false;

    layout
    {
        area(Prompt)
        {
            field(NLField; Input)
            {
                // Hint users to use prompt guides
                InstructionalText = 'Select a prompt guide to get started';
            }
        }

        //..
    }

    actions
    {
        area(PromptGuide)
        {
            action(OrderFromDescription)
            {
                Caption = 'Order from description';

                trigger OnAction()
                begin
                    Input := 'The prompt is set in the NL field';
                    CurrPage.Update();
                end;
            }
            //..
        }
    }

    var
        Input: Text;
}

Copilot prompt actions

Introduced the Copilot prompt actions to promote AI capabilities of a Business Central solution. These will be rendered in a floting action bar in your pages that nudges users to use relevant Copilot features. Copilot actions are written in AL as standard actions within the Prompting action area as follows.

actions
{
    area(Prompting)
    {
        action(MyPromptAction)
        {
            RunObject = page "Copilot Marketing Text";
        }
    }
}
  • Introduced a new Cookie datatype. This datatype represents an HTTP cookie.
  • Added an AL interface to handle cookies in HttpResponseMessage and HttpRequestMessage data types.

AppSourceCop

  • Added rule AS0124 for detecting breaking changes when changing the target of an extension object. The rule currently only validates page extensions and page customizations, because other extension objects do not support the ObsoleteState properties and cannot be deprecated.
  • Updated rule AS0105 to allow references to obsolete table, table fields, and table keys in upgrade codeunits.
  • Updated diagnostic message and description of rule AS0080 to not mention primary key fields validation anymore, because the primary key fields validation is performed by rule AS0118.
  • Added rule AS0125 for detecting translation ID breaking changes. The rule is enabled by default with its severity set to ‘Info’.
  • Added rule AS0126 for detecting when the publisher name specified in ‘internalsVisibleTo’ is not the one of the current extension.
  • Refactoring of breaking change validation rules to support multiple extension objects for the same target and extension objects and target in same app.
  • Updated rule AS0098 to also check for keys on table extension fields.

GitHub Issues

  • #7512 Report unknown triggers defined in ‘modify’ changes in page extensions.
  • #7423 [AL Explorer] Add object name in event subscribers.
  • #7464 Action “Generate Permission Set” Breaks Comment Formatting.
  • #7516 Region folding / stickyscroll not working
  • #7542 Find Event does Not Open
  • #7525 Unexpected value ‘BadExpression’ of type ‘Microsoft.Dynamics.Nav.CodeAnalysis.BoundKind’
  • #7535 Quick fix for parenthesis (AL0008) is not working correctly
  • #5124 Snippet for page part doesn’t include applicationarea property
  • #7576 Code ‘BO’ is not a valid ISO 3166-1 alpha-2 code
  • #7553 Go To Defention + ReName not working for TableRelation with primary key specified
  • #7571 Page Fields (Controls) added via ReportExtension are missing on RequestPageHandler
  • #7571 al.compilerOptions.outFolder does not work as expected for “Publish full dependency tree…” command
  • #7558 A [TryFunction] that implements an interface returns wrong values
  • #7598 Procedure declaration should not end with semicolon
  • #7547 New PTE Rule: Table Extension fields should be in app id ranges. This is covered by the newly introduced PTE0022 and PTE0023.
  • #7613 Implicit conversion is being performed from Enum to Option
  • #7650 Compiling App against Next Major shows AL0186 error
  • #7614 Compiler Bug: Inconsistent accessibility is not enforced
  • #7635 AL0749 misses internal/local IntegrationEvent triggers
  • #7593 System.ArgumentNullException: Value cannot be null. (Parameter ‘key’)
  • #7653 Never-Ending ‘Loading Workspace’ Issue with ‘jsonc’ Format in ‘app.json’
  • #7605 Regions no longer work since Update 11
  • #7664 Sending notification workspace/didChangeConfiguration failed.
  • #7681 AS0124 error for unchanged pageextension
  • #7688 Page Customization breaks translations for Page Extension
  • #7661 The ID for the Field is not valid. It should be withing the range which is allocated to the application.

Miscellaneous

  • Added warning AL0804 when referencing actions defined in page customizations in event subscriptions. From runtime version 14.0, this will turn into the error AL0575.
  • Event Subscriber snippet copied in the Explorer will now use the new identifier syntax when possible and correctly produce the string version as well.
  • Removed diagnostic AL0249 reported on missing page parts in favor of AL0185 for missing application objects because the message for AL0249 was never formatted correctly.
  • Fixed multiple cases where using nested function calls as the value of data item columns would cause runtime crashes.
  • Go To Definition on Interfaces declared in a dependency is working again.
  • Added error AL0814 when using a FlowFilter as the source of a column in queries. From runtime version 14.0, this will turn into the error AL0815.
  • Fixed diagnostic AA0228 to handle methods with quotes in their name. Previously, methods with quotes in their name would always be reported as unused.
  • Fixed collisions of Events in extension objects. Introduced new Warning error AL0818 that after runtime version 15.0 will be turned into AL0819.
  • Add semanticHighlighting to page part names and targets of actionsrefs.
  • Fixed diagnostic message for AL0424 to mention that multilanguage syntax should not be used when translation files are used by the extension.
  • Added compiler validation of arguments provided to AddAction method on ErrorInfo and Notification. A warning will now be raised if the referenced codeunit could not be resolved and if the method is not available or doesn’t have the required signature.
  • Fixed a bug where the Find Event command would lead to a crash if there was an event on an extension object whose target could not be resolved.
  • Added error AL0408 when using Media or Mediaset as collection type arguments.
  • Added support for requesting a range of numbers from a NumberSequence.
  • Added support for restarting a NumberSequence from a given seed.
  • Added error AL0827 to report passed-in fields of FlowFilter and FlowField class to the Record.CalcSums method which is not allowed.
  • Added a code action to fix warning AL0729 about promoted properties used on page types which do not support promoted actions.
  • Added support for suppressing the diagnostics AL0254, AL0659, AA0074, AA0100, AA0470 and AA0218 per instance, per document, per project, or per workspace.
  • Fixed collection types that were showing as not recognized when their type argument wasn’t valid.
  • Symbol operations like Go to Definition, Rename etc. now work correctly with table names in table relations and calculation formulas.
  • A new diagnostic is added for when an interface is implemented via a try function, which will not be supported in the future.
  • Fixed explicit with statement converter when dealing with TestPages
  • Marked Dialog.LogInternalError as deprecated.
  • Fixed issue where protected variables of a report could not be used in its report extensions’ requestpage.
  • Fixed inconsistencies between the local and server compilation when evaluating paths when using Images, Scripts, and StyleSheets properties on control add-ins.
  • Added warning AL0598 when adding and modifying a table field within the same table extension.
  • Fixed an issue where not all manifest diagnostics would show up in the Problems window of Visual Studio Code.
  • Fixed issue where Queries with UsageCategory would not be included to the Search in SaaS.
  • Added support for translating page list views using translation files.
  • Added support for having lists of In- or OutStreams.
  • Add AL0837 to detect translation ID conflicts involving TextConst variables.
  • Modified the missing debug configuration error message to allow for the selection of a debug configuration (local or cloud) to be added to the launch.json file.
  • Fixed an issue that caused fields from table extensions to fail to bind for RunPageLink and other similar properties.
  • Updated AA0217 to only report diagnostics if literals contain alphabetic characters.
  • Fixed an issue where the with statement converter would silently crash when encountering procedure invocations by assignment.
  • Added configuration flag al.semanticFolding.enabled, in the settings.json file, for controlling if the extension should provide the folding ranges, or if the strategy from Visual Studio Code should be used.
  • Support report extensions when generating Excel layout template and emit a default data row using column default values (type specific).
  • Added AL interface to enable UseResponseCookies in HttpClient.
  • Various fixes were made to ensure that RAD works more reliably in workspaces that use namespaces.
  • Added code actions to fix all AL0606 warnings in the document, project, or workspace scope.
  • New CodeCop rule AA0234 to make sure table fields have a ToolTip specified.
  • Added warning AL0835 when updating the same layout file in different layouts.
  • Disabled CodeCop rule AA0072 by default. In order to enable it, you must now include it in a ruleset, see Ruleset for the code analysis tool.
  • Added warning AL0803 when the names of two events or event subscribers conflict within the same object. Whitespaces in names are internally replaced with an underscore during compilation, such that two different names can collide. For example, “my event” and “my_event” are conflicting names. From runtime 15.0, an error will be reported with AL0757.
  • The extension will no longer wait forever when there are comments in the manifest file.
  • Fixed an issue which caused the workspace settings to not update dynamically.
  • Added support for passing an integer parameter to a method that has one overload with an Option and another overload with an Enum parameter. This call used to be ambiguous, but the method with the Option parameter will now be selected.

Source: Visual Studio Marketplace, ms-dynamics-smb.al changelog, Microsoft’s text unchanged. Dates from the gallery’s upload records.