Skip to content

Commit

Permalink
Fixed errors when using filters on party list fields
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMpn committed Dec 22, 2021
1 parent b0bcff2 commit 7bfb2d4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions MarkMpn.Sql4Cds.Engine/ExecutionPlan/BaseDataNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,10 @@ private bool TranslateFetchXMLCriteriaWithVirtualAttributes(EntityMetadata meta,
if (attribute != null && attributeSuffix == null && (op == @operator.like || op == @operator.notlike) && !(attribute.AttributeType == AttributeTypeCode.String || attribute.AttributeType == AttributeTypeCode.Memo))
return false;

// Can't fold queries on PartyList attributes
if (attribute != null && attribute.AttributeType == AttributeTypeCode.PartyList)
return false;

var value = literals == null ? null : literals.Length == 1 ? literals[0] is Literal l ? l.Value : literals[0] is VariableReference v ? v.Name : null : null;
var values = literals == null ? null : literals.Select(lit => new conditionValue { Value = lit is Literal lit1 ? lit1.Value : lit is VariableReference var1 ? var1.Name : null }).ToArray();
var entityAliases = new[] { entityAlias };
Expand Down
1 change: 1 addition & 0 deletions MarkMpn.Sql4Cds.Engine/MarkMpn.Sql4Cds.Engine.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Fixed GROUP BY and aggregates on virtual attributes
Fixed retrieving file attributes
Fixed GROUP BY and ORDER BY on multi-select picklist fields
Fixed errors when using LIKE queries on non-string fields
Fixed errors when using filters on party list fields
</releaseNotes>
<copyright>Copyright © 2020 Mark Carrington</copyright>
<language>en-GB</language>
Expand Down
1 change: 1 addition & 0 deletions MarkMpn.Sql4Cds/MarkMpn.SQL4CDS.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Fixed retrieving file attributes
Fixed using quoted identifiers
Fixed GROUP BY and ORDER BY on multi-select picklist fields
Fixed errors when using LIKE queries on non-string fields
Fixed errors when using filters on party list fields
</releaseNotes>
<copyright>Copyright © 2019 Mark Carrington</copyright>
<language>en-GB</language>
Expand Down

0 comments on commit 7bfb2d4

Please sign in to comment.