From 43e97ef023f267b049f3ea0d675805f45a1c5548 Mon Sep 17 00:00:00 2001 From: Gert Robyns Date: Mon, 16 Dec 2024 11:57:57 +0100 Subject: [PATCH] Fixes an issue when comparing a blank no. series code to a filter for blank (#2543) #### Summary Fixes an issue when comparing a blank no. series code to a filter for blank #### Work Item(s) Fixes [AB#560685](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/560685) --- .../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 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);