Monthly Archives: October 2020

Partial Records

Partial Records are a new capability of Business Central introduced in Business Central 2020 release wave 2. It allows specifying fields that should be loaded when accessing SQL based data.

How does it work? Without using partial records, Business Central normally load all data from the record even if only one of them is required. The partial records, developer specify which fields are needed and the Business Central than load only that fields.

This is especially (based on Microsoft notes) important when Tableextensions are used. In that case, each Tableextension is stored as a separate table on the SQL server and, when the data from this table are loaded, SQL server joins the primary table, extension table (and other extension tables if exist) using join. Although the join is done using primary keys, the query is still much more performance-intensive than the query that accesses only one table.

Related Functions

There are four related functions:

  • [Ok := ] Record.SetLoadFields([Fields: Any,…])
    • Using the function SetLoadFields we specify a set of fields that server should load from the database. Fields have to be specified before the record is retrieved from the database (similar as SetAutoCalcFields()).
    • If the function is called more than once, only fields specified within the last call are loaded.
  • [Ok := ] Record.AddLoadFields([Fields: Any,…])
    • Similar function to SetLoadFields that has one big difference: if the function is called multiple times, the new call does not reset fields that were already set (even if they were set using SetLoadFields).
  • Ok := Record.AreFieldsLoaded(Fields: Any,…)
    • Checks whether the fields specified as parameters are already retrieved from the database.
  • [Ok := ] Record.LoadFields(Fields: Any,…)
    • This function allows loading data from the data source that was not loaded when the last partial record was retrieved (because the field was not specified using SetLoadFields nor AddLoadFields).

More specifically

In the first part, I wrote that only specified fields are loaded when the row is fetched from the database; however, if the fields were not loaded (using SetLoadFields / AddLoadFields) and system needs their value, they are automatically fetched using Just-In-Time (JIT) mechanism.

When JIT loading occurs, the system automatically loads data using the primary keys of the current record. This fetch might fail if the record was changed (modified / renamed / deleted) since the original data was retrieved. And that is the reason why the function LoadFields exists – when JIT loading occurs automatically, there is no way how to resolve if the loading fails. With LoadFields developers can implement explicit error handling for these fails.


The example below is from Microsoft Docs and shows how to use SetLoadFields. As is mentioned on the Docs, in this case, the example is nine times faster than the same code without the Partial Records functionality.

 procedure ComputeArithmeticMean(): Decimal;
     Item: Record Item;
     SumTotal: Decimal;
     Counter: Integer;
     Item.SetLoadFields(Item."Standard Cost");
     if Item.FindSet() then begin
             SumTotal += Item."Standard Cost";
             Counter += 1;
         until Item.Next() = 0;
         exit(SumTotal / Counter);

Microsoft example

As this is a very different approach to developing custom functionalities, I will definitely check the performance with some advance example codes in some of the next articles.

UI enhancements in Microsoft Dynamics 365 Business Central 2020 Wave 2

Dynamics 365 has come out with a comprehensive plan for the release of business central 2020 wave 2. In this article I will focus on updates to page styling, more responsive FactBoxes, and an upgraded dialog bar for a seamless service and optimized productivity.

Page styling updates

You can’t have any new features brought in without a fresh new style that enhances the experience altogether. That’s what Microsoft did when they introduced Wave 2, with beautiful and sleek changes to task dialogs, embedded lists, and stylistic appearances. Task dialogs will now be more focused on completing current tasks, with a display in specific commands and an easier way to exit the dialog. They can also now be shown in the middle of the screen, actions will be represented below the page caption, and consistent results when trying to maximize any task dialog either vertically or horizontally will be applied.

Other stylistic changes include an improved space for the embedded lists, showing off how lists parts will stretch to fill the available space when inside a group, or how pages with multiple list parts will no longer waste space by being split into nested groups. Not to mention, minor details like font adjustments and font sizing have been made, with the Bahnschrift font being removed.

A more responsive FactBox

FactBoxes have been super important in some of what Microsoft offers, which is why their upgrade in the business central 2020 wave 2 has been so important. Not only are they easier to view, but their interaction has also overall been optimized for a number of features. This allows FactBox to run smoother on the page, now being loaded to give priority to show the main content of that page.

