GetFilterListValues fails at 2024.9 on taginput field

In a lazily-loaded screen, I turn on filters on the master screen section. I started to filter by a guid column. Then I tried to expand list of possible values (click on + icon) on a taginput field.

I was expecting to get all relevant values that leads to at least one result when selected

Instead I’ve got an error:


2024-12-04 11:45:56,512 [63] ERROR Origam.Server.Controller.AbstractController - Sequence contains no matching element
System.InvalidOperationException: Sequence contains no matching element
   at System.Linq.ThrowHelper.ThrowNoMatchException()
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
   at Origam.DA.Service.AbstractSqlCommandGenerator.SetColumnExpressions(ICustomCommandParser commandParser, Dictionary`2 lookUps, Boolean isInRecursion, DataStructureEntity entity, DataStructure ds, Hashtable replaceParameterTexts, Hashtable selectParameterReferences, Hashtable dynamicParameters, IEnumerable`1 dataStructureColumns, ColumnsInfo columnsInfo) in C:\Users\urbanek\Desktop\leco\origam-server\backend\Origam.DA.Service\Generators\AbstractSqlCommandGenerator.cs:line 2083
   at Origam.DA.Service.AbstractSqlCommandGenerator.RenderSelectColumns(SelectParameters selectParameters, StringBuilder sqlExpression, StringBuilder orderByBuilder, StringBuilder groupByBuilder, Hashtable replaceParameterTexts, Hashtable selectParameterReferences, Boolean isInRecursion, Boolean concatScalarColumns, Boolean forceDatabaseCalculation, FilterCommandParser filterCommandParser, OrderByCommandParser orderByCommandParser) in C:\Users\urbanek\Desktop\leco\origam-server\backend\Origam.DA.Service\Generators\AbstractSqlCommandGenerator.cs:line 1951
   at Origam.DA.Service.AbstractSqlCommandGenerator.SelectSql(SelectParameters selectParameters, Hashtable replaceParameterTexts, Hashtable selectParameterReferences, Boolean restrictScalarToTop1, Boolean isInRecursion, Boolean forceDatabaseCalculation, FilterCommandParser filterCommandParser, OrderByCommandParser orderByCommandParser) in C:\Users\urbanek\Desktop\leco\origam-server\backend\Origam.DA.Service\Generators\AbstractSqlCommandGenerator.cs:line 1032
   at Origam.DA.Service.AbstractSqlCommandGenerator.BuildCommands(IDbDataAdapter adapter, SelectParameters selectParameters, Boolean forceDatabaseCalculation) in C:\Users\urbanek\Desktop\leco\origam-server\backend\Origam.DA.Service\Generators\AbstractSqlCommandGenerator.cs:line 335
   at Origam.DA.Service.AbstractSqlCommandGenerator.CreateDataAdapter(SelectParameters adParameters, Boolean forceDatabaseCalculation) in C:\Users\urbanek\Desktop\leco\origam-server\backend\Origam.DA.Service\Generators\AbstractSqlCommandGenerator.cs:line 164
   at Origam.DA.Service.AbstractDataService.GetAdapterNonCached(SelectParameters adParameters) in C:\Users\urbanek\Desktop\leco\origam-server\backend\Origam.DA.Service\AbstractDataService.cs:line 197
   at Origam.DA.Service.AbstractDataService.GetAdapter(SelectParameters selectParameters, UserProfile userProfile) in C:\Users\urbanek\Desktop\leco\origam-server\backend\Origam.DA.Service\AbstractDataService.cs:line 139
   at Origam.DA.Service.AbstractSqlDataService.ExecuteDataReader(DataStructureQuery query, IPrincipal principal, String transactionId) in C:\Users\urbanek\Desktop\leco\origam-server\backend\Origam.DA.Service\AbstractSqlDataService.cs:line 1699
   at Origam.DA.Service.AbstractSqlDataService.ExecuteDataReaderInternal(DataStructureQuery query)+MoveNext() in C:\Users\urbanek\Desktop\leco\origam-server\backend\Origam.DA.Service\AbstractSqlDataService.cs:line 1789
   at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
   at Origam.Server.Controller.UIServiceController.StreamlineFilterListValues(IEnumerable`1 fullReaderResult) in C:\Users\urbanek\Desktop\leco\origam-server\backend\Origam.Server\Controller\UIServiceController.cs:line 758
   at CSharpFunctionalExtensions.ResultExtensions.Bind[T,K,E](Result`2 result, Func`2 func)
   at Origam.Server.Controller.UIServiceController.<>c__DisplayClass62_0.<GetFilterListValues>b__0() in C:\Users\urbanek\Desktop\leco\origam-server\backend\Origam.Server\Controller\UIServiceController.cs:line 696
   at Origam.Server.Controller.AbstractController.<>c__DisplayClass9_0.<RunWithErrorHandler>g__AsynFunc|0() in C:\Users\urbanek\Desktop\leco\origam-server\backend\Origam.Server\Controller\AbstractController.cs:line 93
   at Origam.Server.Controller.AbstractController.RunWithErrorHandlerAsync(Func`1 func) in C:\Users\urbanek\Desktop\leco\origam-server\backend\Origam.Server\Controller\AbstractController.cs:line 111

