Skip to content

[BUG] DataExchange query failed on nullable DateTime. #1066

@kuh0005

Description

@kuh0005

Issue summary
DataExchange query fails when filtering on a nullable DateTime field.

Error
System.InvalidCastException: Invalid cast from 'System.DateTime' to 'System.Nullable<System.DateTime>'

What happens
During query filter execution, the predicate builder attempts to convert a DateTime value to Nullable, which causes an invalid cast and crashes the Blazor circuit.

Relevant stack trace

System.Convert.DefaultToType(...)

AXOpen.Data.Query.PredicateBuilder.BuildLambdaPredicate(...)

AXOpen.Data.Query.QueryExtensions.AddQuerySymbolToPredicates(...)

AXOpen.Data.Query.DataExchangeQuery.ExecuteFilter()

AXOpen.Data.Query.DataExchangeQuery...BuildRenderTree...

Microsoft.AspNetCore.Components...

Likely cause
The query layer does not correctly handle nullable DateTime properties when building filter predicates. It appears to treat the target type as Nullable but performs conversion as if it were a direct cast from DateTime.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentationquestionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions