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