There is yet another frontend problem. If the expanding values on taginputfield is done as the first action (without any other filter applied in advance), it works well. However, when another filter (e.g. on another integer, or guid field) is done afterwards and then expand taginput values again, it doesn’t call GetFilterListValues() again and just return all possible values, which is wrong (some values, when selected into taginput filter leads to empty result)

When I was trying to replicate the problem, I was unable to do so in master nor in 2024.9.3. When tested there on AllDataTypes - Lazily Loaded - it never send parameter “filter” (another filter) into GetFilterListValues() for a taginput, so it lists all possible values without respect to already selected value in Guid1 field and thus it can lead to empty result, which is wrong.

How to replicate

  • model-tests
  • run the following sql to insert test values

INSERT [dbo].[TagInputSource] ([Label], [RecordCreatedBy], [RecordUpdatedBy], [Id], [RecordCreated], [RecordUpdated], [Number]) VALUES (N'dva', N'69aacf26-300e-477b-b9a6-408324ca1cad', NULL, N'4cfb420c-b2dc-43c3-862c-99bbe5028fe3', CAST(N'2024-12-03T18:03:14.933' AS DateTime), NULL, 2)
INSERT [dbo].[TagInputSource] ([Label], [RecordCreatedBy], [RecordUpdatedBy], [Id], [RecordCreated], [RecordUpdated], [Number]) VALUES (N'tri', N'69aacf26-300e-477b-b9a6-408324ca1cad', NULL, N'b2b66ffb-dbbd-4d0d-bbf2-4a6d0747acb8', CAST(N'2024-12-03T18:03:30.087' AS DateTime), NULL, 3)
INSERT [dbo].[TagInputSource] ([Label], [RecordCreatedBy], [RecordUpdatedBy], [Id], [RecordCreated], [RecordUpdated], [Number]) VALUES (N'ctyri', N'69aacf26-300e-477b-b9a6-408324ca1cad', NULL, N'2dffa366-3f89-429b-8ff9-fc1833d6484b', CAST(N'2024-12-03T18:03:34.910' AS DateTime), NULL, 4)
INSERT [dbo].[TagInputSource] ([Label], [RecordCreatedBy], [RecordUpdatedBy], [Id], [RecordCreated], [RecordUpdated], [Number]) VALUES (N'jedna', N'69aacf26-300e-477b-b9a6-408324ca1cad', NULL, N'e4ac8dbc-b882-4c38-97be-d97b8678d92b', CAST(N'2024-12-04T08:18:21.140' AS DateTime), NULL, 1)
INSERT [dbo].[AllDataTypes] ([Text1], [Date1], [Integer1], [Currency1], [Boolean1], [Long1], [RecordCreatedBy], [RecordUpdatedBy], [Id], [RecordCreated], [RecordUpdated], [Text2], [refTagInputSourceId]) VALUES (N'3', NULL, 3, NULL, 0, NULL, N'69aacf26-300e-477b-b9a6-408324ca1cad', NULL, N'7c471c27-b106-43c7-bfe3-06651fc62449', CAST(N'2024-12-04T11:12:17.350' AS DateTime), NULL, NULL, N'b2b66ffb-dbbd-4d0d-bbf2-4a6d0747acb8')
INSERT [dbo].[AllDataTypes] ([Text1], [Date1], [Integer1], [Currency1], [Boolean1], [Long1], [RecordCreatedBy], [RecordUpdatedBy], [Id], [RecordCreated], [RecordUpdated], [Text2], [refTagInputSourceId]) VALUES (N'2', NULL, 2, NULL, 0, NULL, N'69aacf26-300e-477b-b9a6-408324ca1cad', N'69aacf26-300e-477b-b9a6-408324ca1cad', N'ca32528a-074c-4615-9009-0a9ce9c3843c', CAST(N'2024-12-04T11:10:59.823' AS DateTime), CAST(N'2024-12-04T11:12:10.477' AS DateTime), NULL, N'4cfb420c-b2dc-43c3-862c-99bbe5028fe3')
INSERT [dbo].[AllDataTypes] ([Text1], [Date1], [Integer1], [Currency1], [Boolean1], [Long1], [RecordCreatedBy], [RecordUpdatedBy], [Id], [RecordCreated], [RecordUpdated], [Text2], [refTagInputSourceId]) VALUES (N'2 a 3', NULL, 23, NULL, 0, NULL, N'69aacf26-300e-477b-b9a6-408324ca1cad', NULL, N'461777e9-2e3d-4f9e-be6c-6d19a35a5d12', CAST(N'2024-12-04T11:12:53.440' AS DateTime), NULL, NULL, NULL)
INSERT [dbo].[AllDataTypes] ([Text1], [Date1], [Integer1], [Currency1], [Boolean1], [Long1], [RecordCreatedBy], [RecordUpdatedBy], [Id], [RecordCreated], [RecordUpdated], [Text2], [refTagInputSourceId]) VALUES (N'1', NULL, 1, NULL, 0, NULL, N'69aacf26-300e-477b-b9a6-408324ca1cad', N'69aacf26-300e-477b-b9a6-408324ca1cad', N'c00c5ddc-a6a1-448b-9697-70d556ab78c8', CAST(N'2024-12-04T11:08:34.957' AS DateTime), CAST(N'2024-12-04T11:12:01.423' AS DateTime), NULL, N'e4ac8dbc-b882-4c38-97be-d97b8678d92b')
INSERT [dbo].[TagInputBinding] ([refAllDataTypesId], [refTagInputSourceId], [RecordCreatedBy], [RecordUpdatedBy], [Id], [RecordCreated], [RecordUpdated]) VALUES (N'7c471c27-b106-43c7-bfe3-06651fc62449', N'b2b66ffb-dbbd-4d0d-bbf2-4a6d0747acb8', N'69aacf26-300e-477b-b9a6-408324ca1cad', NULL, N'cc4b1e97-b08c-4e86-842f-cc7cb771b702', CAST(N'2024-12-04T11:12:33.173' AS DateTime), NULL)
INSERT [dbo].[TagInputBinding] ([refAllDataTypesId], [refTagInputSourceId], [RecordCreatedBy], [RecordUpdatedBy], [Id], [RecordCreated], [RecordUpdated]) VALUES (N'c00c5ddc-a6a1-448b-9697-70d556ab78c8', N'e4ac8dbc-b882-4c38-97be-d97b8678d92b', N'69aacf26-300e-477b-b9a6-408324ca1cad', NULL, N'2a752ba7-238b-4b1c-8cb5-8a40c9e5e915', CAST(N'2024-12-04T11:08:56.247' AS DateTime), NULL)
INSERT [dbo].[TagInputBinding] ([refAllDataTypesId], [refTagInputSourceId], [RecordCreatedBy], [RecordUpdatedBy], [Id], [RecordCreated], [RecordUpdated]) VALUES (N'ca32528a-074c-4615-9009-0a9ce9c3843c', N'4cfb420c-b2dc-43c3-862c-99bbe5028fe3', N'69aacf26-300e-477b-b9a6-408324ca1cad', NULL, N'db5770da-e266-49d2-bf7f-f2a52c52752e', CAST(N'2024-12-04T11:11:32.123' AS DateTime), NULL)
INSERT [dbo].[TagInputBinding] ([refAllDataTypesId], [refTagInputSourceId], [RecordCreatedBy], [RecordUpdatedBy], [Id], [RecordCreated], [RecordUpdated]) VALUES (N'461777e9-2e3d-4f9e-be6c-6d19a35a5d12', N'4cfb420c-b2dc-43c3-862c-99bbe5028fe3', N'69aacf26-300e-477b-b9a6-408324ca1cad', NULL, N'd20678cb-923f-4fde-be27-d0bd94d00eb9', CAST(N'2024-12-04T11:13:34.340' AS DateTime), NULL)
INSERT [dbo].[TagInputBinding] ([refAllDataTypesId], [refTagInputSourceId], [RecordCreatedBy], [RecordUpdatedBy], [Id], [RecordCreated], [RecordUpdated]) VALUES (N'461777e9-2e3d-4f9e-be6c-6d19a35a5d12', N'b2b66ffb-dbbd-4d0d-bbf2-4a6d0747acb8', N'69aacf26-300e-477b-b9a6-408324ca1cad', NULL, N'daf057f2-13e2-4a55-9425-b6fc1301116d', CAST(N'2024-12-04T11:13:34.340' AS DateTime), NULL)
  • open menu item All Data Types Lazy Loaded
  • turn on filters
  • in Guid1 field filter for the value ‘tri’
  • in TagInput field click on + button and it shows all the values regardless of already selected filter (Guid1=tri)
  • select dva and it will end up showing no record, which is wrong

The point here is, that in All Data Types Lazily loaded it doesn’t send filter parameter inside GetFilterListValues which is already selected. Neigheter master nor in 2024.9.3 (that is the same version as the version of production environment where it fails)

So it seems there is the second problem that it doesn’t send Filter parameter in GetFilterListValues() sometimes. Once the problem is solved, it would start failing the same way as in our production environment.

In the end, it doesn’t need any more special modelling to replicate. Everything is possible to do in the screen All Data Types Lazily loaded in the Widgets packages. Just run the SQL above to the database to fill the data.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.