Dynamics 365 Business Central 2023 Wave 2 – Get inlay hints in source editor for AL method parameters and return types

With each update of Dynamics 365 Business Central, Microsoft enhances what is often referred to as the base application and enhances the development environment. Dynamics 365 Business Central 2023 Wave 2 has several exciting Application features for runtime 12.0. One of the exciting features is to Get inlay hints in source editor for AL method parameters and return types.

Visual Studio Code supports inlay hints. Inlay hints allow languages to provide additional information about source code rendered inline. Inlay hints are usually used to show types of variables and function return types.

Hold on to your hats because I’ve got some exciting news for all you AL coding enthusiasts! Microsoft Dynamics 365 Business Central now supports Inlay hints for the AL Language. These hints provide a new level of information about source code rendered inline. You can now see variable types and function return types in the code – it’s like having a superpower! The new al.inlayhints settings determine the inlay hints you can see within your AL code. Enable the al.inlayhints.functionReturnTypes.enabled and al.inlayhints.parameterNames.enabled settings and see it yourself!

Without Inlay hints

With inlay hints

The inlayhints are further customized with the editor.inlayHints setting. You have control over when they’re enabled, the fontFamily, fontSze and if there is padding.

Read more about the feature Get inlay hints in source editor for AL method parameters and return types here.

Note: The code and information discussed in this article are for informational and demonstration purposes only. This content was created referencing Microsoft Dynamics 365 Business Central 2023 Wave 2 online.

Dynamics 365 Business Central 2023 Wave 2 – Set new output folder setting for storing app files at AL project build

With each update of Dynamics 365 Business Central, Microsoft enhances what is often referred to as the base application and enhances the development environment. Dynamics 365 Business Central 2023 Wave 2 has several exciting Application features for runtime 12.0. One of the exciting features is to Set new output folder setting for storing app files at AL project build.

Before Microsoft Dynamics 365 Business Central, 2023 Wave 2, when you built an AL project, the app file was stored in the project folder by default. A developer could set several folders for storing shared files, such as the “al.packagecache” folder for the downloaded symbols. If a developer wanted to save the app file to a folder outside of the project folder, they needed to move it external to the compiler.

The Business Central 2023 Wave 2 has a new feature in the “al.compilerOptions” settings. This feature allows developers to specify the “outFolder” property, which determines the output folder when generating an app file to build an AL project. This simplifies managing and reusing generated apps by storing them in a single location.

Read more about the feature Set new output folder setting for storing app files at AL project build here.

Note: The code and information discussed in this article are for informational and demonstration purposes only. This content was created referencing Microsoft Dynamics 365 Business Central 2023 Wave 2 online.

November 2023 Cumulative Updates for Dynamics 365 Business Central

The November updates for Microsoft Dynamics 365 Business Central are now available.

Before applying the updates, you should confirm that your implementation is ready for the upgrade and ensure compatibility with your modifications. Work with a Microsoft Partner to determine if you are ready and what is needed for you to apply the update.

Please note that Online customers will automatically be upgraded to version 23.1 over the coming days/weeks and should receive an email notification when upgraded.

Direct links to the cumulative updates are listed here:

Dynamics 365 Business Central On-Premises 2023 Release Wave 2 – 23.1 (November 2023)

Dynamics 365 Business Central On-Premises 2023 Release Wave 1 Updates – 22.7 (November 2023)

Dynamics 365 Business Central On-Premises 2022 Release Wave 2 Updates – Update 21.13 (November 2023)

Dynamics 365 Business Central On-Premises 2022 Release Wave 1 Updates – Update 20.18 (October 2023)

Dynamics 365 Business Central On-Premises 2021 Release Wave 2 Updates – Update 19.18 (April 2023)

Dynamics 365 Business Central On-Premises 2021 Release Wave 1 Updates – Update 18.18 (October 2022)

Dynamics 365 Business Central On-Premises 2020 Release Wave 2 Updates – Update 17.17 (April 2022)

