April 2023 Cumulative Updates for Dynamics 365 Business Central and Microsoft Dynamics NAV

The April updates for Microsoft Dynamics NAV and 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 Dynamics 365 Business Central 2023 Wave 1 (Version 22.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 1 – 22.0 (April 2023)

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

Dynamics 365 Business Central On-Premises 2022 Release Wave 1 Updates – Update 20.12 (April 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 46 (April 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)

Permanent link to this article: https://www.dvlprlife.com/2023/04/april-2023-cumulative-updates-for-dynamics-365-business-central-and-microsoft-dynamics-nav/

Dynamics 365 Business Central – AL: Publish full dependency tree for active project

Dynamics 365 Business Central 2022 Wave 1 introduced a feature for working with workspaces and dependencies. Developers using runtime version 9.0 or higher can use the exciting feature Publish full dependency tree for active project.

The AL: Publish full dependency tree for active project command will traverse a project dependency graph in the workspace and install any required projects if these aren’t already deployed. The command will calculate the correct order in which to compile and publish the dependencies of the current project and publish them using the launch.json option selected from the currently active project.

Only project and application references within the scope of the workspace will be traversed. In cases where the deployed AL project has dependencies on applications not within the current workspace, they must be installed and deployed beforehand.

How does this work? For example, I have a workspace containing four apps – App1, App2, App3, and App4. For those apps, App2 and App3 depend on App1, and App4 depends on App3. Previously, the apps had to be manually deployed in a hierarchical order to ensure the dependency was installed before the app that references it.

The full dependency tree is automatically discovered and published:

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

Permanent link to this article: https://www.dvlprlife.com/2023/04/dynamics-365-business-central-al-publish-full-dependency-tree-for-active-project/

Real things I’m asked – Microsoft Dynamics 365 Business Central Posting Date is not within your range of allowed posting dates


I am asked many questions about Business Central on any given day. The questions vary and cover various topics, from development to administration to integration to general application use, to name a few. I want to post them all, but that is not feasible; From time to time, I pick one to write about.

Q. A user received the error “Posting Date is not within your range of allowed posting dates.” How do I set a user’s posting date range of allowed?

A. In Microsoft Dynamics 365 Business Central, the posting date range defines the valid period for financial transactions to be posted in the general ledger.

Usually, the posting date range is set for a fiscal year or accounting period, but it can also be a specific time frame that suits an organization’s needs.

During the posting process of a financial transaction, the procedure IsPostingDateValidWithSetup, found in “User Setup Management,” checks to confirm that a posting date is within the range of the user’s posting date range.

With a quick look at the code for checking the date, I know you wanted to see it. We can see if a User Setup record exists with a date range, then the posting date must fall within that range. If there isn’t a User Setup record, with a date range, for the user, then the date range found on the General Ledger Setup is used.


procedure IsPostingDateValidWithSetup(PostingDate: Date; var SetupRecordID: RecordID) Result: Boolean
var
    UserSetup: Record "User Setup";
    AllowPostingFrom: Date;
    AllowPostingTo: Date;
    IsHandled: Boolean;
begin
    OnBeforeIsPostingDateValidWithSetup(PostingDate, Result, IsHandled, SetupRecordID);
    if IsHandled then
        exit(Result);

    if UserId <> '' then
        if UserSetup.Get(UserId) then begin
            UserSetup.CheckAllowedPostingDates(1);
            AllowPostingFrom := UserSetup."Allow Posting From";
            AllowPostingTo := UserSetup."Allow Posting To";
            SetupRecordID := UserSetup.RecordId;
        end;
    if (AllowPostingFrom = 0D) and (AllowPostingTo = 0D) then begin
        GLSetup.GetRecordOnce();
        GLSetup.CheckAllowedPostingDates(1);
        AllowPostingFrom := GLSetup."Allow Posting From";
        AllowPostingTo := GLSetup."Allow Posting To";
        SetupRecordID := GLSetup.RecordId;
    end;
    if AllowPostingTo = 0D then
        AllowPostingTo := DMY2Date(31, 12, 9999);
    exit(PostingDate in [AllowPostingFrom .. AllowPostingTo]);
end;

If you’d like to specify a Posting Date range for a specific user, create (or modify if it exists) a User Setup and populate the “Allow Posting From” and/or the “Allow Posting To” value. Note: If you fill in only one of the values, then that end of the range has no limit.

To set the Posting Date range for those that do not have a User Setup date range defined, populate the “Allow Posting From” and/or the “Allow Posting To” on the General Ledger Setup. Note: As with the User Setup range, if you fill in only one of the values, then that end of the range has no limit.

Permanent link to this article: https://www.dvlprlife.com/2023/04/real-things-im-asked-microsoft-dynamics-365-business-central-posting-date-is-not-within-your-range-of-allowed-posting-dates/

Microsoft Dynamics 3655 Business Central – Create a New Company

A company in Microsoft Dynamics 365 Business Central refers to an independent entity that conducts business operations and financial transactions. It can be a legal entity, such as a corporation, limited liability company (LLC), or an operational entity within a larger organization.

In Microsoft Dynamics 365 Business Central, a company is set up as a separate entity with its chart of accounts, general ledger, and other financial and operational settings. It can have its customers, vendors, items, and other master data specific to its operations.

Microsoft Dynamics 365 Business Central allows you to manage multiple companies within a single environment, enabling you to consolidate financial data and perform intercompany transactions. Note: You can switch between companies through My Settings or the environment designator.

A new company is added to Business Central through the assisted setup for creating a company.

  1. Search for Companies using the “Tell Me” Search within Microsoft Dynamics 365 Business Central.
  2. Select Companies List Page
  3. On the Companies Page, select the Create New Company action item from the New Menu in the Action Bar
  4. Walk through the steps of the assisted setup for creating a company
  5. Enter a name for the company and select the data used to get started with your new company.
    Evaluation – Sample Data
    Essential Experience / Cronus Company Sample Data / Setup Data
    Create a company with the Essential functionality scope containing everything you need to evaluate the product for companies with standard processes. For example, sample invoices and ledger entries allow you to view charts and reports. You can use the company to try out the product for as long as you want. You can  install the Contoso Coffee Demo Data app on top of the default sample data for various manufacturing demonstration scenarios. 
    Production – Setup Data
    Only Essential Experience / Setup Data Only
    Create a company with the Essential functionality scope containing data and setup, such as a chart of accounts and payment methods ready for use by companies with standard processes. Set up your items and customers, and start posting right away. You will be able to use this company for a 30-day trial period.
    Create New – No Data
    Any Experience / No Sample Data / No Setup Data
    Create a company with the desired experience for companies with any process complexity, and set it up manually. You will be able to use this company for a 30-day trial period.
  6. Manage users of the new company Add users to or remove users from the new company.
  7. Finish the assisted setup to create your new company

Your new company may take a few minutes to initialize. Once initialization is complete, you can switch to your new company to being processing data.

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

Permanent link to this article: https://www.dvlprlife.com/2023/03/microsoft-dynamics-3655-business-central-create-a-new-company/

Real things I’m asked – Microsoft Dynamics 365 Business Central Copy Company Data to a New Company

Q. How do I copy data from one Business Central company to another?

A. Microsoft Dynamics 365 Business Central offers a couple of options to copy data from one company to another.

Copy Company

One option creates a complete copy of a company into a new company in the same environment. 

  1. Search for Companies using the “Tell Me” Search within Microsoft Dynamics 365 Business Central.
  2. Select Companies List Page
  3. On the Companies Page, select the company you want to copy into a new one.
  4. Select the Copy Menu Item from the Action Bar
  5. Enter the New Company Name on the Copy Company Dialog.
  6. Read the IMPORTANT note about copying a company and performance. Confirm the “I understand” button if you are comfortable proceeding.
  7. Click Ok
  8. When the copy company action is complete, a confirmation dialog will appear.

Configuration Worksheet

A second option, which allows for a more selective way to copy data,  is to use a Configuration Worksheet.

  1. Switch to the company that you would like to copy data into from another company in the environment.
  2. Search for Configuration Worksheet using the “Tell Me” Search within Microsoft Dynamics 365 Business Central.
  3. Select the Configuration Worksheet Task
  4. On the Configuration Worksheet, enter the tables from which you want to copy data into the current company. You can manually enter the tables or use the Get Tables menu action from the Prepare Action Bar item for more options to add multiple tables.
  5. Select the “Copy Data from Company” menu item from the Prepare Actions menu.
  6. On the Copy Company Data Page, select the tables that you would like to copy data from and select the Copy Data action item.
    Note: Data can only be copied from a source table that has records into a destination table that does not have records
  7. Click Yes to copy the data for the selected tables

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

Permanent link to this article: https://www.dvlprlife.com/2023/03/real-things-im-asked-microsoft-dynamics-365-business-central-copy-company-data-to-a-new-company/

Real things I’m asked – Business Central hide the warning when you close a document that you have not posted

Q: How do I hide the warning that I have not posted a sales document when closing it?

A. You may have seen the warning and been annoyed with it. The nuisance dialog appears and asks to confirm that you want to close an order that has not been posted – 

The document has been saved but is yet posted. Are you sure you want to exit? 

Great feature?!? I say No.

That pesky warning message is managed by the “Warn about posted documents” setting on the My Notifications Page. The warning can be disabled entirely or configured to display for specific document types by specifying a condition.

While it’s open, look at some of the other notification settings.

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

Permanent link to this article: https://www.dvlprlife.com/2023/03/real-things-im-asked-business-central-hide-the-warning-when-you-close-a-document-that-you-have-not-posted/

March 2023 Cumulative Updates for Dynamics 365 Business Central and Microsoft Dynamics NAV

The March updates for Microsoft Dynamics NAV and 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 21.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 2022 Release Wave 2 Updates – Update 21.5 (March 2023)

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

Dynamics 365 Business Central On-Premises 2021 Release Wave 2 Updates – Update 19.17 (March 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 45 (March 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)

Permanent link to this article: https://www.dvlprlife.com/2023/03/march-2023-cumulative-updates-for-dynamics-365-business-central-and-microsoft-dynamics-nav/

Dynamics 365 Business Central 2023 Wave 1 – Attach AL debugger to active session or next session

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 1 has several exciting Development features for runtime 11.0. One of the exciting features is to Attach AL debugger to active session or next session.

In any development environment, debugging is one part of the development lifecycle. Developing in AL for Microsoft Dynamics 365 Business Central is no different.

What is debugging?

Debugging is finding and resolving errors or defects within a computer program. Debugging aims to identify and fix bugs, which are issues or problems that prevent the program from functioning as intended. Debugging is an essential part of the software development process, as it ensures that the program is working correctly and meets the requirements of the end users.

Debugging can involve various techniques and tools, including step-by-step execution, logging, tracing, and testing. Developers use debugging tools such as debuggers, profilers, and log analyzers to help identify and resolve issues within the code. They may also use code review and collaboration tools to help identify and resolve problems.

Debugging helps the program runs efficiently, accurately, and as intended. By carefully identifying and fixing bugs, developers can improve the quality and reliability of their software.

Debugging Microsoft Dynamics 365 Business Central

AL Developers can debug code execution in Business Central by attaching a session to a specified server and awaiting a process to trigger your set breakpoint or the trigger of an error. Then debugging starts when the code on which the breakpoint is executed or a statement generates an error.

To activate the attach functionality, you need to create a new configuration in the launch.json file. This configuration comes in two flavors: Attach to the next client on the cloud sandbox and Attach to the next client on your server. If you want to attach to a cloud session, use the first option; if you’re going to attach to a local server, use the second option.

In the attach configuration, the breakOnNext setting specifies the next client to break on when the debugging session starts and allows only one option. The available options are: WebServiceClient, WebClient, and Background. The example below illustrates a configuration for a local server.

New Debugging Microsoft Dynamics 365 Business Central 2023 Wave 1

Starting with Microsoft Dynamics 365 Business Central 2023 Wave 1, two new settings, userId, and sessionID, were added to the launch.json configuration allowing you to specify a session ID to attach to an existing session or a user ID to attach to the next session for that user. These new settings allow the standard AL debugger to connect to a currently running session or the next session for the specific user.

Read more about the feature Attach AL debugger to active session or next session here.

Read more about debugging in AL for Microsoft Dynamics 365 Business Central here.

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

Permanent link to this article: https://www.dvlprlife.com/2023/03/dynamics-365-business-central-2023-wave-1-attach-al-debugger-to-active-session-or-next-session/

Dynamics 365 Business Central 2023 Wave 1 – Provide Title and custom actions to Error dialogs

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 1 has several exciting Development features for runtime 11.0. One of the exciting features is to Provide Title and custom actions to Error dialogs.

To assist users in better dealing with errors encountered while using Microsoft Dynamics 365 Business Central, a new feature was added that enables developers to allow users to select an appropriate corrective action when an error occurs. Improving the clarity of error messages is essential in instilling confidence in Business Central while streamlining the process of correcting common problems.

Now, developers can enhance issue descriptions by setting the Title property on Error dialogs presented to the user. Moreover, by utilizing the ErrorInfo object, developers can include up to three customized actions on the Error dialog to provide corrective measures to the user. This can be accomplished by invoking the AddAction method on the ErrorInfo object, which can be transmitted to AL methods that support ErrorInfo, including Error, TestField, FieldError, and other methods. The ErrorInfo object also has a number of properties that enhance the Telemetry information.

codeunit 50100 "DVLPR Error Management"
{
    var
        ErrorActionMsg: Label 'Action %1 for %2.\Let''s handle it', Comment = '%1 Action Number %2 Action Message';

    procedure ErrorAction1(ErrorInfo: ErrorInfo)

    begin
        Message(ErrorActionMsg, '1', ErrorInfo.Title);
    end;

    procedure ErrorAction2(ErrorInfo: ErrorInfo)
    begin
        Message(ErrorActionMsg, '2', ErrorInfo.Title);
    end;
}
pageextension 50100 "DVLPR Customer List Ext" extends "Customer List"
{
    actions
    {
        addlast("&Customer")
        {
            action(DVLPRError)
            {
                ApplicationArea = Basic, Suite;
                Caption = 'Error Demo';
                Image = Error;
                ToolTip = 'Demonstration Error Add Action';

                trigger OnAction()
                var
                    ErrorInfo: ErrorInfo;
                begin
                    ErrorInfo.Title := 'DVLPR Error Demonstration';
                    ErrorInfo.ErrorType := ErrorType::Client;
                    ErrorInfo.Verbosity := Verbosity::Error;
                    ErrorInfo.DataClassification := DataClassification::CustomerContent;
                    ErrorInfo.Message := 'This is a error! What would you like to do?';
                    ErrorInfo.AddAction('Action 1', Codeunit::"DVLPR Error Management", 'ErrorAction1');
                    ErrorInfo.AddAction('Action 2', Codeunit::"DVLPR Error Management", 'ErrorAction2');

                    Error(ErrorInfo);
                end;
            }
        }
    }
}

The AddAction method accepts three parameters:

  • Caption: The text string that appears as the caption of the action in the error UI.
  • CodeunitID: The ID of the Codeunit to run when the action is initiated from the error UI. The codeunit should contain at least one global method to be called by the error action. The global method must have an ErrorInfo data type parameter for accepting the ErrorInfo object.
  • Method Name: The name of the method in the Codeunit, which is specified by the CodeunitID parameter, that you want to run for the action.

Read more about the feature Provide Title and custom actions to Error dialogs here.

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

Permanent link to this article: https://www.dvlprlife.com/2023/03/dynamics-365-business-central-2023-wave-1-provide-title-and-custom-actions-to-error-dialogs/

Dynamics 365 Business Central 2023 Wave 1 – Set up and sync master data across companies

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 1 has several exciting Application features for runtime 11.0. One of the exciting features is to Set up and sync master data across companies.

With Microsoft Dynamics 365 Business Central, transferring a company’s setup to another company within the same environment is straightforward. Additionally, you can synchronize the master data between the companies. The master data management feature allows you to transfer the setup from one company to another within the same environment. Furthermore, it serves as a data synchronization engine, ensuring that the companies’ data remains synchronized after the initial transfer.

The Master Data Management Setup page is where you can activate the master data management feature and access synchronization tables and logs to trigger synchronizations.

Set Up Master Data Synchronization

  • Open Business Central in a company that you would like to synchronize with a master company
  • Search for Master Data Management Setup
  • Select the Master Data Management Setup Administration Task from the search result list.
  • On the Master Data Management Setup Page, select the Source Company for Master Data that will be synchronized and set the Enable Data Synchronization value.
  • When you enable synchronization, a message will be displayed explaining the steps needed to finish the setup of the Master Data Synchronization.
  • Select the Synchronization Tables Action from the Action bar to open the Synchronization Tables page, where you enable the tables and filters for the master records to synchronize from the source company.
  • Once the master data tables and filters are defined, select the action to open the Master Data Initial Synchronization page and click the Start All action from the menu. The Master Data Initial Synchronization will show the status of the initial data synchronization. Note: You may need to adjust the data coupling in Synchronization Mode for some tables
  • After the initial synchronization, the master data is synchronized using Job Queues.

Master data is synchronized when a company subscribes to data from another company. You can specify the tables, table filters, and fields that require synchronization. Advanced synchronization coupling can also be set up. The job queue ensures that changes to the primary company are immediately transferred to the receiving companies. Users in the receiving company can review the synchronization logs.

Read more about the feature Set up and sync master data across companies 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 1 online.

Permanent link to this article: https://www.dvlprlife.com/2023/03/dynamics-365-business-central-2023-wave-1-set-up-and-sync-master-data-across-companies/