Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Simple Join Query is not working

Posted on by 145

Hi , 

i have custom "class" entity which contains "course" lookup. in my code i have a list of course GUIDs  and i want to perform a join query between this list and classes records , but it's not working, this exception occurs : {"Invalid 'join' condition. An entity member is invoking an invalid property or method."}.

here is my code :

using (var orgContext = crmConnection.GetContext()){
    var w = (from c in orgContext.CreateQuery<New_class>()
             join courseId in courseIds on c.new_courseid.Id equals courseId
             select c).ToList();
}

courseIds is the list of course GUIDs

  • Khaled Rimawi Profile Picture
    Khaled Rimawi 145 on at
    RE: Simple Join Query is not working

    @Mahadeo , i think you mess understood what i want, i don't want to join classes records with courses records, i want to join them with list of static GUIDs that i have.

  • Suggested answer
    Mahadeo Matre Profile Picture
    Mahadeo Matre 17,021 on at
    RE: Simple Join Query is not working

    Hi..

    your query should be

    using (var orgContext = crmConnection.GetContext()){

       var w = (from c in orgContext.CreateQuery<New_class>()

                join course in orgContext.CreateQuery<New_course>() on c["new_courseid] equals course [new_courseid]

    "]

                select c).ToList();

    }

    you need to use entity names / table of course in query

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

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