dynamics crm - Performing two Left Outer Joins in a Single LINQ to CRM query -
i'm attempting perform 2 left outer joins in crm online 2015 update 1 instance, getting error. have currently:
var query_join8 = in crmcontext.accountset join c in crmcontext.contactset on a.primarycontactid.id equals c.contactid gr c_joined in gr.defaultifempty() join c in crmcontext.contactset on a.name equals c.fullname gr2 c2_joined in gr2.defaultifempty() select new { contact_name = c_joined.fullname, account_name = a.name, other_name = c2_joined.fullname };
when attempt execute it, error:
an exception of type 'system.notsupportedexception' occurred in microsoft.xrm.sdk.dll not handled in user code
additional information: method 'groupjoin' cannot follow method 'selectmany' or not supported. try writing query in terms of supported methods or call 'asenumerable' or 'tolist' method before calling unsupported methods.
if comment out second join, works fine:
var query_join8 = in crmcontext.accountset join c in crmcontext.contactset on a.primarycontactid.id equals c.contactid gr c_joined in gr.defaultifempty() //join c in crmcontext.contactset //on a.name equals c.fullname //into gr2 //from c2_joined in gr2.defaultifempty() select new { contact_name = c_joined.fullname, account_name = a.name, //other_name = c2_joined.fullname };
microsoft documentation:
defining how perform left join: http://msdn.microsoft.com/en-us/library/gg509017.aspx#leftjoin blog describing supported: http://blogs.msdn.com/b/crminthefield/archive/2013/01/14/crm-2011-sdk-query-limitations-by-api.aspx
the documentation on crm 2015 still states outer joins not supported. (msdn: use linq construct query) know there example on msdn showing left join (sample: complex linq queries), doubt if under hood transformed single queryexpression
. so, guess hitting limits of capabilities of ling crm.
Comments
Post a Comment