TypedList filter or IPredicateExpression

Posts   
 
    
Kris Nobels avatar
Posts: 118
Joined: 02-Apr-2008
# Posted on: 20-Jan-2014 12:44:31   

Hello

I created 1 typed list that has fields from:

  • Entity Adres
  • Entity Residence

The Residence has 2 colums, with dutch an french language.

In the typed list you can select the entity and field you need for the typed list.

But the problem is: Residence.DescriptionFr" could not be bound.

What i do is create filter on adres by using FieldLikePredicate and AdresFields.Street, ...

But when i add 1 filter that is related to the adres (Residence)

I have this problem when i add the filter with related field

IPredicateExpression filterResidence2 = new PredicateExpression();

filterResidence2.Add(new FieldLikePredicate(ResidenceFields.DescriptionFr, null, string.Format("%{0}%", searchTerm)));
LogicCreator.CreateFilter(lijst, filterResidence2, request.Filters);
finalFilter.AddWithOr(filterResidence2);

My questions:

  • If you create typed list in llblgen designer the relations are known, do you need to add it again ?
  • Is there any other way to inform the FieldLikePredicate (In this case) witch field it needs to be
Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 20-Jan-2014 20:09:48   

Relations are known and used implicitly. Could you please troubleshoot and inspect the generated SQL query, to know what's going wrong?

Please post the generated SQL over here, so we can check it out.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39878
Joined: 17-Aug-2003
# Posted on: 21-Jan-2014 07:56:03   

Did you alias the entity in the typed list perhaps? if so, you need to specify the alias in the predicate as well...

Frans Bouma | Lead developer LLBLGen Pro
Kris Nobels avatar
Posts: 118
Joined: 02-Apr-2008
# Posted on: 21-Jan-2014 21:44:01   

Thanks for feedback.

I found the problem.