Dynamics 365 Business Central On-Premises 2020 Release Wave 1 Updates – Update 16.19 (January 2022)

Dynamics 365 Business Central On-Premises 2019 Release Wave 2 Updates – Update 15.17 (April 2021)

Dynamics 365 Business Central On-Premises Spring 2019 Updates – Update 52 (October 2023)

Dynamics 365 Business Central On-Premises October’18 Updates – Update 18 (April 2020)

Microsoft Dynamics NAV 2018 – Update 60 (January 2023)

Microsoft Dynamics NAV 2017 – Update Update 61 (January 2022)

Microsoft Dynamics NAV 2016 – Update 67 (July 2021)

Dynamics 365 Business Central 2023 Wave 2 – Provide queries for users to do ad hoc data analysis

With each update of Dynamics 365 Business Central, Microsoft enhances what is often referred to as the base application and enhances the development environment. Dynamics 365 Business Central 2023 Wave 2 has several exciting Application features for runtime 12.0. One of the exciting features is to Dynamics 365 Business Central 2023 Wave 2 – Provide queries for users to do ad hoc data analysis.

In the realm of AL development for Microsoft Dynamics 365 Business Central, Query objects are a pivotal tool for extracting and amalgamating records from multiple tables, thereby structuring the data into a unified dataset composed of rows and columns, akin to the functionality provided by an SQL query. There are two types of Query objects: ‘normal’ and ‘API’. Additionally, Queries can execute computational operations on the data, such as sums or averages within a specific dataset column. Moreover, the utilization of Query objects offers a notable enhancement in terms of performance efficiency, particularly in data reading and processing operations.

Before Microsoft Dynamics 365 Business Central 2023 Wave 2, if a developer wanted to display the results of a query on a page, they had to open the Query, loop through the records, and add them to a page with a temporary source.

page 50100 "DVLPR Customer Overview"
{
    ApplicationArea = All;
    Caption = 'Top Customer Overview';
    DeleteAllowed = false;
    InsertAllowed = false;
    ModifyAllowed = false;
    PageType = List;
    SourceTable = "DVLPR Top Customer Overview";
    SourceTableTemporary = true;
    UsageCategory = Lists;

    layout
    {
        area(content)
        {
            repeater(General)
            {
                field("No."; Rec."No.")
                {
                    ToolTip = 'Specifies the value of the No. field.';
                }
                field(Name; Rec.Name)
                {
                    ToolTip = 'Specifies the value of the Name field.';
                }
                field(City; Rec.City)
                {
                    ToolTip = 'Specifies the value of the City field.';
                }
                field("Country/Region Code"; Rec."Country/Region Code")
                {
                    ToolTip = 'Specifies the value of the Country/Region Code field.';
                }
                field("Country/Region Name"; Rec."Country/Region Name")
                {
                    ToolTip = 'Specifies the value of the Country/Region Name field.';
                }
                field("Profit (LCY)"; Rec."Profit (LCY)")
                {
                    ToolTip = 'Specifies the value of the Profit (LCY) field.';
                }
                field("Sales (LCY)"; Rec."Sales (LCY)")
                {
                    ToolTip = 'Specifies the value of the Sales (LCY) field.';
                }
                field("Sales Person Name"; Rec."Sales Person Name")
                {
                    ToolTip = 'Specifies the value of the Sales Person Name field.';
                }
            }
        }
    }

    trigger OnOpenPage()
    var
        TopCustomerOverviewQuery: Query "DVLPR Top Customer Overview";
    begin
        TopCustomerOverviewQuery.Open();
        while TopCustomerOverviewQuery.Read() do begin
            Rec.Init();
            Rec."No." := TopCustomerOverviewQuery.No;
            Rec.Name := TopCustomerOverviewQuery.Name;
            Rec.City := TopCustomerOverviewQuery.City;
            Rec."Sales (LCY)" := TopCustomerOverviewQuery.Sales_LCY;
            Rec."Profit (LCY)" := TopCustomerOverviewQuery.Profit_LCY;
            Rec."Salesperson Code" := TopCustomerOverviewQuery.Salesperson_Code;
            Rec."Sales Person Name" := TopCustomerOverviewQuery.SalesPersonName;
            Rec.Insert;
        end;
    end;
}

