locked
linq error in CRM RRS feed

  • Question

  • hi,

    i am trying linq to fetch data from CRM.

    and when i use left join in linq it gives me error

    The method 'GroupJoin' cannot follow the method 'Join' or is not supported. Try writing

    the query in terms of supported methods or call the 'AsEnumerable' or 'ToList' method

    before calling unsupported methods.


    

    my Query is as below :

     var rsr = from raised in xrm.jp_rsrSet
                                              join Con in xrm.ContactSet on raised.bc_RaisedonBehalfof.Id equals Con.ContactId
                                              join A in xrm.jp_assetSet on raised.jp_AssestID.Id equals A.jp_assetId
                                              join Lob in xrm.jp_LobSet on Con.jp_LOB.Id equals Lob.jp_lobId
                                              into Lobleftjoin
                                              from LobJoined in Lobleftjoin.DefaultIfEmpty()
                                              where raised.bc_RaisedonBehalfof.Id.Equals(Gid)
                                              orderby raised.jp_name descending
                                              select new
                                               {
                                                   RaisedFor = Con.FirstName + ' ' + Con.LastName,
                                                   RaisedRequstId = raised.jp_name,
                                                   priority = raised.jp_Priority,
                                                   Assest = A.jp_name,
                                                   Lob = LobJoined.jp_LOB,
                                                   RequestDesc = raised.bc_RequestDescription,
                                                   Prefferred_Contact = raised.jp_Prefferred_Method_Contact,
                                                   WON = raised.jp_WON,
                                                   Address = raised.jp_Address
    
                                               };

    
    Thanks,
    Thursday, February 20, 2014 6:20 AM

All replies

  • This construction:

    into Lobleftjoinfrom LobJoined in Lobleftjoin.DefaultIfEmpty()

    is not supported. Dynamics CRM only supports a subset of LINQ, as it is limited to the capabilities of the QueryExpression class.


    If this post is an answer or helpful, please do not forget to vote!

    Monday, February 24, 2014 10:14 PM