NOTSUPPORTEDEXCEPTION: INVALID 'WHERE' CONDITION. AN ENTITY MEMBER IS INVOKING AN INVALID PROPERTY OR METHOD
Nuestro buen amigo Pablo Peralta nos comparte su artículo:
I want to share an odd exception I got today while trying a LINQ query within a Plugin through the LINQ query provider in Microsoft Dynamics CRM 2011.
When running the following query:
public static PriceLevel GetPriceLevel(string priceLevelName,
IOrganizationService organizationService) {
var crm = new Xrm.MyXrmServiceContext(organizationService);
var PriceLevelToreturn = crm.PriceLevelSet.Where
(p => priceLevelName.ToLower().Equals
(p.Name.ToLower()) ).FirstOrDefault();
return PriceLevelToreturn; }
.. I ran into the following Exception:
NotSupportedException: Invalid 'where' condition. An entity member is invoking an invalid property or method.
Saludos.
Fernando García Loera (Community Program Manager – Latin America Region)