Now – a developer can display the Query by running the object directly. Wait, there is a bonus – not only does the Query display, but it is in the new Analysis Mode.

pageextension 50100 "DVLPR Customer List Ext" extends "Customer List"
{
    actions
    {
        addlast("&Customer")
        {
            action("DVLPR Top Customers Query")
            {
                ApplicationArea = All;
                Caption = 'Top Customers Query';
                Image = Sales;
                RunObject = query "DVLPR Top Customer Overview";
                Tooltip = 'Open the top customer query.';
            }          
        }
    }
}

Read more about the feature Provide queries for users to do ad hoc data analysis across tables here.

Note: The code and information discussed in this article are for informational and demonstration purposes only. This content was created referencing Microsoft Dynamics 365 Business Central 2023 Wave 2 online.

October 2023 Cumulative Updates for Dynamics 365 Business Central

The October updates for Microsoft Dynamics 365 Business Central are now available.

Before applying the updates, you should confirm that your implementation is ready for the upgrade and ensure compatibility with your modifications. Work with a Microsoft Partner to determine if you are ready and what is needed for you to apply the update.

Please note that Online customers will automatically be upgraded to version 23.0 over the coming days/weeks and should receive an email notification when upgraded.

Direct links to the cumulative updates are listed here:

Dynamics 365 Business Central On-Premises 2023 Release Wave 2 – 23.0 (October 2023)

Dynamics 365 Business Central On-Premises 2023 Release Wave 1 Updates – 22.6 (October 2023)

Dynamics 365 Business Central On-Premises 2022 Release Wave 2 Updates – Update 21.12 (October 2023)

Dynamics 365 Business Central On-Premises 2022 Release Wave 1 Updates – Update 20.18 (October 2023)

Dynamics 365 Business Central On-Premises 2021 Release Wave 2 Updates – Update 19.18 (April 2023)

Dynamics 365 Business Central On-Premises 2021 Release Wave 1 Updates – Update 18.18 (October 2022)

Dynamics 365 Business Central On-Premises 2020 Release Wave 2 Updates – Update 17.17 (April 2022)

Dynamics 365 Business Central On-Premises 2020 Release Wave 1 Updates – Update 16.19 (January 2022)

Dynamics 365 Business Central On-Premises 2019 Release Wave 2 Updates – Update 15.17 (April 2021)

Dynamics 365 Business Central On-Premises Spring 2019 Updates – Update 52 (October 2023)

Dynamics 365 Business Central On-Premises October’18 Updates – Update 18 (April 2020)

Microsoft Dynamics NAV 2018 – Update 60 (January 2023)

Microsoft Dynamics NAV 2017 – Update Update 61 (January 2022)

Microsoft Dynamics NAV 2016 – Update 67 (July 2021)

September 2023 Cumulative Updates for Dynamics 365 Business Central

The September updates for Microsoft Dynamics 365 Business Central are now available.

Before applying the updates, you should confirm that your implementation is ready for the upgrade and ensure compatibility with your modifications. Work with a Microsoft Partner to determine if you are ready and what is needed for you to apply the update.

Please note that Online customers will automatically be upgraded to version 22.5 over the coming days/weeks and should receive an email notification when upgraded.

Direct links to the cumulative updates are listed here:

Dynamics 365 Business Central On-Premises 2023 Release Wave 1 Updates – 22.5 (September 2023)

Dynamics 365 Business Central On-Premises 2022 Release Wave 2 Updates – Update 21.11 (September 2023)

Dynamics 365 Business Central On-Premises 2022 Release Wave 1 Updates – Update 20.17 (September 2023)

Dynamics 365 Business Central On-Premises 2021 Release Wave 2 Updates – Update 19.18 (April 2023)

