Issue with no. series in Business Central 25.2 (Application 25.2.27733.27999)

27-12-2024

Business Central 25.2 (Platform 25.2.27927.0 +Application 25.2.27733.27999)

 

There is an issue with Business Foundation app no. series module in this release. When you try to create a new no. series you will get the below error.


"The filter on Series Code was altered by an event subscriber. This is a programming error. Please contact your partner to resolve the issue.

Original Series Code:

Modified Filter: ''


Page New - No. Series has to close."

 

 

This is due to the code written in the procedure SetNoSeriesLineFilters of codeunit 305"No. Series - Setup Impl.".



procedureSetNoSeriesLineFilters(var NoSeriesLine: Record "No. Series Line";NoSeriesCode: Code[20]; StartingDate: Date)

var

       NoSeriesLine2: Record "No. Series Line";

       NoSeries: Codeunit "No. Series";

begin

      

NoSeriesLine2.SetCurrentKey("SeriesCode", "Starting Date");

       NoSeriesLine2.SetRange("Starting Date", 0D, StartingDate);

       NoSeriesLine2.SetRange("Series Code", NoSeriesCode);

       NoSeries.OnSetNoSeriesLineFilters(NoSeriesLine2);

       if NoSeriesLine2.GetFilter("Series Code") <>NoSeriesCode then

           Error(CodeFieldChangedErr,NoSeriesLine2.FieldCaption("Series Code"), NoSeriesCode,NoSeriesLine2.GetFilter("Series Code"));

 

      

NoSeriesLine.SetCurrentKey("SeriesCode", "Starting Date");

       NoSeriesLine.CopyFilters(NoSeriesLine2);

end;

 

This will be fixed in next minor release 25.3, however a workaround is to subscribe the OnBeforeUpdateLine event of NoSeriesManagement codeunit and skip the above code to execute by mark IsHandled := true as below code.

 

[EventSubscriber(ObjectType::Codeunit,Codeunit::NoSeriesManagement, OnBeforeUpdateLine, '', false, false)]

local procedureNoSeriesManagement_OnBeforeUpdateLine(var NoSeries: Record "No.Series"; var StartDate: Date; var StartNo: Code[20]; var EndNo: Code[20];var LastNoUsed: Code[20]; var WarningNo: Code[20]; var IncrementByNo: Integer;var LastDateUsed: Date; var Implementation: Enum "No. SeriesImplementation"; var IsHandled: Boolean)

begin

       IsHandled := true;

end;