Unable to cast object of type FetchLinkEntity to type FetchEntity

May 11, 2009 at 9:14 PM

Anyone encouter the following error?

Unable to cast object of type 'stunnware.CRM.Fetch.FetchLinkEntity' to type 'stunnware.CRM.Fetch.FetchEntity

The error occurrs at WhereBuilder.cs Line: 38 which is

foreach(FetchEntity e in stmt.GetEntities().Where(e => e.Filter != null))

when I execute the following query

            var chapter = (from c in crmFacade.GetQueryProvider().Linq<contact>()

                           join rb in crmFacade.GetQueryProvider().Linq<renewalbilling>()

                           on c.contactid.Value equals rb.customercontactid.Value

                           join c in crmFacade.GetQueryProvider().Linq<chapter>()

                           on rb.chapterid.Value equals c.chapterid.Value

                           where rb.chapterbenefit.Value == true

                           where rb.chapterisprimary.Value == true

                           where c.webloginname == userName

                           select c);

I'm thinking that instead of FetchEntity it should be FetchEntityBase.

-- james


May 12, 2009 at 2:17 PM

I haven't time to look at this right now. Are you using code from svn? This stuff was refactored not too long ago.

May 12, 2009 at 2:57 PM

I thought I was, but I'll check. Thanks for the quick response.

May 12, 2009 at 3:38 PM

Yes, I'm using the latest version from SVN. Would you like me to check this in?

May 12, 2009 at 5:45 PM


I know it's kind of a drag, but could you create a minimal, failing example using just standard CRM entities and no facade? Then we can debug it much more quickly, instead of having to reengineer the error you're encountering on our end.