Dynamics 365 Business Central On-Premises 2021 Release Wave 1 Updates – Update 18.18 (October 2022)

Dynamics 365 Business Central On-Premises 2020 Release Wave 2 Updates – Update 17.17 (April 2022)

Dynamics 365 Business Central On-Premises 2020 Release Wave 1 Updates – Update 16.19 (January 2022)

Dynamics 365 Business Central On-Premises 2019 Release Wave 2 Updates – Update 15.17 (April 2021)

Dynamics 365 Business Central On-Premises Spring 2019 Updates – Update 51 (September 2023)

Dynamics 365 Business Central On-Premises October’18 Updates – Update 18 (April 2020)

Microsoft Dynamics NAV 2018 – Update 60 (January 2023)

Microsoft Dynamics NAV 2017 – Update Update 61 (January 2022)

Microsoft Dynamics NAV 2016 – Update 67 (July 2021)

August 2023 Cumulative Updates for Dynamics 365 Business Central

The August updates for Microsoft Dynamics 365 Business Central are now available.

Before applying the updates, you should confirm that your implementation is ready for the upgrade and ensure compatibility with your modifications. Work with a Microsoft Partner to determine if you are ready and what is needed for you to apply the update.

Please note that Online customers will automatically be upgraded to version 22.4 over the coming days/weeks and should receive an email notification when upgraded.

Direct links to the cumulative updates are listed here:

Dynamics 365 Business Central On-Premises 2023 Release Wave 1 Updates – 22.4 (August 2023)

Dynamics 365 Business Central On-Premises 2022 Release Wave 2 Updates – Update 21.10 (August 2023)

Dynamics 365 Business Central On-Premises 2022 Release Wave 1 Updates – Update 20.16 (August 2023)

Dynamics 365 Business Central On-Premises 2021 Release Wave 2 Updates – Update 19.18 (April 2023)

Dynamics 365 Business Central On-Premises 2021 Release Wave 1 Updates – Update 18.18 (October 2022)

Dynamics 365 Business Central On-Premises 2020 Release Wave 2 Updates – Update 17.17 (April 2022)

Dynamics 365 Business Central On-Premises 2020 Release Wave 1 Updates – Update 16.19 (January 2022)

Dynamics 365 Business Central On-Premises 2019 Release Wave 2 Updates – Update 15.17 (April 2021)

Dynamics 365 Business Central On-Premises Spring 2019 Updates – Update 50 (August 2023)

Dynamics 365 Business Central On-Premises October’18 Updates – Update 18 (April 2020)

Microsoft Dynamics NAV 2018 – Update 60 (January 2023)

Microsoft Dynamics NAV 2017 – Update Update 61 (January 2022)

Microsoft Dynamics NAV 2016 – Update 67 (July 2021)

Microsoft Dynamics 365 Business Central – Sorting Algorithms: Bubble, Merge, and Quick

The other day I felt my computer files were a little disorganized, so I went through some old files to do some hard-core cleanup. I wanted to purge and archive old programs, documents, and repos. While reviewing the files, I found some old C# code (from the days of when I tried to stay sharp through CodeWars), I wrote to test different sorting algorithms. Sorting algorithms are used to organize data in a specific order, and in my code, there was the good ole Bubble Sort, the Merge Sort, and their friend, the Quick Sort.

There are several options when sorting data, and depending on the data set, some are better than others. Once I came across the sorting code, For no other reason than wanting to, I strayed from my task and converted them to AL for Microsoft Dynamics 365 Business Central.

Bubble Sort

One such sorting algorithm is called Bubble Sort. It’s a basic comparison-based method that gets its name from how smaller or larger elements “bubble” to the top of the list. With a Bubble Sort, start at the beginning of the list and compare the first element to the second. If the first element is greater than the second, swap their positions. If not, leave them as they are. Move one position to the right and compare the second and third elements. Continue this process for each pair of adjacent numbers until the end of the list is reached. It’s important to note that Bubble Sort is not very efficient, especially for large lists.

    procedure BubbleSort(List: List of [Integer])
    var
        i, j : Integer;
        ListItem: Integer;
    begin
        for i := 1 to List.Count do begin
            for j := 1 to List.Count - 1 do begin
                if List.Get(i) < List.Get(j) then begin
                    ListItem := List.Get(i);
                    List.Set(i, List.Get(j));
                    List.Set(j, ListItem);
                end;
            end;
        end;
    end;

Merge Sort

Another option, if you need to sort data, is Merge Sort. This type of comparison-based sorting algorithm is effective for most practical data sets, especially on larger lists. The strategy is to divide and conquer. The data set is split in half continuously until each set contains only one element, which is considered a sorted list. Then, the adjacent lists are merged back together while maintaining sorted order. This is done by comparing the first elements of each list and adding the smaller one to the new list, then moving on to the next element in the list from which the element was taken. The process is repeated until all the elements have been merged back into a single sorted list. Compared to Bubble Sort, Merge Sort is more efficient.

    procedure MergeSort(List: List of [Integer])
    begin
        MergeSort(List, 1, List.Count);
    end;

    local procedure Merge(List: List of [Integer]; Left: Integer; Middle: Integer; Right: Integer)
    var
        i, j, k : Integer;
        LeftList: List of [Integer];
        RightList: List of [Integer];
    begin
        for i := Left to Middle do begin
            LeftList.Add(List.Get(i));
        end;
        for i := Middle + 1 to Right do begin
            RightList.Add(List.Get(i));
        end;

        i := 1;
        j := 1;
        k := Left;

        while (i <= LeftList.Count) and (j <= RightList.Count) do begin
            if LeftList.Get(i) <= RightList.Get(j) then begin
                List.Set(k, LeftList.Get(i));
                i := i + 1;
            end else begin
                List.Set(k, RightList.Get(j));
                j := j + 1;
            end;
            k := k + 1;
        end;

        while i <= LeftList.Count do begin
            List.Set(k, LeftList.Get(i));
            i := i + 1;
            k := k + 1;
        end;

        while j <= RightList.Count do begin
            List.Set(k, RightList.Get(j));
            j := j + 1;
            k := k + 1;
        end;
    end;

    local procedure MergeSort(List: List of [Integer]; Left: Integer; Right: Integer)
    var
        Middle: Integer;
    begin
        if Left < Right then begin
            Middle := (Left + Right) div 2;
            MergeSort(List, Left, Middle);
            MergeSort(List, Middle + 1, Right);
            Merge(List, Left, Middle, Right);
        end;
    end;

Quick Sort

Quicksort is another efficient and commonly used sorting algorithm that uses a divide-and-conquer approach. It’s widely used due to its efficiency and ease of implementation. The first step in the Quicksort algorithm is to choose a pivot. The pivot can be any element from the array, but one commonly chooses the first, last, or middle elements. The role of the pivot is to assist in splitting the array. Next, rearrange the array elements so that all elements less than or equal to the pivot come before (to the left of) the pivot and all elements greater than the pivot come after (to the right of) the pivot. At this point, the pivot is in its final position in the sorted array.

    procedure QuickSort(List: List of [Integer])
    var
        i: Integer;
    begin
        QuickSort(List, 1, List.Count);
    end;

    local procedure Partition(List: List of [Integer]; Left: Integer; Right: Integer): Integer
    var
        i, j : Integer;
        Pivot: Integer;
    begin
        Pivot := List.Get(Right);
        i := Left - 1;
        for j := Left to Right - 1 do begin
            if List.Get(j) <= Pivot then begin
                i := i + 1;
                Swap(List, i, j);
            end;
        end;
        Swap(List, i + 1, Right);
        exit(i + 1);
    end;

    local procedure QuickSort(List: List of [Integer]; Left: Integer; Right: Integer)
    var
        Pivot: Integer;
    begin
        if Left < Right then begin
            Pivot := Partition(List, Left, Right);
            QuickSort(List, Left, Pivot - 1);
            QuickSort(List, Pivot + 1, Right);
        end;
    end;

    local procedure Swap(List: List of [Integer]; i: Integer; j: Integer)
    var
        ListItem: Integer;
    begin
        ListItem := List.Get(i);
        List.Set(i, List.Get(j));
        List.Set(j, ListItem);

    end;

