Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to use PredicateBuilder on early bound queries for Active record state? error: Invalid 'where' condition. An entity member is invoking an invalid property or method

Posted on by Microsoft Employee

Hi,

Why can this not be used in crm queries?

+ $exception {"Invalid 'where' condition. An entity member is invoking an invalid property or method."} System.NotSupportedException

J.

var predicate = PredicateBuilder.True<Contact>();
predicate = predicate.And(p => p.statecode == (int)ContactState.Active);

var x = serviceContext.ContactSet.Where(predicate);

Predicate builder used from:

http://www.albahari.com/nutshell/predicatebuilder.aspx 

*This post is locked for comments

  • Suggested answer
    prt33k Profile Picture
    prt33k 6,907 on at
    RE: How to use PredicateBuilder on early bound queries for Active record state? error: Invalid 'where' condition. An entity member is invoking an invalid property or method

    In Dynamics CRM, the LINQ query provider supports a subset of the LINQ operators. Not all conditions that can be expressed in LINQ are supported.

    msdn.microsoft.com/.../gg328328.aspx

    Prateek

Under review

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

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,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans