From 0546e8327ddbf22833fc7d2fe2c51651c7f4a68d Mon Sep 17 00:00:00 2001 From: Gert Robyns Date: Wed, 7 Feb 2024 10:25:30 +0100 Subject: [PATCH] move obsolete fields to table extension --- .../Legacy/NoSeriesLineObsolete.TableExt.al | 90 ++++++++++++++----- .../src/Legacy/NoSeriesObsolete.TableExt.al | 8 ++ .../App/NoSeries/src/Setup/NoSeries.Table.al | 8 -- .../NoSeries/src/Setup/NoSeriesLine.Table.al | 52 ----------- 4 files changed, 77 insertions(+), 81 deletions(-) diff --git a/src/Business Foundation/App/NoSeries/src/Legacy/NoSeriesLineObsolete.TableExt.al b/src/Business Foundation/App/NoSeries/src/Legacy/NoSeriesLineObsolete.TableExt.al index 0a093d1f3c..ac0f0a0b52 100644 --- a/src/Business Foundation/App/NoSeries/src/Legacy/NoSeriesLineObsolete.TableExt.al +++ b/src/Business Foundation/App/NoSeries/src/Legacy/NoSeriesLineObsolete.TableExt.al @@ -12,27 +12,19 @@ tableextension 309 NoSeriesLineObsolete extends "No. Series Line" { fields { -#if not CLEAN24 -#pragma warning disable AL0432 - modify(Implementation) + field(11; "Allow Gaps in Nos."; Boolean) { - trigger OnAfterValidate() - var - NoSeriesSetupImpl: Codeunit "No. Series - Setup Impl."; - begin - if Rec.Implementation = xRec.Implementation then - exit; + Caption = 'Allow Gaps in Nos.'; + DataClassification = CustomerContent; + ObsoleteReason = 'The specific implementation is defined by the Implementation field and whether the implementation may produce gaps can be determined through the implementation interface or the procedure MayProduceGaps.'; +#if CLEAN24 + ObsoleteState = Removed; + ObsoleteTag = '27.0'; +#else + ObsoleteState = Pending; + ObsoleteTag = '24.0'; -#pragma warning disable AA0206 - SkipAllowGapsValidationTrigger := true; -#pragma warning restore AA0206 - - Validate("Allow Gaps in Nos.", NoSeriesSetupImpl.MayProduceGaps(Rec)); // Keep the Allow Gaps field in sync with the implementation - end; - } - modify("Allow Gaps in Nos.") - { - trigger OnAfterValidate() + trigger OnValidate() var NoSeries: Record "No. Series"; begin @@ -52,14 +44,70 @@ tableextension 309 NoSeriesLineObsolete extends "No. Series Line" if "Line No." <> 0 then Modify(); end; +#endif } - modify("Authorization Year") + field(10000; Series; Code[10]) // NA (MX) Functionality { - trigger OnAfterValidate() + Caption = 'Series'; + DataClassification = CustomerContent; + ObsoleteReason = 'The No. Series module cannot reference tax features.'; +#if CLEAN24 + ObsoleteState = Removed; + ObsoleteTag = '27.0'; +#else + ObsoleteState = Pending; + ObsoleteTag = '24.0'; +#endif + } + field(10001; "Authorization Code"; Integer) // NA (MX) Functionality + { + Caption = 'Authorization Code'; + DataClassification = CustomerContent; + ObsoleteReason = 'The No. Series module cannot reference tax features.'; +#if CLEAN24 + ObsoleteState = Removed; + ObsoleteTag = '27.0'; +#else + ObsoleteState = Pending; + ObsoleteTag = '24.0'; +#endif + } + field(10002; "Authorization Year"; Integer) // NA (MX) Functionality + { + Caption = 'Authorization Year'; + DataClassification = CustomerContent; + ObsoleteReason = 'The No. Series module cannot reference tax features.'; +#if CLEAN24 + ObsoleteState = Removed; + ObsoleteTag = '27.0'; +#else + ObsoleteState = Pending; + ObsoleteTag = '24.0'; + + trigger OnValidate() begin if StrLen(Format("Authorization Year")) <> 4 then Message(ShouldBeValidYearErr); end; +#endif + } +#if not CLEAN24 +#pragma warning disable AL0432 + modify(Implementation) + { + trigger OnAfterValidate() + var + NoSeriesSetupImpl: Codeunit "No. Series - Setup Impl."; + begin + if Rec.Implementation = xRec.Implementation then + exit; + +#pragma warning disable AA0206 + SkipAllowGapsValidationTrigger := true; +#pragma warning restore AA0206 + + Validate("Allow Gaps in Nos.", NoSeriesSetupImpl.MayProduceGaps(Rec)); // Keep the Allow Gaps field in sync with the implementation + end; } #pragma warning restore AL0432 #endif diff --git a/src/Business Foundation/App/NoSeries/src/Legacy/NoSeriesObsolete.TableExt.al b/src/Business Foundation/App/NoSeries/src/Legacy/NoSeriesObsolete.TableExt.al index 8ecf202cf3..a3032ddc99 100644 --- a/src/Business Foundation/App/NoSeries/src/Legacy/NoSeriesObsolete.TableExt.al +++ b/src/Business Foundation/App/NoSeries/src/Legacy/NoSeriesObsolete.TableExt.al @@ -12,6 +12,14 @@ tableextension 308 NoSeriesObsolete extends "No. Series" { fields { + field(11790; Mask; Text[20]) // CZ Functionality + { + Caption = 'Mask'; + DataClassification = CustomerContent; + ObsoleteReason = 'The field is used in CZ localization only. The functionality of No. Series Enhancements will be removed and this field should not be used. (Obsolete::Removed in release 01.2021)'; + ObsoleteState = Removed; + ObsoleteTag = '18.0'; + } #pragma warning disable AL0432 field(12100; "No. Series Type"; Integer) #pragma warning restore AL0432 diff --git a/src/Business Foundation/App/NoSeries/src/Setup/NoSeries.Table.al b/src/Business Foundation/App/NoSeries/src/Setup/NoSeries.Table.al index 54fb1a6af5..c5a604c9c9 100644 --- a/src/Business Foundation/App/NoSeries/src/Setup/NoSeries.Table.al +++ b/src/Business Foundation/App/NoSeries/src/Setup/NoSeries.Table.al @@ -56,14 +56,6 @@ table 308 "No. Series" { Caption = 'Date Order'; } - field(11790; Mask; Text[20]) // CZ Functionality - { - Caption = 'Mask'; - DataClassification = CustomerContent; - ObsoleteReason = 'The field is used in CZ localization only. The functionality of No. Series Enhancements will be removed and this field should not be used. (Obsolete::Removed in release 01.2021)'; - ObsoleteState = Removed; - ObsoleteTag = '18.0'; - } } keys diff --git a/src/Business Foundation/App/NoSeries/src/Setup/NoSeriesLine.Table.al b/src/Business Foundation/App/NoSeries/src/Setup/NoSeriesLine.Table.al index 58dfa98c5a..426ad4b9f3 100644 --- a/src/Business Foundation/App/NoSeries/src/Setup/NoSeriesLine.Table.al +++ b/src/Business Foundation/App/NoSeries/src/Setup/NoSeriesLine.Table.al @@ -108,19 +108,6 @@ table 309 "No. Series Line" { Caption = 'Last Date Used'; } - field(11; "Allow Gaps in Nos."; Boolean) - { - Caption = 'Allow Gaps in Nos.'; - DataClassification = CustomerContent; - ObsoleteReason = 'The specific implementation is defined by the Implementation field and whether the implementation may produce gaps can be determined through the implementation interface or the procedure MayProduceGaps.'; -#if CLEAN24 - ObsoleteState = Removed; - ObsoleteTag = '27.0'; -#else - ObsoleteState = Pending; - ObsoleteTag = '24.0'; -#endif - } field(12; "Sequence Name"; Code[40]) { Caption = 'Sequence Name'; @@ -139,45 +126,6 @@ table 309 "No. Series Line" DataClassification = SystemMetadata; } - field(10000; Series; Code[10]) // NA (MX) Functionality - { - Caption = 'Series'; - DataClassification = CustomerContent; - ObsoleteReason = 'The No. Series module cannot reference tax features.'; -#if CLEAN24 - ObsoleteState = Removed; - ObsoleteTag = '27.0'; -#else - ObsoleteState = Pending; - ObsoleteTag = '24.0'; -#endif - } - field(10001; "Authorization Code"; Integer) // NA (MX) Functionality - { - Caption = 'Authorization Code'; - DataClassification = CustomerContent; - ObsoleteReason = 'The No. Series module cannot reference tax features.'; -#if CLEAN24 - ObsoleteState = Removed; - ObsoleteTag = '27.0'; -#else - ObsoleteState = Pending; - ObsoleteTag = '24.0'; -#endif - } - field(10002; "Authorization Year"; Integer) // NA (MX) Functionality - { - Caption = 'Authorization Year'; - DataClassification = CustomerContent; - ObsoleteReason = 'The No. Series module cannot reference tax features.'; -#if CLEAN24 - ObsoleteState = Removed; - ObsoleteTag = '27.0'; -#else - ObsoleteState = Pending; - ObsoleteTag = '24.0'; -#endif - } } keys