From 208d388ee38b24c0e77412d24ec5eb36525bcb96 Mon Sep 17 00:00:00 2001 From: Gert Robyns Date: Mon, 16 Dec 2024 12:59:41 +0100 Subject: [PATCH] [releases/25.x] Fixes an issue when comparing a blank no. series code to a filter for blank (#2544) This pull request backports #2543 to releases/25.x Fixes AB#560710 --- .../App/NoSeries/src/Setup/NoSeriesSetupImpl.Codeunit.al | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 7dcd32f56e..7900a91166 100644 --- a/src/Business Foundation/App/NoSeries/src/Setup/NoSeriesSetupImpl.Codeunit.al +++ b/src/Business Foundation/App/NoSeries/src/Setup/NoSeriesSetupImpl.Codeunit.al @@ -142,13 +142,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);