Note: The code and information discussed in this article are for informational and demonstration purposes only. This content was created referencing Microsoft Dynamics 365 Business Central 2023 Wave 1 online.

Real things I’m asked – Microsoft Dynamics 365 Business How to Import a Budget?

Q. What is the process for importing G/L Budgets into Business Central?

A. A General Ledger (G/L) budget in Business Central is a financial plan that outlines projected income and expenses for a given period, typically the fiscal year. The Budget generally includes all company revenue, expense, capital, and indirect costs.
Microsoft Dynamics 365 Business Central supports multiple budgets, which can be as detailed or general as desired and created for different scenarios. For example, you could create a detailed budget for certain departments, certain kinds of revenue or expense, or a general budget for the entire business.
By creating budgets, you can plan your business’s finances based on your projections and compare actual and budgeted amounts.
Those responsible for the financial budgets may often want to work on them outside the ERP application and import them when completed. With Microsoft Dynamics Business Central, you can easily Import and Export your Budgets to/from Excel.

To Import a Budget into Business Central:

  1. Search for G/L Budgets using the Search feature within Business Central.
  2. Choose the related G/L Budgets Lists link in the pages and task section of the results.
  3. Select an existing Budget (or create a new one), then select the Edit Budget Action.
  4. Select the Export to Excel action in the menu bar and enter the desired export options.
  5. Edit the exported Excel Budget document and save the changes.
  6. Select the Import from Excel action in the menu bar and enter the desired import options.
  7. Click Ok
  8. Select the updated budget file to import.
  9. Follow the prompts within Business Central to update your Budget.

Note: The code and information discussed in this article are for informational and demonstration purposes only. This content was created referencing Microsoft Dynamics 365 Business Central 2023 Wave 1 online.

July 2023 Cumulative Updates for Dynamics 365 Business Central

The July updates for Microsoft Dynamics 365 Business Central are now available.

Before applying the updates, you should confirm that your implementation is ready for the upgrade and ensure compatibility with your modifications. Work with a Microsoft Partner to determine if you are ready and what is needed for you to apply the update.

Please note that Online customers will automatically be upgraded to version 22.3 over the coming days/weeks and should receive an email notification when upgraded.

Direct links to the cumulative updates are listed here:

Dynamics 365 Business Central On-Premises 2023 Release Wave 1 Updates – 22.3 (July 2023)

Dynamics 365 Business Central On-Premises 2022 Release Wave 2 Updates – Update 21.9 (July 2023)

Dynamics 365 Business Central On-Premises 2022 Release Wave 1 Updates – Update 20.15 (July 2023)

Dynamics 365 Business Central On-Premises 2021 Release Wave 2 Updates – Update 19.18 (April 2023)

Dynamics 365 Business Central On-Premises 2021 Release Wave 1 Updates – Update 18.18 (October 2022)

Dynamics 365 Business Central On-Premises 2020 Release Wave 2 Updates – Update 17.17 (April 2022)

Dynamics 365 Business Central On-Premises 2020 Release Wave 1 Updates – Update 16.19 (January 2022)

Dynamics 365 Business Central On-Premises 2019 Release Wave 2 Updates – Update 15.17 (April 2021)

Dynamics 365 Business Central On-Premises Spring 2019 Updates – Update 49 (July 2023)

Dynamics 365 Business Central On-Premises October’18 Updates – Update 18 (April 2020)

Microsoft Dynamics NAV 2018 – Update 60 (January 2023)

Microsoft Dynamics NAV 2017 – Update Update 61 (January 2022)

Microsoft Dynamics NAV 2016 – Update 67 (July 2021)