Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ContainsValues error #110

Closed
MarkMpn opened this issue Aug 17, 2021 · 0 comments
Closed

ContainsValues error #110

MarkMpn opened this issue Aug 17, 2021 · 0 comments

Comments

@MarkMpn
Copy link
Owner

MarkMpn commented Aug 17, 2021

From https://markcarrington.dev/2021/06/30/sql-4-cds-5-2-released/#comment-1378:

When building a query with FetchXMLBuilder and transferring it SQL4CDS, it builds something like this (sorry I’ve no example using default fields, so I filled in placeholder here)

WHERE <fieldname> = containvalues(778210018);

Executing gives error message:

Cannot convert System.Data.SqlTypes.SqlString to Microsoft.Xrm.Sdk.OptionSetValueCollection: containvalues(778210018)

In former versions of SQL4CDS it worked using contains instead of containvalues:

WHERE contains(<fieldname>, '778210001')

But this now gives an error message as well:

The value passed for ConditionOperator.ContainValues is empty. Attribute Name: ap_contact_role, Attribute Id: 9c8dbdd3-3bff-46ac-8e2a-9dee618c9113
System.ArgumentException: The value passed for ConditionOperator.ContainValues is empty. Attribute Name: ap_contact_role, Attribute Id: 9c8dbdd3-3bff-46ac-8e2a-9dee618c9113
See the Execution Plan tab for details of where this error occurred

The only working way I find at the moment is to do a string like on the field with postfix name:

WHERE <fieldname>name like '%Insurer%'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant