When performing complex LINQ queries against CRM you might find that you need to perform a join across several entities. As soon as you introduce a join you might need to set up a where clause that dependants on certain conditions across your join. By this I simply mean you might need to perform the where query across multiple entities. Using a single where clause you cannot achieve this! For each entity you need where clauses, you need to add another where keyword.
Invalid ‘where’ condition. An entity member is invoking an invalid property or method.
Since CRM 2011 came out I have been working on a lot of Silverlight applications that interface with it. I haven’t really had the chance of using LINQ all to much to query CRM. The other day I found myself working on a plugin and creating a complex LINQ query, YAY! When it came to testing my query I recieved the following error message on execution “Invalid ‘where’ condition. An entity member is invoking an invalid property or method.”.
When Microsoft Dynamics CRM 2011 first came out the first new feature to excite me wasn’t any of the high profile changes. It was the ability to use LINQ to query CRM. Yeah, typical developer, I know… But the ability to reduce a crazy condition expression with many linked entities in to a few lines of tidy code, HEAVEN I tell you!
While developing Silverlight applications for Microsoft Dynamics CRM 2011 I’ve been hit with the same decision most developers have. REST or SOAP? Initially I decided on REST as I wanted to use LINQ to keep my codebase nice and tidy. However, it was clear from an early stage that I needed more control than the typical CRUD operations. So I switched to SOAP. How on earth do I send and receive the async requests!?