Symptoms

oData query raises an error when you use a complex type field as a condition.

The following query will raise an error:

XRMServices/2011/OrganizationData.svc/AccountSet?$select=Name&$filter=PrimaryContactId/LogicalName%20ne%20null

Cause

This is a change from the Dynamics CRM 2011 beta release. In Dynamics CRM 2011 you cannot use complex type field as a condition. Please remove field name. For EntityReference, you are able to use Id field.

Resolution

Replace the query with either of the following to resolve the issue.

XRMServices/2011/OrganizationData.svc/AccountSet?$select=Name&$filter=PrimaryContactId%20ne%20null

Or

XRMServices/2011/OrganizationData.svc/AccountSet?$select=Name&$filter=PrimaryContactId/Id%20ne%20null

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

What affected your experience?

Thank you for your feedback!

×