diff --git a/src/Business Foundation/App/NoSeries/src/Setup/NoSeriesSetupImpl.Codeunit.al b/src/Business Foundation/App/NoSeries/src/Setup/NoSeriesSetupImpl.Codeunit.al index 8e7385b867..cbb49a8b02 100644 --- a/src/Business Foundation/App/NoSeries/src/Setup/NoSeriesSetupImpl.Codeunit.al +++ b/src/Business Foundation/App/NoSeries/src/Setup/NoSeriesSetupImpl.Codeunit.al @@ -140,13 +140,16 @@ codeunit 305 "No. Series - Setup Impl." var NoSeriesLine2: Record "No. Series Line"; NoSeries: Codeunit "No. Series"; + NoSeriesCodeFilter: Text; begin NoSeriesLine2.SetCurrentKey("Series Code", "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")); + if NoSeriesCode <> '' then + NoSeriesCodeFilter := NoSeriesLine2.GetFilter("Series Code"); + if NoSeriesCodeFilter <> NoSeriesCode then + Error(CodeFieldChangedErr, NoSeriesLine2.FieldCaption("Series Code"), NoSeriesCode, NoSeriesCodeFilter); NoSeriesLine.SetCurrentKey("Series Code", "Starting Date"); NoSeriesLine.CopyFilters(NoSeriesLine2);