Content for the hosted page will now be displayed first, which will then be followed by any FactBoxes in order on how they are shown on the page. FactBoxes can also continue to run within the same session, but can also be changed by a developer so that the FactBox is explicitly implemented as a page background task. Last but not least, FactBoxes can be collapsed and won’t run on the opening page unless the FactBox pane is expanded.

An improved navigation experience terminology

One of the key updates to modern clients in the business central application provides and clear and concise list of features that help with training, onboarding, and day-to-day work. The updated features in the navigation experience include minor but impactful changes likes the non-promoted group being renamed to ‘unrelated’ and the group called report has now been changed to ‘reports’. The action that was previously shown as Navigate is now changed to ‘find entries’ and has now gained a keyboard shortcut to find it faster.

Although you may think this may have been a lot to read, this was just the tip of the iceberg when it comes to the latest news surrounding the Business Central 2020 Wave 2.

Current status of AL Code Analyzers

With the last update of Analyzers Rules, there are some new issues with warnings. This is not a comprehensive list of all bugs but contains information about problems that I found on projects that I am working on / managing.

General Analyzer Rules

  • AL0604 (for Runtimes under 6.0)
    • DESCRIPTION: Use of implicit with
    • AL TEXT: Use of implicit ‘with’ will be removed in the future. Qualify with ‘Rec.’. This warning will become an error in a future release.
    • CURRENT PROBLEM: This warning should be shown (together with linked quick fix) only for Runtime >= 6. For Runtimes below this, some required functionality (like Editable/Enable = Rec.”Field Name”) is not supported.
    • LINKS:

CodeCop Analyzer Rules

  • AA0072
    • DESCRIPTION: The name of variables and parameters must be suffixed with the type or object name.
    • AL TEXT: The name of {0} is not valid. The name of variables and parameters must be suffixed with the type or object name.
    • CURRENT PROBLEM: This rule is still under discussion on AL GIT due to some unexpected/strange behaviour. The most discussed issues are: Whether the company prefix/suffix of the object should be mandatory in variables names; Whether reserved words should be avoided; That subscribers parameters should not be check (as it’s not a problem of subscriber but of published); …
    • LINKS:
  • AA0150
    • DESCRIPTION: Do not declare parameters by reference if their values are never changed.
    • AL TEXT: Parameter ‘{0}’ is declared by reference but never changed in method ‘{1}’.
    • CURRENT PROBLEM: The rule checks parameters in Codeunits that implements interfaces with methods that contain reference parameters. This should not be check.
    • LINKS:
  • AA0232
    • DESCRIPTION: The FlowField of a table should be indexed.
    • AL TEXT: The FlowField {0} of {1} should be added to the SIFT key.
    • CURRENT PROBLEM: The rule does not respect field type and suggests adding SIFT index on non-numeric fields (like date, datetime, …).
    • LINKS:
  • AA0240
    • DESCRIPTION: Email and Phone No must not be present in any part of the source code.
    • AL TEXT: The {0} ‘{1}’ must not contain email addresses or phone numbers.
    • CURRENT PROBLEM: This rule currently checks translation files and evaluate some field (or other) IDs of an object as a phone number.
    • LINKS:

CU 2020/10 for Microsoft Dynamics NAV 2016 – 2018 and Microsoft Dynamics 365 Business Central on-premises has been released

The cumulative update 2020/10 for Microsoft Dynamics NAV 2016, NAV 2017, NAV2018 and for Microsoft Dynamics 365 Business Central (2019 wave 1, 2019 wave 2, 2020 wave 1) on-premises has just been released.

Microsoft Dynamics NAV 2016/CU60DownloadDocumentation
Microsoft Dynamics NAV 2017/CU47DownloadDocumentation
Microsoft Dynamics NAV 2018/CU34DownloadDocumentation
Microsoft Dynamics 365 Business Central Spring 2019 on-premises/CU17DownloadDocumentation
Microsoft Dynamics 365 Business Central 2019 Wave 2 on-premises/U15.11DownloadDocumentation
Microsoft Dynamics 365 Business Central 2020 Wave 1 on-premises/U16.6DownloadDocumentation

Microsoft Dynamics 365 Business Central 2020 Wave 2 has been released!

The new version of Microsoft Dynamics 365 Business Central has just been released! Version is called 2020 Wave 2 and its internal number is 17.0.

I already described some of the most anticipated functions, and I probably describe some other in the upcoming weeks. However, the full list of major changes can be found directly on Microsoft Docs.