CRM 2011 LINQ: Invalid 'where condition. An entity member invokes an invalid property or method
I run the following LINQ query, but it throws an error with the message "Invalid" where condition. An entity member invokes an invalid property or method.
Can someone please tell me why this is happening. If I remove conn.Record2Id.LogicalName.Equals("account")
from WHERE
it returns the result, but I can see LogicalName = account in quick view
.
var connections = (from conn in context.CreateQuery<Connection>()
where (conn.Record1Id.Id.Equals(incidentId)
&& conn.Record2Id.LogicalName.Equals("account")
&& conn.StateCode == 0)
select conn).FirstOrDefault();
Thanks in Advance
+3
source to share
3 answers