August 2022 Cumulative Updates for Dynamics 365 Business Central and Microsoft Dynamics NAV

The August 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 SaaS customers will automatically be upgraded to 20.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 2022 Release Wave 1 Updates – Update 20.4 (August 2022)

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

Dynamics 365 Business Central On-Premises 2021 Release Wave 1 Updates – Update 18.16 (August 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.17 (October 2021)

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 38 (August 2022)

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

Microsoft Dynamics NAV 2018 – Update 55 (August 2022)

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

Microsoft Dynamics NAV 2016 – Update 67 (July 2021)

Dynamics 365 Business Central: Yes you can merge Customers, Vendors and Contacts

As users enter data through normal business processing, a byproduct of data migrations or consolidations, there are often instances where there is more than one master record for a customer, vendor, or contact.

Having multiple references to the same entity can be challenging to manage their orders, invoices, payments, and interactions. In earlier versions of Business Central, this presented challenges. I was excited to see the Application update for merging customers, vendors, and contacts listed on the April 2019 release notes for Microsoft Dynamics 365 Business Central. Before the feature to merge customers, vendors, and contacts within Business Central, I had been asked countless times over the years to provide an option for the merge. Fast forward, and the feature is still valuable and improved.

To merge customers (the same process is followed for vendors and contracts):

  1. Search for “Customers” using the “Tell Me” action in the App Bar and click the “Customers” list link.
  2. Select the Customer that is as a duplicate and open the “Customer Card”.
  3. Select the Actions-> Functions -> Merge from the action bar.
  4. Enter the Customer No. of the customer that you would like to merge with the selected Customer.
  5. After to select the Customer to merge, the Fields FastTab will list the fields that are different. For each of the fields that you would like to use the value on from the “Merge” With customer, select the Override checkbox.
  6. After you select the fields to Override, Select the Merge action from the action bar
  7. The Related Tables FastTab displays the where there is a field relation for the two records and lists the conflict count. If there are conflicts, you will need to resolve them before completing the merge.
  8. Select the Conflicts and the Merge Duplicate Conflicts page will display.
  9. Select the Conflict, then Select the “View Details” action to open the Merge Duplicate page and see the details of the Conflict
  10. If you do not wish to keep the Duplicate record, select the “Remove Duplicate” action.
  11. If you wish to keep the Duplicate, change the value in the “Alternate Value” field for the conflict and select the “Rename Duplicate” action. Similar to the Merge action you can choose the field values to override during the rename.
  12. Repeat steps 9-11 until all of the conflicts have been resolved
  13.  On the “Merge Duplicate” Page select the Merge action again and click Yes to complete the merge.

It is important to note that once you complete a merge, it cannot be undone.

For more information visit Merge Duplicate Records

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

Dynamics 365 Business Central: Do more with Customer and Vendor Templates

Setting up master data in Microsoft Dynamics 365 Business Central becomes easier when you use Templates. You can use templates to assist with entering customer, vendor, item, or employee data. Using Templates in Business Central allows you to specify field values for a specific group of master data. When entering master data, you select the Template to apply, and the field values specified in the Template populate the record. It is helpful when you have groups of master data that share or require specific values.

To create a new Customer Template (you can use the same process for Vendors, Employees, and Items):

  1. Search for “Customer Template” using the “Tell Me” action in the App Bar and click the “Customer Templates” link.
  2. Select the New Action
  3. Enter the name of the Template in the Code field, and the Template description in the Description field
  4. Expand the FastTabs and populate the fields that you would like to have a defined value when applying the Template to a master record
  5. If the Template should assign Default Dimensions to the master record, select the Dimensions Action and assign the values
  6. Close the Template when done, and the Template is ready to use

Note: You can use the Copy Template Action to copy the values from another Template to your new Template

When creating a new Customer, select one of the Customer Templates to apply, and the Template values populate the record.

You have now Mastered your Template!

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

It’s Friday! – July 29

Pragma and Rulesets let you make or break the rules.

The AL Language extension (the language for developing applications for Microsoft Dynamics 365 Business Central) contains fourcode analyzers for analysis of your code at build time. “Code violations” are displayed in the Problem window when the code is analyzed. The information is valuable for identifying and jumping to Code Analysis Tool rule violations.

Now that you potentially have a list of “violations,” what if you want to treat them differently or even ignore them? Within the AL language, a few ways to control code analysis exist.

The al.codeAnalyzers setting allows you to specify which code analyzers are active for a particular environment, workspace or project. Code Analysis enforcement is only for the analyzers listed, leaving the option to only include the analyzers you want to enforce.

The al.codeAnalyzers settings identifies the code analyzers used in code analysis

Rulesets are another option for specifying how code analysis reports the issues it encounters while analyzing AL code. The name and path for the ruleset file is set with the al.ruleSetPath setting. A Ruleset file is a JSON file that contains the Rule objects that define how to report a specific rule. In a rule, you specify the id of the diagnostic, the action (None, Hidden, Warning, Error) to take when the diagnostic is encountered, and a justification comment to note the rule. A Ruleset is applied globally within the scope of the setting.

A Ruleset file is a JSON file that contains the Rule objects that define how to report a specific rule.

Another option to control Code Analysis problems is the Pragma Warning Directive. The pragma warning instruction allows you to enable or disable specific warnings in a location of code. When disabling warnings with the pragma directive, the warnings are not reset back to the original state until you restore them.

An example of using the pragma directive to disable the rule id AA0001 for one section of code and restoring it.

There are several ways to enhance Code Analysis in AL, leaving you the flexibility to manage your code. Remember that if you submit an extension to AppSource, that Code Analysis is part of the technical validation, and your Rulesets may hide issues that cause the extension to fail validation.

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

Business Central Isolated Storage: Keep Out of my Data!

Microsoft Dynamics 365 Business Central Application Developers often need to store sensitive information their application uses. In earlier Dynamics NAV versions, developers often saved this data in table fields. The table field values were accessible to any other application or user that had access to the table. Information such as API keys, user credentials, or any additional information there is a desire not to have easily accessible was often stored and easily read from the table. Thankfully there is a more suitable way to do this in Business Central – Isolated Storage.

Isolated Storage in Microsoft Dynamics 365 Business Central is data storage that isolates data between extensions and even within the Extension. An application developer can store Key-Value Pairs in Isolated Storage and define the stored data’s scope (access level). Isolated Storage Key-Pairs’ DataScope can be limited to the Extension, a specific Company, a particular User, or a specific Company and User combination, providing an easy way for a developer to save values with a limited access scope.

Isolated Storage data isolation is accessed with the IsolatedStorage Data Type. The IsolatedStorage DataType provides methods to Set, Get, Delete or check if a Key Contains a value. 

The Set Method saves a Key-Value Pair to Isolated Storage within the scope defined in the DataScope parameter. 

The Get Method retrieves the Value for a Key in the scope defined by the DataScope parameter.

The Contains Method determines if the Key has a value in the scope defined by the DataScope parameter.

The Delete Method deletes the Value of a Key in the scope defined by the DataScope parameter.

For more information, see Isolated Storage.    

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

It’s Friday! – July 22

Do Cops write tickets in AL?

The AL Language extension (the language for developing applications for Microsoft Dynamics 365 Business Central) contains four code analyzers for analysis of your code at build time.

The AppSourceCop analyzer enforces rules for extensions intended for listing in Microsoft AppSource. Whereas the CodeCop analyzer enforces AL Coding Guidelines and the UICop analyzer enforces rules for the Web Client. The PerTenantExtensionCop analyzer enforces individual tenant rules.

The al.enableCodeAnalysis setting is used to set the state of code analysis and the al.codeanalyzers setting specifies which of the code analyzers to enable.


Note: as with most settings, the al.enableCodeAnalysis and al.codeanalyzers settings may be set for a project, workspace, or development environment.

Once the code analysis is enabled and the code analyzers specified, the Rule Id and Title appear for each file,  in the Problems window of the VS Code editor for any code “violations.”

It is possible to override the behavior of the code analyzer for specific Ids via the use of Pragma and Rulesets; that is for another time.

Note: The code listed in this article is for informational and demonstration purposes only. 

Make life easier with Visual Studio Code Snippets

Snippets in Visual Studio code are templates that make it easier to enter repeatable code patterns or blocks. They’re a helpful timesaver when developing applications. I have found significant time savings within Business Central with Snippets for page and table field templates.

Visual Studio Code has several built-in Snippets, extension publishers may include Snippets, and you can also define your own.
You can see a list of the snippets by the Insert Snipper command in the command palette or by typing one of the triggers for IntelliSense.

Snippets are in JSON, and you can define the Snippet scope as global or project. Each file can contain an unlimited number of snippets.

A Snippet is a named element containing a prefix, body, and description. The prefix of the Snippet defines the trigger words used to display the Snippet in IntelliSense. The body has the actual code for the Snippet, and the description includes the text shown in IntelliSense for the Snippet.

Within the body of the Snippet, you can define TabStops, where the editor cursor will move within a Snippet. You use $1, $2, etc., to specify the cursor location, with $0 being the last TabStop.

PlaceHolders are similar to TabStops, with the addition of a default value. The syntax for a placeholder is similar to the TabStop, with the addition of the default value ${1:Value}. PlaceHolders can be nested: {$1:Value1 ${2:Value2}}

Visual Studio Code contains a range of Variables for use within the body of the Snippet. There are editor Variables for inserting file information, date/time information, and some random values. One of my favorite variables is the Clipboard’s contents with the ${CLIPBOARD}, another is the currently selected text  ${TM_SELECTED_TEXT}.

You can create your Snippet by selecting – Configure User Snippets from the settings menu and selecting either New Global Snippet or a New Project Snippet from the Command Palette. Once you have a Snippet file, you can also edit that directly.

For more information visit Snippets in Visual Studio Code

Note: The code listed in this article is for informational and demonstration purposes only. 

Business Central AL ModuleInfo

In the AL Language, the programming language behind Microsoft Dynamics 365 Business Central, the ModuleInfo Data Type provides information about an application. I have often used the ModuleInfo returned by the NavApp to check specific application version information.
The NavApp DataType includes information about a NavApp and has a few methods that retrieve a ModuleInfo for the Calling, Current or Specific application.

local procedure ModuleInfoDemo(ModuleInfoReqType: enum "DVLPR ModuleInfo ReqType");
    var
        ModuleInfo: ModuleInfo;
    begin
        case ModuleInfoReqType of
            "DVLPR ModuleInfo ReqType"::Calling:
                NavApp.GetCallerModuleInfo(ModuleInfo);
            "DVLPR ModuleInfo ReqType"::Current:
                NavApp.GetCurrentModuleInfo(ModuleInfo);
            "DVLPR ModuleInfo ReqType"::Specific:
                NavApp.GetModuleInfo('{c512d720-63b9-4b26-b062-a0c09b4ed322}', ModuleInfo);
        end;

        PopulatePageFields(ModuleInfo);
    end;

    local procedure PopulatePageFields(ModuleInfo: ModuleInfo)
    var
        i: Integer;
        ModuleDependencyInfo: ModuleDependencyInfo;
        DependencyNames: Text;
        AppVersion,
        DataVersion : Version;

    begin
        AppVersion := ModuleInfo.AppVersion;
        DataVersion := ModuleInfo.DataVersion;
        Clear(DependencyNames);

        ModuleID := Format(ModuleInfo.Id);
        ModuleName := ModuleInfo.Name;
        ModulePublisher := ModuleInfo.Publisher;
        ModuleAppVersion := Format(AppVersion);
        ModuleDataVersion := Format(DataVersion);
        ModulePackageId := Format(ModuleInfo.PackageId);

        for i := 1 to ModuleInfo.Dependencies().Count() do begin
            ModuleInfo.Dependencies.Get(i, ModuleDependencyInfo);
            DependencyNames += ModuleDependencyInfo.Name + ',';
        end;

        ModuleDependency := DependencyNames;
    end;

For more information, see ModuleInfo Data Type and NavApp Data Type 

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