bl al error AL0185: Codeunit 'NoSeriesManagement' is missing

 The error AL0185: Codeunit 'NoSeriesManagement' is missing in Microsoft Dynamics 365 Business Central occurs because the NoSeriesManagement codeunit has been deprecated and removed in recent versions (specifically in Business Central v27, and marked for removal in v24/2024 Wave 1). 



Microsoft has replaced the old codeunit with a new, more modular system involving the No. Series and No. Series - Batch system modules. 
Solution
To resolve this error, you need to update your AL code to use the new pattern: 
  1. Replace references to the old NoSeriesManagement codeunit with the new No. Series codeunit for single number series operations or No. Series - Batch for performance-optimized, multiple number series operations.
  2. Add necessary dependencies to your app.json file for the new Business Foundation application, if not already included. The new codeunits are part of this foundational layer.
  3. Refactor your code to call the new methods. The functions are similar but use different syntax and structures. 
Example Code Snippet (before/after)
The general logic for getting the next number has changed from a direct call to the old codeunit to using the methods in the new ones.
Old approach (will cause error):
var
    NoSeriesMgt: Codeunit NoSeriesManagement;
    ...
begin
    ...
    "No." := NoSeriesMgt.GetNextNo(SalesSetup."Model Nos.", Today(), true);
    ...
end;
New approach (using Codeunit "No. Series"):
var
    NoSeries: Codeunit "No. Series";
    ...
begin
    ...
    "No." := NoSeries.GetNextNo(SalesSetup."Model Nos.", Today(), true);
    ...
end;

Comentarios

Entradas más populares de este blog

Sacando aceleracion de un vehiculo en c++

Ejemplo de suma Pascal

Gráfica de Seno y Coseno en C++ | Código C++