Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)
Under review by Community Managers

Under review

Thank you for your post! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Invalid CRM 2011 LINQ Query: “Invalid 'where' condition. An entity member is invoking an invalid property or method.”

Posted on by Microsoft Employee

Hello

I am running the following LINQ query but it's throwing an error saying "Invalid ‘where’ condition. An entity member is invoking an invalid property or method."

                List PPLyonIds = new List();
                PPLyonIds = (from pp in context.CreateQuery()
                where nomsprenomscpdevtry.Contains(string.Concat(pp.nom.ToUpper(),pp.prenom.ToUpper()))
                select pp.Id).ToList();



                var listReponseUpdate = (from rep in context.CreateQuery()
                                         where PPLyonIds.Contains(rep.personne_physique_cible.Id) && rep.Id == Guid.Parse("4B90DEA4-680C-EA11-80FE-005056B14DD3") //Guid.Parse("02D8C217-9ABE-E911-80E4-005056B2DCF2")
                                         select rep).ToList();


                foreach (Reponse_de_campagne re in listReponseUpdate)

                {


                    try
                    {

                        logger.Debug("debut mise à jour de la réponse campagne");
                        Reponse_de_campagne reponsecampagne = new Reponse_de_campagne();
                        reponsecampagne.Id = re.Id;
                        reponsecampagne.rechercher(organisationProxy);
                        reponsecampagne.retour_souscription = true;
                        reponsecampagne.sauvegarder(organisationProxy);
                        logger.Debug("La personne physique sous ID"   re.personne_physique_cible.Id   " est mis à jour");


                    }

                    catch (Exception ex)
                    {
                        if (exceptions.ContainsKey(ex.Message))
                        {
                            //Erreur déjà rencontré
                            exceptions[ex.Message]  ;
                        }
                        else
                        {
                            logger.Error(ex.Message   "\n"   ex.StackTrace);
                            exceptions.Add(ex.Message, 1);
                        }
                    }
                }
     

Cordially

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,253 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans