Business Central 24 breaking changes

Guidelines for Partners

In the world of ERP systems, change is inevitable. With the release of Business Central 24, users and developers are poised to experience a wave of enhancements, optimizations, and, inevitably, some breaking changes. This article discusses these changes and how to deal with them. Whether old features are removed or new ones are added, understanding these shifts is important for businesses to transition to Business Central 24 seamlessly.

Here’s a breakdown of some common issues developers may encounter when upgrading to Business Central 24.

1. General Business Central 24 Breaking Changes

 

1.1 PowerShell 5 was replaced with PowerShell 7

To utilize previously used BC commands like publish, install, and import license, ensure PowerShell 7 is installed. The PowerShell 7 modules now carry the prefix Microsoft.BusinessCentral, located in the new Admin folder of the Business Central Server installation.

For users not yet on PowerShell 7, a compatibility layer module named Microsoft.Dynamics.Nav.Management.dll consolidates cmdlets/functions of all three modules into one. It’s installed alongside PowerShell 7 modules, except in the Management folder. However, note that this compatibility layer will be removed in version 26, with no new functionality added meanwhile.

Download PowerShell 7 from here.

 

1.2 .NET Core 6 replaced with .NET Core 8

The minimum system requirement for using Business Central 24 is now .NET Core 8 instead of .NET Core 6 on the server computer.

Download .NET Core 8 from here.

 

1.3 Business Foundation

The Business Foundation module in BC 24 is a new module that sits between the “System Application” and “Base Application” modules and must be placed alongside them in order to be able to publish the app. It’s designed to host a wide array of open-source modules to simplify app development, maintenance, and upgrades for both on-
premises and online deployments.

Business Central 24 breaking changes

 

 

 

 

 

 

 

 

 

 

 

 

 

A high-level representation of the new Business Central solution and the components

 

Starting from BC 24, it already includes all No. Series functionality and certain PermissionSets such as “Bus. Found. – Admin”, “Bus. Found. – Edit”, “Bus. Found. – Obj.”, “Bus. Found. – Read”, and “Bus. Found. – View”. Old objects of the moved functionalities in the Base App have been set to status “Obsolete”.

Business Foundation module will not be localised. In future releases, more various functionalities should migrate to the new Business Foundation module:

  • Accounting period management
  • Address management
  • Business unit management
  • Comment management
  • Company info management
  • Currency management
  • Dimension management
  • Location management
  • Reason code management
  • Source code management
  • Standard text management
  • UoM management

2. Business Central 24 breaking changes: Tables

 

2.1 Table 27 Item

Issue: The name ‘ShowTimelineFromItem’ does not exist in the current context.

Solution: Timeline functionality has been completely removed (Obsolete(‘This procedure is discontinued because the TimelineVisualizer control has been deprecated.’, ‘21.0’)). Remove all references.

 

2.2 Table 5400 “Unit Group”

Issue: Field ‘Code’ is removed. Reason: This field is not used. Please use GetCode procedure instead.. Tag: 24.0.

Solution: If you need to get “Code”, use GetCode() procedure. However, if you want to set it, it is not possible anymore because the field has been marked as ‘Removed’ and cannot be used anymore.

 

Issue: The field ‘Source Name’ has been removed. The reason is that this field is not used. Please use the GetSourceName procedure instead. Tag: 24.0.

Solution: If you need to get “Source Name,” use the GetSourceName() procedure. However, you cannot set it anymore because the field has been marked as ‘Removed’ and cannot be used anymore.

3. Business Central 24 breaking changes: Codeunits

 

3.1 Codeunit 80 “Sales-Post”

Issue: The event ‘OnPostSalesLineOnAfterCaseType’ is not found in the target.

Solution: Use event ‘OnPostSalesLineOnBeforePostSalesLine’ instead.

 

3.2 Codeunit 1370 “Batch Post Parameter Types”

Issue: Codeunit 1370 “Batch Post Parameter Types” is missing.

Solution: Use Enum 1370 “Batch Posting Parameter Type” instead.

Example:

// SPLN1.00 - Start
//BatchProcessingMgt.GetBooleanParameter(SalesHeader.RecordId, Enum::"Batch Posting 
Parameter Type".FromInteger(BatchPostParameterTypes.Invoice), Invoice);
BatchProcessingMgt.GetBooleanParameter(SalesHeader.RecordId, 
BatchPostParameterTypes::Invoice, Invoice);
// SPLN1.00 - End

3.3 Codeunit 9520 “Mail Management”

Issue: No overload for method ‘Send’ takes 1 argument. Candidates: ‘Send(var Record “Email Item”, Enum System.Email.”Email Scenario”)’ defined in Codeunit ‘Mail Management’ by the extension Base Application by Microsoft (24.0.16410.18056), ‘Send(var Record “Email Item”, Enum System.Email.”Email Scenario”, Boolean)’ defined in Codeunit ‘Mail Management’ by the extension Base Application by Microsoft (24.0.16410.18056)

Solution: Add a variable of type Enum 8890 “Email Scenario”. Set its value according to the case, and if unsure, use EmailScenario::Default. Then, pass the enum variable along with the Record type variable 9500 “Email Item” into the procedure.

Example:

local procedure Test()
var
    EmailScenario: Enum "Email Scenario";
    MailManagement: Codeunit "Mail Management";
    EmailItem: Record "Email Item";
begin
    // SPLN1.00 - Start
    //if not MailManagement.Send(EmailItem) then
    EmailScenario := EmailScenario::Default;
    if not MailManagement.Send(EmailItem, EmailScenario) then;
    // SPLN1.00 - End
end;

 

3.4 Codeunit 11401 “Post Code Management”

Issue: Codeunit Microsoft.Foundation.Address.”Post Code Management” does not contain a definition for ‘FindStreetNameFromAddress’.

Solution: Use procedure FindStreetName instead.

4. Business Central 24 breaking changes: Pages

 

4.1 Page 344 Navigate

Issue: No overload for method ‘SetTracking’ takes 2 arguments. Candidates: ‘SetTracking(Record “Item Tracking Setup” temporary)’ defined in Page ‘Navigate’ by the extension Base Application by Microsoft (24.0.16410.18056)

Solution: Use variable ItemTrackingSetup: Record “Item Tracking Setup”, put both values into fields “Serial No.” and “Lot No.” and pass this variable into procedure SetTracking.

Example:

local procedure Test()
var
    ItemTrackingSetup: Record "Item Tracking Setup";
    Navigate: Page Navigate;
begin
    // SPLN1.00 - Start
    //Navigate.SetTracking("Serial No.", '');
    ItemTrackingSetup."Serial No." := "Serial No.";
    ItemTrackingSetup."Lot No." := '';
    Navigate.SetTracking(ItemTrackingSetup);
    // SPLN1.00 - End
end;

4.2 Page 1390 “Generic Chart”

Issue: The target Page ‘Generic Chart’ for the extension object is not found.

Solution: The page has been replaced with page 1392 “Help And Chart Wrapper”.

Conclusion

In summary, adapting to change is vital in the world of ERP systems. With Business Central 24, users and developers will face both improvements and disruptions. By understanding and embracing these changes, businesses can make the most of the platform while maintaining smooth operations.