From 82fde86cfbd4e61dad92471d34f04af18da15685 Mon Sep 17 00:00:00 2001 From: Matti Nielsen Date: Thu, 8 Feb 2024 17:25:48 +0100 Subject: [PATCH 01/11] Add GetCollectionType to Edit-In Excel API --- .../src/Filters/EditInExcelFieldFilter.Interface.al | 2 ++ .../src/Filters/EditInExcelFldFilterImpl.Codeunit.al | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilter.Interface.al b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilter.Interface.al index b9ee590af2..ebcae0abeb 100644 --- a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilter.Interface.al +++ b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilter.Interface.al @@ -27,6 +27,8 @@ interface "Edit in Excel Field Filter" /// The value which the field should be Equal to, Greater than etc. procedure Get(Index: Integer; var EditinExcelFilterType: Enum "Edit in Excel Filter Type"; var FilterValue: Text) + procedure GetCollectionType(): Enum "Edit in Excel Filter Collection Type" + /// /// Remove a specific filter /// diff --git a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFldFilterImpl.Codeunit.al b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFldFilterImpl.Codeunit.al index fd4ce688f2..cf877fa8ab 100644 --- a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFldFilterImpl.Codeunit.al +++ b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFldFilterImpl.Codeunit.al @@ -47,6 +47,16 @@ codeunit 1492 "Edit in Excel Fld Filter Impl." implements "Edit in Excel Field F FilterValue := FilterBinaryNode.Right; end; + procedure GetCollectionType(): Enum "Edit in Excel Filter Collection Type" + var + TempString: DotNet String; + begin + TempString := FilterCollectionNode.Operator(); + if TempString = 'or' then + exit("Edit in Excel Filter Collection Type"::"or"); + exit("Edit in Excel Filter Collection Type"::"and") + end; + procedure Remove(Index: Integer) begin FilterCollectionNode.Collection.RemoveAt(Index); From 181987ff1c7efc4af45593a7a9c4f9e9fff70193 Mon Sep 17 00:00:00 2001 From: Matti Nielsen Date: Fri, 9 Feb 2024 11:45:52 +0100 Subject: [PATCH 02/11] Add test cases --- .../src/EditInExcelFiltersTest.Codeunit.al | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/System Application/Test/Edit in Excel/src/EditInExcelFiltersTest.Codeunit.al b/src/System Application/Test/Edit in Excel/src/EditInExcelFiltersTest.Codeunit.al index 4fcd8a7ddd..bf0d76b15d 100644 --- a/src/System Application/Test/Edit in Excel/src/EditInExcelFiltersTest.Codeunit.al +++ b/src/System Application/Test/Edit in Excel/src/EditInExcelFiltersTest.Codeunit.al @@ -17,6 +17,44 @@ codeunit 132526 "Edit in Excel Filters Test" var LibraryAssert: Codeunit "Library Assert"; + [Test] + procedure TestEditInExcelFieldFilterGetCollectionTypeReturnsCorrectAndOperator() + var + EditinExcelFilters: Codeunit "Edit in Excel Filters"; + EditInExcelFilter: Interface "Edit in Excel Field Filter"; + FieldName: Text; + EditInExcelFilterCollectionType: Enum "Edit in Excel Filter Collection Type"; + begin + FieldName := 'No_'; + + EditinExcelFilters.AddField(FieldName, "Edit in Excel Filter Collection Type"::"and", Enum::"Edit in Excel Edm Type"::"Edm.String"); + EditinExcelFilters.Get(FieldName).AddFilterValue(Enum::"Edit in Excel Filter Type"::Equal, '10000'); + EditinExcelFilters.Get(FieldName).AddFilterValue(Enum::"Edit in Excel Filter Type"::Equal, '10001'); + + EditInExcelFilter := EditinExcelFilters.Get(FieldName); + EditInExcelFilterCollectionType := EditInExcelFilter.GetCollectionType(); + LibraryAssert.AreEqual("Edit in Excel Filter Collection Type"::"and", EditInExcelFilterCollectionType, 'Field filter created with an AND operator should have a collection type of AND.') + end; + + [Test] + procedure TestEditInExcelFieldFilterGetCollectionTypeReturnsCorrectOrOperator() + var + EditinExcelFilters: Codeunit "Edit in Excel Filters"; + EditInExcelFilter: Interface "Edit in Excel Field Filter"; + FieldName: Text; + EditInExcelFilterCollectionType: Enum "Edit in Excel Filter Collection Type"; + begin + FieldName := 'No_'; + + EditinExcelFilters.AddField(FieldName, "Edit in Excel Filter Collection Type"::"or", Enum::"Edit in Excel Edm Type"::"Edm.String"); + EditinExcelFilters.Get(FieldName).AddFilterValue(Enum::"Edit in Excel Filter Type"::Equal, '10000'); + EditinExcelFilters.Get(FieldName).AddFilterValue(Enum::"Edit in Excel Filter Type"::Equal, '10001'); + + EditInExcelFilter := EditinExcelFilters.Get(FieldName); + EditInExcelFilterCollectionType := EditInExcelFilter.GetCollectionType(); + LibraryAssert.AreEqual("Edit in Excel Filter Collection Type"::"or", EditInExcelFilterCollectionType, 'Field filter created with an OR operator should have a collection type of OR.') + end; + [Test] procedure TestEditInExcelStructuredFiltersDateTime() var From 48891ddbd0e19cbe878f2157614df7b644c67c10 Mon Sep 17 00:00:00 2001 From: Matti Nielsen Date: Fri, 9 Feb 2024 12:20:28 +0100 Subject: [PATCH 03/11] Add a comment to the GetCollectionType() --- .../src/Filters/EditInExcelFieldFilter.Interface.al | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilter.Interface.al b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilter.Interface.al index ebcae0abeb..6d0441dfbc 100644 --- a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilter.Interface.al +++ b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilter.Interface.al @@ -27,6 +27,10 @@ interface "Edit in Excel Field Filter" /// The value which the field should be Equal to, Greater than etc. procedure Get(Index: Integer; var EditinExcelFilterType: Enum "Edit in Excel Filter Type"; var FilterValue: Text) + /// + /// Get the filter collection type + /// + /// The collection type of the filter procedure GetCollectionType(): Enum "Edit in Excel Filter Collection Type" /// From 82a2538cef6ada88a882c76b1f304b6dfdbf2ad1 Mon Sep 17 00:00:00 2001 From: Matti Nielsen Date: Fri, 5 Apr 2024 12:04:54 +0200 Subject: [PATCH 04/11] Make it implement both interfaces --- .../EditInExcelFieldFilterv2.Interface.al | 47 +++++++++++++++++++ .../EditInExcelFldFilterImpl.Codeunit.al | 8 +++- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilterv2.Interface.al diff --git a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilterv2.Interface.al b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilterv2.Interface.al new file mode 100644 index 0000000000..a165893af3 --- /dev/null +++ b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilterv2.Interface.al @@ -0,0 +1,47 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ + +namespace System.Integration.Excel; + +/// +/// This codeunit provides an interface to create a filter for a specific field for Edit in Excel. +/// +interface "Edit in Excel Field Filter v2" +{ + Access = Public; + + /// + /// Add a filter value + /// + /// The filter type, such as Equal, Greater than. + /// The value which the field should be Equal to, Greater than etc. + procedure AddFilterValue(EditInExcelFilterType: Enum "Edit in Excel Filter Type"; FilterValue: Text): Interface "Edit in Excel Field Filter" + + /// + /// Get a specific filter + /// + /// The index of the filter. + /// The filter type, such as Equal, Greater than. + /// The value which the field should be Equal to, Greater than etc. + procedure Get(Index: Integer; var EditinExcelFilterType: Enum "Edit in Excel Filter Type"; var FilterValue: Text) + + /// + /// Get the filter collection type + /// + /// The collection type of the filter + procedure GetCollectionType(): Enum "Edit in Excel Filter Collection Type" + + /// + /// Remove a specific filter + /// + /// The index of the filter. + procedure Remove(Index: Integer) + + /// + /// Counts the number of filters + /// + /// The number of filters + procedure Count(): Integer +} diff --git a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFldFilterImpl.Codeunit.al b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFldFilterImpl.Codeunit.al index cf877fa8ab..f3b2e79838 100644 --- a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFldFilterImpl.Codeunit.al +++ b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFldFilterImpl.Codeunit.al @@ -10,7 +10,13 @@ using System; /// /// This codeunit provides an interface to running Edit in Excel for a specific page. /// -codeunit 1492 "Edit in Excel Fld Filter Impl." implements "Edit in Excel Field Filter" +#if not CLEAN25/// +#pragma warning disable AL0432 +codeunit 1492 "Edit in Excel Fld Filter Impl." implements "Edit in Excel Field Filter", "Edit in Excel Field Filter v2" +#pragma warning restore AL0432 +#else +codeunit 1492 "Edit in Excel Fld Filter Impl." implements "Edit in Excel Field Filter v2" +#endif { Access = Internal; InherentEntitlements = X; From 9b669ef60c4b58d88083d956d1e1bf5a37c91d1e Mon Sep 17 00:00:00 2001 From: Matti Nielsen Date: Fri, 5 Apr 2024 15:53:19 +0200 Subject: [PATCH 05/11] Just saving progress --- .../EditInExcelFieldFilter.Interface.al | 6 ----- .../EditInExcelFieldFilterv2.Interface.al | 2 +- .../Filters/EditInExcelFilters.Codeunit.al | 20 ++++++++++++++++ .../EditInExcelFiltersImpl.Codeunit.al | 4 ++-- .../EditInExcelFldFilterImpl.Codeunit.al | 23 ++++++++++++------- .../src/EditInExcelFiltersTest.Codeunit.al | 8 +++---- 6 files changed, 42 insertions(+), 21 deletions(-) diff --git a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilter.Interface.al b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilter.Interface.al index 6d0441dfbc..b9ee590af2 100644 --- a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilter.Interface.al +++ b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilter.Interface.al @@ -27,12 +27,6 @@ interface "Edit in Excel Field Filter" /// The value which the field should be Equal to, Greater than etc. procedure Get(Index: Integer; var EditinExcelFilterType: Enum "Edit in Excel Filter Type"; var FilterValue: Text) - /// - /// Get the filter collection type - /// - /// The collection type of the filter - procedure GetCollectionType(): Enum "Edit in Excel Filter Collection Type" - /// /// Remove a specific filter /// diff --git a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilterv2.Interface.al b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilterv2.Interface.al index a165893af3..412b12cb0e 100644 --- a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilterv2.Interface.al +++ b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilterv2.Interface.al @@ -17,7 +17,7 @@ interface "Edit in Excel Field Filter v2" /// /// The filter type, such as Equal, Greater than. /// The value which the field should be Equal to, Greater than etc. - procedure AddFilterValue(EditInExcelFilterType: Enum "Edit in Excel Filter Type"; FilterValue: Text): Interface "Edit in Excel Field Filter" + procedure AddFilterValueV2(EditInExcelFilterType: Enum "Edit in Excel Filter Type"; FilterValue: Text): Interface "Edit in Excel Field Filter v2" /// /// Get a specific filter diff --git a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFilters.Codeunit.al b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFilters.Codeunit.al index 9c729fde32..ceb6089114 100644 --- a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFilters.Codeunit.al +++ b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFilters.Codeunit.al @@ -29,6 +29,11 @@ codeunit 1490 "Edit in Excel Filters" exit(EditinExcelFiltersImpl.AddField(ODataFieldName, "Edit in Excel Filter Collection Type"::"and", EditInExcelEdmType)); end; + procedure AddFieldV2(ODataFieldName: Text; EditInExcelEdmType: Enum "Edit in Excel Edm Type"): Interface "Edit in Excel Field Filter v2" + begin + exit(EditinExcelFiltersImpl.AddField(ODataFieldName, "Edit in Excel Filter Collection Type"::"and", EditInExcelEdmType)); + end; + /// /// Add the specified field with a specified collection type. /// @@ -40,6 +45,11 @@ codeunit 1490 "Edit in Excel Filters" exit(EditinExcelFiltersImpl.AddField(ODataFieldName, EditInExcelFilterOperatorType, EditInExcelEdmType)); end; + procedure AddFieldV2(ODataFieldName: Text; EditInExcelFilterOperatorType: Enum "Edit in Excel Filter Collection Type"; EditInExcelEdmType: Enum "Edit in Excel Edm Type"): Interface "Edit in Excel Field Filter V2" + begin + exit(EditinExcelFiltersImpl.AddField(ODataFieldName, EditInExcelFilterOperatorType, EditInExcelEdmType)); + end; + /// /// Add the specified field with an initial value using 'and' collection type. /// This is mainly intended for fields that only filter on a single value. @@ -53,6 +63,11 @@ codeunit 1490 "Edit in Excel Filters" EditinExcelFiltersImpl.AddField(ODataFieldName, EditInExcelFilterType, FilterValue, EditInExcelEdmType); end; + procedure AddFieldV2(ODataFieldName: Text; EditInExcelFilterType: Enum "Edit in Excel Filter Type"; FilterValue: Text; EditInExcelEdmType: Enum "Edit in Excel Edm Type") + begin + EditinExcelFiltersImpl.AddField(ODataFieldName, EditInExcelFilterType, FilterValue, EditInExcelEdmType); + end; + /// /// Get the field filters for the specified field. /// @@ -63,6 +78,11 @@ codeunit 1490 "Edit in Excel Filters" exit(EditinExcelFiltersImpl.Get(ODataFieldName)); end; + procedure GetV2(ODataFieldName: Text): Interface "Edit in Excel Field Filter V2" + begin + exit(EditinExcelFiltersImpl.Get(ODataFieldName)); + end; + /// /// Removes the filter for the specified field. /// diff --git a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFiltersImpl.Codeunit.al b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFiltersImpl.Codeunit.al index ac3227e5b9..9d3e530206 100644 --- a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFiltersImpl.Codeunit.al +++ b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFiltersImpl.Codeunit.al @@ -33,7 +33,7 @@ codeunit 1491 "Edit in Excel Filters Impl." FilterContainsMultipleOperatorsTxt: Label 'The page filter contains multiple operators, the latter was removed.', Locked = true; FieldPayloadEdmTypeTok: Label 'fieldPayload.%1.edmType', Locked = true; - procedure AddField(ODataFieldName: Text; EditinExcelFilterCollectionType: Enum "Edit in Excel Filter Collection Type"; EditInExcelEdmType: Enum "Edit in Excel Edm Type"): Interface "Edit in Excel Field Filter" + procedure AddField(ODataFieldName: Text; EditinExcelFilterCollectionType: Enum "Edit in Excel Filter Collection Type"; EditInExcelEdmType: Enum "Edit in Excel Edm Type"): Codeunit "Edit in Excel Fld Filter Impl." begin TryAdd(ODataFieldName, EditinExcelFilterCollectionType, Format(EditInExcelEdmType)); exit(Get(ODataFieldName)); @@ -45,7 +45,7 @@ codeunit 1491 "Edit in Excel Filters Impl." Get(ODataFieldName).AddFilterValue(EditInExcelFilterType, FilterValue); end; - procedure Get(ODataFieldName: Text): Interface "Edit in Excel Field Filter" + procedure Get(ODataFieldName: Text): Codeunit "Edit in Excel Fld Filter Impl." var EditinExcelFldFilterImpl: Codeunit "Edit in Excel Fld Filter Impl."; FilterCollectionNode: DotNet FilterCollectionNode; diff --git a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFldFilterImpl.Codeunit.al b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFldFilterImpl.Codeunit.al index f3b2e79838..f98ecec3c1 100644 --- a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFldFilterImpl.Codeunit.al +++ b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFldFilterImpl.Codeunit.al @@ -10,7 +10,8 @@ using System; /// /// This codeunit provides an interface to running Edit in Excel for a specific page. /// -#if not CLEAN25/// + +#if not CLEAN25 #pragma warning disable AL0432 codeunit 1492 "Edit in Excel Fld Filter Impl." implements "Edit in Excel Field Filter", "Edit in Excel Field Filter v2" #pragma warning restore AL0432 @@ -23,12 +24,12 @@ codeunit 1492 "Edit in Excel Fld Filter Impl." implements "Edit in Excel Field F InherentPermissions = X; var - EditInExcelFieldFilter: Interface "Edit in Excel Field Filter"; + EditInExcelFieldFilter: Codeunit "Edit in Excel Fld Filter Impl."; FilterCollectionNode: DotNet FilterCollectionNode; ODataFieldName: Text; EdmType: Text; - internal procedure Initialize(NewODataFieldName: Text; NewEdmType: Text; NewFilterCollectionNode: DotNet FilterCollectionNode; NewEditInExcelFieldFilter: Interface "Edit in Excel Field Filter") + internal procedure Initialize(NewODataFieldName: Text; NewEdmType: Text; NewFilterCollectionNode: DotNet FilterCollectionNode; NewEditInExcelFieldFilter: Codeunit "Edit in Excel Fld Filter Impl.") begin FilterCollectionNode := NewFilterCollectionNode; EditInExcelFieldFilter := NewEditInExcelFieldFilter; @@ -42,6 +43,12 @@ codeunit 1492 "Edit in Excel Fld Filter Impl." implements "Edit in Excel Field F exit(EditInExcelFieldFilter); // Reference back to self to allow builder pattern end; + procedure AddFilterValueV2(EditInExcelFilterType: Enum "Edit in Excel Filter Type"; FilterValue: Text): Interface "Edit in Excel Field Filter V2" + begin + AddFieldFilterValue(EditInExcelFilterType, FilterValue); + exit(EditInExcelFieldFilter); // Reference back to self to allow builder pattern + end; + procedure Get(Index: Integer; var EditinExcelFilterType: Enum "Edit in Excel Filter Type"; var FilterValue: Text) var ExcelFilterNodeType: Enum "Excel Filter Node Type"; @@ -53,6 +60,11 @@ codeunit 1492 "Edit in Excel Fld Filter Impl." implements "Edit in Excel Field F FilterValue := FilterBinaryNode.Right; end; + procedure Remove(Index: Integer) + begin + FilterCollectionNode.Collection.RemoveAt(Index); + end; + procedure GetCollectionType(): Enum "Edit in Excel Filter Collection Type" var TempString: DotNet String; @@ -63,11 +75,6 @@ codeunit 1492 "Edit in Excel Fld Filter Impl." implements "Edit in Excel Field F exit("Edit in Excel Filter Collection Type"::"and") end; - procedure Remove(Index: Integer) - begin - FilterCollectionNode.Collection.RemoveAt(Index); - end; - procedure Count(): Integer begin exit(FilterCollectionNode.Collection.Count()); diff --git a/src/System Application/Test/Edit in Excel/src/EditInExcelFiltersTest.Codeunit.al b/src/System Application/Test/Edit in Excel/src/EditInExcelFiltersTest.Codeunit.al index bf0d76b15d..1ce2477e65 100644 --- a/src/System Application/Test/Edit in Excel/src/EditInExcelFiltersTest.Codeunit.al +++ b/src/System Application/Test/Edit in Excel/src/EditInExcelFiltersTest.Codeunit.al @@ -21,7 +21,7 @@ codeunit 132526 "Edit in Excel Filters Test" procedure TestEditInExcelFieldFilterGetCollectionTypeReturnsCorrectAndOperator() var EditinExcelFilters: Codeunit "Edit in Excel Filters"; - EditInExcelFilter: Interface "Edit in Excel Field Filter"; + EditInExcelFilter: Interface "Edit in Excel Field Filter v2"; FieldName: Text; EditInExcelFilterCollectionType: Enum "Edit in Excel Filter Collection Type"; begin @@ -31,7 +31,7 @@ codeunit 132526 "Edit in Excel Filters Test" EditinExcelFilters.Get(FieldName).AddFilterValue(Enum::"Edit in Excel Filter Type"::Equal, '10000'); EditinExcelFilters.Get(FieldName).AddFilterValue(Enum::"Edit in Excel Filter Type"::Equal, '10001'); - EditInExcelFilter := EditinExcelFilters.Get(FieldName); + EditInExcelFilter := EditinExcelFilters.GetV2(FieldName); EditInExcelFilterCollectionType := EditInExcelFilter.GetCollectionType(); LibraryAssert.AreEqual("Edit in Excel Filter Collection Type"::"and", EditInExcelFilterCollectionType, 'Field filter created with an AND operator should have a collection type of AND.') end; @@ -40,7 +40,7 @@ codeunit 132526 "Edit in Excel Filters Test" procedure TestEditInExcelFieldFilterGetCollectionTypeReturnsCorrectOrOperator() var EditinExcelFilters: Codeunit "Edit in Excel Filters"; - EditInExcelFilter: Interface "Edit in Excel Field Filter"; + EditInExcelFilter: Interface "Edit in Excel Field Filter v2"; FieldName: Text; EditInExcelFilterCollectionType: Enum "Edit in Excel Filter Collection Type"; begin @@ -50,7 +50,7 @@ codeunit 132526 "Edit in Excel Filters Test" EditinExcelFilters.Get(FieldName).AddFilterValue(Enum::"Edit in Excel Filter Type"::Equal, '10000'); EditinExcelFilters.Get(FieldName).AddFilterValue(Enum::"Edit in Excel Filter Type"::Equal, '10001'); - EditInExcelFilter := EditinExcelFilters.Get(FieldName); + EditInExcelFilter := EditinExcelFilters.GetV2(FieldName); EditInExcelFilterCollectionType := EditInExcelFilter.GetCollectionType(); LibraryAssert.AreEqual("Edit in Excel Filter Collection Type"::"or", EditInExcelFilterCollectionType, 'Field filter created with an OR operator should have a collection type of OR.') end; From 7dda472ebd271b5162b8f727f680c7e0995458fa Mon Sep 17 00:00:00 2001 From: Matti Nielsen Date: Fri, 5 Apr 2024 16:01:29 +0200 Subject: [PATCH 06/11] Change a bit more --- .../Filters/EditInExcelFilters.Codeunit.al | 24 +++++++++++++++++++ .../EditInExcelFiltersImpl.Codeunit.al | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFilters.Codeunit.al b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFilters.Codeunit.al index ceb6089114..001e231c30 100644 --- a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFilters.Codeunit.al +++ b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFilters.Codeunit.al @@ -29,6 +29,11 @@ codeunit 1490 "Edit in Excel Filters" exit(EditinExcelFiltersImpl.AddField(ODataFieldName, "Edit in Excel Filter Collection Type"::"and", EditInExcelEdmType)); end; + /// + /// Add the specified field using 'and' collection type. + /// + /// The OData name of the field referenced. + /// The Edm type of the OData field as specified in the $metadata document. procedure AddFieldV2(ODataFieldName: Text; EditInExcelEdmType: Enum "Edit in Excel Edm Type"): Interface "Edit in Excel Field Filter v2" begin exit(EditinExcelFiltersImpl.AddField(ODataFieldName, "Edit in Excel Filter Collection Type"::"and", EditInExcelEdmType)); @@ -45,6 +50,12 @@ codeunit 1490 "Edit in Excel Filters" exit(EditinExcelFiltersImpl.AddField(ODataFieldName, EditInExcelFilterOperatorType, EditInExcelEdmType)); end; + /// + /// Add the specified field with a specified collection type. + /// + /// The OData name of the field referenced. + /// Specifies whether filters for this field have 'and' or 'or', such as Field1 = a|b|c (or operator) or Field1 = <a&>b>amp;>c (and operator). Both operators for the same field is currently not supported. + /// The Edm type of the OData field as specified in the $metadata document. procedure AddFieldV2(ODataFieldName: Text; EditInExcelFilterOperatorType: Enum "Edit in Excel Filter Collection Type"; EditInExcelEdmType: Enum "Edit in Excel Edm Type"): Interface "Edit in Excel Field Filter V2" begin exit(EditinExcelFiltersImpl.AddField(ODataFieldName, EditInExcelFilterOperatorType, EditInExcelEdmType)); @@ -63,6 +74,14 @@ codeunit 1490 "Edit in Excel Filters" EditinExcelFiltersImpl.AddField(ODataFieldName, EditInExcelFilterType, FilterValue, EditInExcelEdmType); end; + /// + /// Add the specified field with an initial value using 'and' collection type. + /// This is mainly intended for fields that only filter on a single value. + /// + /// The OData name of the field referenced. + /// The filter type, such as Equal, Greater than etc. + /// The value which the field should be Equal to, Greater than etc. + /// The Edm type of the OData field as specified in the $metadata document. procedure AddFieldV2(ODataFieldName: Text; EditInExcelFilterType: Enum "Edit in Excel Filter Type"; FilterValue: Text; EditInExcelEdmType: Enum "Edit in Excel Edm Type") begin EditinExcelFiltersImpl.AddField(ODataFieldName, EditInExcelFilterType, FilterValue, EditInExcelEdmType); @@ -78,6 +97,11 @@ codeunit 1490 "Edit in Excel Filters" exit(EditinExcelFiltersImpl.Get(ODataFieldName)); end; + /// + /// Get the field filters for the specified field. + /// + /// The OData name of the field referenced. + /// procedure GetV2(ODataFieldName: Text): Interface "Edit in Excel Field Filter V2" begin exit(EditinExcelFiltersImpl.Get(ODataFieldName)); diff --git a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFiltersImpl.Codeunit.al b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFiltersImpl.Codeunit.al index 9d3e530206..a1f2e70eb8 100644 --- a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFiltersImpl.Codeunit.al +++ b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFiltersImpl.Codeunit.al @@ -39,7 +39,7 @@ codeunit 1491 "Edit in Excel Filters Impl." exit(Get(ODataFieldName)); end; - procedure AddField(ODataFieldName: Text; EditInExcelFilterType: Enum "Edit in Excel Filter Type"; FilterValue: Text; EditInExcelEdmType: Enum "Edit in Excel Edm Type") EditinExcelFieldFilter: Interface "Edit in Excel Field Filter" + procedure AddField(ODataFieldName: Text; EditInExcelFilterType: Enum "Edit in Excel Filter Type"; FilterValue: Text; EditInExcelEdmType: Enum "Edit in Excel Edm Type") EditinExcelFieldFilter: Codeunit "Edit in Excel Fld Filter Impl." begin EditinExcelFieldFilter := AddField(ODataFieldName, "Edit in Excel Filter Collection Type"::"and", EditInExcelEdmType); Get(ODataFieldName).AddFilterValue(EditInExcelFilterType, FilterValue); From 809e1a854c129af216b02fd4e01a2d34dd603d18 Mon Sep 17 00:00:00 2001 From: Matti Nielsen Date: Fri, 5 Apr 2024 16:18:55 +0200 Subject: [PATCH 07/11] Add IF NOT CLEAN25 directives to old code --- .../EditInExcelFieldFilter.Interface.al | 12 +++++++++ .../Filters/EditInExcelFilters.Codeunit.al | 26 +++++++++---------- .../EditInExcelFiltersImpl.Codeunit.al | 4 +-- .../EditInExcelFldFilterImpl.Codeunit.al | 5 ++++ 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilter.Interface.al b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilter.Interface.al index b9ee590af2..dc41a3c07f 100644 --- a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilter.Interface.al +++ b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilter.Interface.al @@ -1,3 +1,4 @@ +#if not CLEAN25 // ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -11,13 +12,23 @@ namespace System.Integration.Excel; interface "Edit in Excel Field Filter" { Access = Public; +#if not CLEAN25 + ObsoleteState = Pending; + ObsoleteTag = '25.0'; +#else + ObsoleteState = Removed; + ObsoleteTag = '28.0'; +#endif + ObsoleteReason = 'Replaced by "Edit in Excel Field Filter v2" with support for getting the collection type of the filter.'; /// /// Add a filter value /// /// The filter type, such as Equal, Greater than. /// The value which the field should be Equal to, Greater than etc. +#pragma warning disable AL0432 procedure AddFilterValue(EditInExcelFilterType: Enum "Edit in Excel Filter Type"; FilterValue: Text): Interface "Edit in Excel Field Filter" +#pragma warning restore AL0432 /// /// Get a specific filter @@ -39,3 +50,4 @@ interface "Edit in Excel Field Filter" /// The number of filters procedure Count(): Integer } +#endif \ No newline at end of file diff --git a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFilters.Codeunit.al b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFilters.Codeunit.al index 001e231c30..3bc467fe83 100644 --- a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFilters.Codeunit.al +++ b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFilters.Codeunit.al @@ -19,15 +19,20 @@ codeunit 1490 "Edit in Excel Filters" var EditinExcelFiltersImpl: Codeunit "Edit in Excel Filters Impl."; + +#if not CLEAN25 /// /// Add the specified field using 'and' collection type. /// /// The OData name of the field referenced. /// The Edm type of the OData field as specified in the $metadata document. +#pragma warning disable AL0432 procedure AddField(ODataFieldName: Text; EditInExcelEdmType: Enum "Edit in Excel Edm Type"): Interface "Edit in Excel Field Filter" +#pragma warning restore AL0432 begin exit(EditinExcelFiltersImpl.AddField(ODataFieldName, "Edit in Excel Filter Collection Type"::"and", EditInExcelEdmType)); end; +#endif /// /// Add the specified field using 'and' collection type. @@ -39,16 +44,20 @@ codeunit 1490 "Edit in Excel Filters" exit(EditinExcelFiltersImpl.AddField(ODataFieldName, "Edit in Excel Filter Collection Type"::"and", EditInExcelEdmType)); end; +#if not CLEAN25 /// /// Add the specified field with a specified collection type. /// /// The OData name of the field referenced. /// Specifies whether filters for this field have 'and' or 'or', such as Field1 = a|b|c (or operator) or Field1 = <a&>b>amp;>c (and operator). Both operators for the same field is currently not supported. /// The Edm type of the OData field as specified in the $metadata document. +#pragma warning disable AL0432 procedure AddField(ODataFieldName: Text; EditInExcelFilterOperatorType: Enum "Edit in Excel Filter Collection Type"; EditInExcelEdmType: Enum "Edit in Excel Edm Type"): Interface "Edit in Excel Field Filter" +#pragma warning restore AL0432 begin exit(EditinExcelFiltersImpl.AddField(ODataFieldName, EditInExcelFilterOperatorType, EditInExcelEdmType)); end; +#endif /// /// Add the specified field with a specified collection type. @@ -74,28 +83,19 @@ codeunit 1490 "Edit in Excel Filters" EditinExcelFiltersImpl.AddField(ODataFieldName, EditInExcelFilterType, FilterValue, EditInExcelEdmType); end; - /// - /// Add the specified field with an initial value using 'and' collection type. - /// This is mainly intended for fields that only filter on a single value. - /// - /// The OData name of the field referenced. - /// The filter type, such as Equal, Greater than etc. - /// The value which the field should be Equal to, Greater than etc. - /// The Edm type of the OData field as specified in the $metadata document. - procedure AddFieldV2(ODataFieldName: Text; EditInExcelFilterType: Enum "Edit in Excel Filter Type"; FilterValue: Text; EditInExcelEdmType: Enum "Edit in Excel Edm Type") - begin - EditinExcelFiltersImpl.AddField(ODataFieldName, EditInExcelFilterType, FilterValue, EditInExcelEdmType); - end; - +#if not CLEAN25 /// /// Get the field filters for the specified field. /// /// The OData name of the field referenced. /// +#pragma warning disable AL0432 procedure Get(ODataFieldName: Text): Interface "Edit in Excel Field Filter" +#pragma warning restore AL0432 begin exit(EditinExcelFiltersImpl.Get(ODataFieldName)); end; +#endif /// /// Get the field filters for the specified field. diff --git a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFiltersImpl.Codeunit.al b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFiltersImpl.Codeunit.al index a1f2e70eb8..0751ca2313 100644 --- a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFiltersImpl.Codeunit.al +++ b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFiltersImpl.Codeunit.al @@ -42,7 +42,7 @@ codeunit 1491 "Edit in Excel Filters Impl." procedure AddField(ODataFieldName: Text; EditInExcelFilterType: Enum "Edit in Excel Filter Type"; FilterValue: Text; EditInExcelEdmType: Enum "Edit in Excel Edm Type") EditinExcelFieldFilter: Codeunit "Edit in Excel Fld Filter Impl." begin EditinExcelFieldFilter := AddField(ODataFieldName, "Edit in Excel Filter Collection Type"::"and", EditInExcelEdmType); - Get(ODataFieldName).AddFilterValue(EditInExcelFilterType, FilterValue); + Get(ODataFieldName).AddFilterValueV2(EditInExcelFilterType, FilterValue); end; procedure Get(ODataFieldName: Text): Codeunit "Edit in Excel Fld Filter Impl." @@ -137,7 +137,7 @@ codeunit 1491 "Edit in Excel Filters Impl." Session.LogMessage('0000I3X', FilterContainsMultipleOperatorsTxt, Verbosity::Warning, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', EditInExcelTelemetryCategoryTxt); exit; // OData does not support filtering on a field with both 'and' and 'or' hence if we see both, ignore the second type end; - Get(ODataFieldName).AddFilterValue(EditinExcelFilterType, FilterValue); + Get(ODataFieldName).AddFilterValueV2(EditinExcelFilterType, FilterValue); end; end; end; diff --git a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFldFilterImpl.Codeunit.al b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFldFilterImpl.Codeunit.al index f98ecec3c1..c4973856f0 100644 --- a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFldFilterImpl.Codeunit.al +++ b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFldFilterImpl.Codeunit.al @@ -37,11 +37,16 @@ codeunit 1492 "Edit in Excel Fld Filter Impl." implements "Edit in Excel Field F EdmType := NewEdmType; end; +#if not CLEAN25 +#pragma warning disable AL0432 + [Obsolete('Use AddFilterValueV2 instead, returns interface "Edit in Excel Field Filter" instead which supports getting filter collection type', '25.0')] procedure AddFilterValue(EditInExcelFilterType: Enum "Edit in Excel Filter Type"; FilterValue: Text): Interface "Edit in Excel Field Filter" +#pragma warning restore AL0432 begin AddFieldFilterValue(EditInExcelFilterType, FilterValue); exit(EditInExcelFieldFilter); // Reference back to self to allow builder pattern end; +#endif procedure AddFilterValueV2(EditInExcelFilterType: Enum "Edit in Excel Filter Type"; FilterValue: Text): Interface "Edit in Excel Field Filter V2" begin From 943d0f1004f288d2c7b020787892481022acdf2b Mon Sep 17 00:00:00 2001 From: Matti Nielsen Date: Fri, 5 Apr 2024 16:26:17 +0200 Subject: [PATCH 08/11] Rename the remaining AddField overload to also contain V2, to be more consistent --- .../src/Filters/EditInExcelFilters.Codeunit.al | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFilters.Codeunit.al b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFilters.Codeunit.al index 3bc467fe83..ecc4f5c758 100644 --- a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFilters.Codeunit.al +++ b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFilters.Codeunit.al @@ -70,6 +70,7 @@ codeunit 1490 "Edit in Excel Filters" exit(EditinExcelFiltersImpl.AddField(ODataFieldName, EditInExcelFilterOperatorType, EditInExcelEdmType)); end; +#if not CLEAN25 /// /// Add the specified field with an initial value using 'and' collection type. /// This is mainly intended for fields that only filter on a single value. @@ -82,6 +83,20 @@ codeunit 1490 "Edit in Excel Filters" begin EditinExcelFiltersImpl.AddField(ODataFieldName, EditInExcelFilterType, FilterValue, EditInExcelEdmType); end; +#endif + + /// + /// Add the specified field with an initial value using 'and' collection type. + /// This is mainly intended for fields that only filter on a single value. + /// + /// The OData name of the field referenced. + /// The filter type, such as Equal, Greater than etc. + /// The value which the field should be Equal to, Greater than etc. + /// The Edm type of the OData field as specified in the $metadata document. + procedure AddFieldV2(ODataFieldName: Text; EditInExcelFilterType: Enum "Edit in Excel Filter Type"; FilterValue: Text; EditInExcelEdmType: Enum "Edit in Excel Edm Type") + begin + EditinExcelFiltersImpl.AddField(ODataFieldName, EditInExcelFilterType, FilterValue, EditInExcelEdmType); + end; #if not CLEAN25 /// From 8374f6ad4e18803568b12280d56d273cc2ff2b44 Mon Sep 17 00:00:00 2001 From: Matti Nielsen Date: Mon, 8 Apr 2024 10:49:08 +0200 Subject: [PATCH 09/11] Add obsoletion tags --- .../src/Filters/EditInExcelFieldFilter.Interface.al | 6 +----- .../src/Filters/EditInExcelFilters.Codeunit.al | 4 ++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilter.Interface.al b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilter.Interface.al index dc41a3c07f..fcbfb9dbde 100644 --- a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilter.Interface.al +++ b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFieldFilter.Interface.al @@ -12,13 +12,9 @@ namespace System.Integration.Excel; interface "Edit in Excel Field Filter" { Access = Public; -#if not CLEAN25 + ObsoleteState = Pending; ObsoleteTag = '25.0'; -#else - ObsoleteState = Removed; - ObsoleteTag = '28.0'; -#endif ObsoleteReason = 'Replaced by "Edit in Excel Field Filter v2" with support for getting the collection type of the filter.'; /// diff --git a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFilters.Codeunit.al b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFilters.Codeunit.al index ecc4f5c758..693aca0ba6 100644 --- a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFilters.Codeunit.al +++ b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFilters.Codeunit.al @@ -26,6 +26,7 @@ codeunit 1490 "Edit in Excel Filters" /// /// The OData name of the field referenced. /// The Edm type of the OData field as specified in the $metadata document. + [Obsolete('Use AddFieldV2 instead.', '25.0')] #pragma warning disable AL0432 procedure AddField(ODataFieldName: Text; EditInExcelEdmType: Enum "Edit in Excel Edm Type"): Interface "Edit in Excel Field Filter" #pragma warning restore AL0432 @@ -51,6 +52,7 @@ codeunit 1490 "Edit in Excel Filters" /// The OData name of the field referenced. /// Specifies whether filters for this field have 'and' or 'or', such as Field1 = a|b|c (or operator) or Field1 = <a&>b>amp;>c (and operator). Both operators for the same field is currently not supported. /// The Edm type of the OData field as specified in the $metadata document. + [Obsolete('Use AddFieldV2 instead.', '25.0')] #pragma warning disable AL0432 procedure AddField(ODataFieldName: Text; EditInExcelFilterOperatorType: Enum "Edit in Excel Filter Collection Type"; EditInExcelEdmType: Enum "Edit in Excel Edm Type"): Interface "Edit in Excel Field Filter" #pragma warning restore AL0432 @@ -79,6 +81,7 @@ codeunit 1490 "Edit in Excel Filters" /// The filter type, such as Equal, Greater than etc. /// The value which the field should be Equal to, Greater than etc. /// The Edm type of the OData field as specified in the $metadata document. + [Obsolete('Use AddFieldV2 instead.', '25.0')] procedure AddField(ODataFieldName: Text; EditInExcelFilterType: Enum "Edit in Excel Filter Type"; FilterValue: Text; EditInExcelEdmType: Enum "Edit in Excel Edm Type") begin EditinExcelFiltersImpl.AddField(ODataFieldName, EditInExcelFilterType, FilterValue, EditInExcelEdmType); @@ -104,6 +107,7 @@ codeunit 1490 "Edit in Excel Filters" /// /// The OData name of the field referenced. /// + [Obsolete('Use GetV2 instead.', '25.0')] #pragma warning disable AL0432 procedure Get(ODataFieldName: Text): Interface "Edit in Excel Field Filter" #pragma warning restore AL0432 From a29896578298f1c1b334105679dcd8cd0ed5d88f Mon Sep 17 00:00:00 2001 From: Matti Nielsen Date: Mon, 8 Apr 2024 11:59:09 +0200 Subject: [PATCH 10/11] Delete redundant EOL --- .../src/Filters/EditInExcelFldFilterImpl.Codeunit.al | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFldFilterImpl.Codeunit.al b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFldFilterImpl.Codeunit.al index c4973856f0..69bee914e2 100644 --- a/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFldFilterImpl.Codeunit.al +++ b/src/System Application/App/Edit in Excel/src/Filters/EditInExcelFldFilterImpl.Codeunit.al @@ -103,4 +103,4 @@ codeunit 1492 "Edit in Excel Fld Filter Impl." implements "Edit in Excel Field F FilterCollectionNode.Collection.Add(FilterBinaryNode); end; -} +} \ No newline at end of file From 266fd76b045c6001a95ee3233cc5417fe1d392f1 Mon Sep 17 00:00:00 2001 From: Matti Nielsen Date: Mon, 8 Apr 2024 12:42:06 +0200 Subject: [PATCH 11/11] Change the system app test library to use new interface --- .../src/EditInExcelFiltersTest.Codeunit.al | 12 ++++++------ .../Edit in Excel/src/EditInExcelTest.Codeunit.al | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/System Application/Test/Edit in Excel/src/EditInExcelFiltersTest.Codeunit.al b/src/System Application/Test/Edit in Excel/src/EditInExcelFiltersTest.Codeunit.al index 1ce2477e65..405bef8c48 100644 --- a/src/System Application/Test/Edit in Excel/src/EditInExcelFiltersTest.Codeunit.al +++ b/src/System Application/Test/Edit in Excel/src/EditInExcelFiltersTest.Codeunit.al @@ -27,9 +27,9 @@ codeunit 132526 "Edit in Excel Filters Test" begin FieldName := 'No_'; - EditinExcelFilters.AddField(FieldName, "Edit in Excel Filter Collection Type"::"and", Enum::"Edit in Excel Edm Type"::"Edm.String"); - EditinExcelFilters.Get(FieldName).AddFilterValue(Enum::"Edit in Excel Filter Type"::Equal, '10000'); - EditinExcelFilters.Get(FieldName).AddFilterValue(Enum::"Edit in Excel Filter Type"::Equal, '10001'); + EditinExcelFilters.AddFieldV2(FieldName, "Edit in Excel Filter Collection Type"::"and", Enum::"Edit in Excel Edm Type"::"Edm.String"); + EditinExcelFilters.GetV2(FieldName).AddFilterValueV2(Enum::"Edit in Excel Filter Type"::Equal, '10000'); + EditinExcelFilters.GetV2(FieldName).AddFilterValueV2(Enum::"Edit in Excel Filter Type"::Equal, '10001'); EditInExcelFilter := EditinExcelFilters.GetV2(FieldName); EditInExcelFilterCollectionType := EditInExcelFilter.GetCollectionType(); @@ -46,9 +46,9 @@ codeunit 132526 "Edit in Excel Filters Test" begin FieldName := 'No_'; - EditinExcelFilters.AddField(FieldName, "Edit in Excel Filter Collection Type"::"or", Enum::"Edit in Excel Edm Type"::"Edm.String"); - EditinExcelFilters.Get(FieldName).AddFilterValue(Enum::"Edit in Excel Filter Type"::Equal, '10000'); - EditinExcelFilters.Get(FieldName).AddFilterValue(Enum::"Edit in Excel Filter Type"::Equal, '10001'); + EditinExcelFilters.AddFieldV2(FieldName, "Edit in Excel Filter Collection Type"::"or", Enum::"Edit in Excel Edm Type"::"Edm.String"); + EditinExcelFilters.GetV2(FieldName).AddFilterValueV2(Enum::"Edit in Excel Filter Type"::Equal, '10000'); + EditinExcelFilters.GetV2(FieldName).AddFilterValueV2(Enum::"Edit in Excel Filter Type"::Equal, '10001'); EditInExcelFilter := EditinExcelFilters.GetV2(FieldName); EditInExcelFilterCollectionType := EditInExcelFilter.GetCollectionType(); diff --git a/src/System Application/Test/Edit in Excel/src/EditInExcelTest.Codeunit.al b/src/System Application/Test/Edit in Excel/src/EditInExcelTest.Codeunit.al index d5502b0899..73018fceb8 100644 --- a/src/System Application/Test/Edit in Excel/src/EditInExcelTest.Codeunit.al +++ b/src/System Application/Test/Edit in Excel/src/EditInExcelTest.Codeunit.al @@ -36,7 +36,7 @@ codeunit 132525 "Edit in Excel Test" TenantWebService.SetRange("Object ID", Page::"Edit in Excel List"); TenantWebService.DeleteAll(); - EditinExcelFilters.AddField('Id', Enum::"Edit in Excel Filter Type"::Equal, 'test', Enum::"Edit in Excel Edm Type"::"Edm.String"); + EditinExcelFilters.AddFieldV2('Id', Enum::"Edit in Excel Filter Type"::Equal, 'test', Enum::"Edit in Excel Edm Type"::"Edm.String"); EditInExcel.EditPageInExcel(CopyStr(EditInExcelList.Caption, 1, 240), Page::"Edit in Excel List", EditinExcelFilters);