From 68d8a2e98015de7d589b7c3d8503c47d3534961f Mon Sep 17 00:00:00 2001 From: Jesper Schulz-Wedde Date: Wed, 18 Sep 2024 08:12:38 +0200 Subject: [PATCH] Apply suggestions from code review --- .../src/Copilot/NoSeriesCopilotImpl.Codeunit.al | 2 +- .../src/Copilot/NoSeriesGenerationDetail.Table.al | 1 - .../src/Copilot/Tools/NoSeriesCopAddIntent.Codeunit.al | 2 +- .../src/Copilot/Tools/NoSeriesCopToolsImpl.Codeunit.al | 4 ++-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/NoSeriesCopilotImpl.Codeunit.al b/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/NoSeriesCopilotImpl.Codeunit.al index f92cb15889..fb4fcdeb2a 100644 --- a/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/NoSeriesCopilotImpl.Codeunit.al +++ b/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/NoSeriesCopilotImpl.Codeunit.al @@ -19,7 +19,7 @@ codeunit 324 "No. Series Copilot Impl." var IncorrectCompletionErr: Label 'Incorrect completion. The property %1 is empty', Comment = '%1 = property name'; - EmptyCompletionErr: Label 'Incorrect completion. The completion is empty'; + EmptyCompletionErr: Label 'Incorrect completion. The completion is empty.'; IncorrectCompletionNumberOfGeneratedNoSeriesErr: Label 'Incorrect completion. The number of generated number series is incorrect. Expected %1, but got %2', Comment = '%1 = Expected Number, %2 = Actual Number'; TextLengthIsOverMaxLimitErr: Label 'The property %1 exceeds the maximum length of %2', Comment = '%1 = property name, %2 = maximum length'; DateSpecificPlaceholderLbl: Label '{current_date}', Locked = true; diff --git a/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/NoSeriesGenerationDetail.Table.al b/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/NoSeriesGenerationDetail.Table.al index 529d0eafa8..9aff263436 100644 --- a/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/NoSeriesGenerationDetail.Table.al +++ b/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/NoSeriesGenerationDetail.Table.al @@ -84,7 +84,6 @@ table 392 "No. Series Generation Detail" { Caption = 'Message'; } - field(20; "Setup Table Name"; Text[80]) { Caption = 'Setup Table'; diff --git a/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/Tools/NoSeriesCopAddIntent.Codeunit.al b/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/Tools/NoSeriesCopAddIntent.Codeunit.al index d3d82e58f1..b2377be60d 100644 --- a/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/Tools/NoSeriesCopAddIntent.Codeunit.al +++ b/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/Tools/NoSeriesCopAddIntent.Codeunit.al @@ -164,10 +164,10 @@ codeunit 331 "No. Series Cop. Add Intent" implements "AOAI Function" local procedure SaveExistingNoSeries(TempTableMetadata: Record "Table Metadata" temporary; FieldRef: FieldRef) var - ExistingNoSeriesJObj: JsonObject; NoSeries: Record "No. Series"; NoSeriesLine: Record "No. Series Line"; NoSeriesManagement: Codeunit "No. Series"; + ExistingNoSeriesJObj: JsonObject; begin if not NoSeries.Get(Format(FieldRef.Value)) then exit; diff --git a/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/Tools/NoSeriesCopToolsImpl.Codeunit.al b/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/Tools/NoSeriesCopToolsImpl.Codeunit.al index 13787c2dc1..7fc97a5beb 100644 --- a/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/Tools/NoSeriesCopToolsImpl.Codeunit.al +++ b/src/Business Foundation/App/NoSeriesCopilot/src/Copilot/Tools/NoSeriesCopToolsImpl.Codeunit.al @@ -234,14 +234,14 @@ codeunit 336 "No. Series Cop. Tools Impl." foreach Entity in Entities do begin String1 := RecordMatchMgtCopy.RemoveShortWords(RemoveTextPart(TableMetadata.Caption, ' Setup') + ' ' + RemoveTextParts(Field.FieldName, GetNoSeriesAbbreviations())); String2 := RecordMatchMgtCopy.RemoveShortWords(Entity); - Score := RecordMatchMgtCopy.CalculateStringNearness(String1, String2, GetMatchLengthTreshold(), 100) / 100; + Score := RecordMatchMgtCopy.CalculateStringNearness(String1, String2, GetMatchLengthThreshold(), 100) / 100; if Score >= RequiredNearness() then exit(true); end; exit(false); end; - local procedure GetMatchLengthTreshold(): Decimal + local procedure GetMatchLengthThreshold(): Decimal begin exit(2); end;