How to filter typedlist?

Posts   
 
    
Gabor
User
Posts: 97
Joined: 29-Jan-2005
# Posted on: 23-Mar-2006 15:55:13   

I'm using adapter scenario, and want to create filter for typedlist.

My typedlist, productGarantee contains two tables.

product-guarantee, with 1:n relation

When I create a filter for the parent table, it works well, but when I add another filter for the child table, I get an error: "The multipart identifier could not be add"

Dim productList As New productGuaranteeTypedList

Dim bucket As IRelationPredicateBucket = productList.GetRelationInfo()

Dim predicate As New PredicateExpression predicate.Add(productFields.Id = 100) predicate.Add(garanteeGields.ID=10)

bucket.PredicateExpression.Add(predicate)

adapter.FetchTypedList(productList.GetFieldsInfo(), productListList, bucket, 0, False)

So despite, that I have a "flattened" list of two tables, I have to create relation, and add filter to the two table's fields separately, like filtering the collection with prefetchPath?

Could anybody show me an example, because in the manual found filtering only on the parent table's field.

Thanks

Gabor

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 24-Mar-2006 03:43:53   

The manual then sorts on a field from the other table so your code should work too. Can you post your exact code from your program and the exact exception you receive? If your a query is being generated can you post the trace for the query?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39930
Joined: 17-Aug-2003
# Posted on: 24-Mar-2006 08:38:17   

Also, have you aliased the entities in the typed list? If so, you have to specify the objectalias in the predicates, e.g. predicate.Add(productFields.Id.SetObjectAlias("P") = 100)

Frans Bouma | Lead developer LLBLGen Pro
Gabor
User
Posts: 97
Joined: 29-Jan-2005
# Posted on: 24-Mar-2006 08:50:20   

Thanks!

It was my mistakedisappointed .

Before cleaned the solution, the program used the old typedList, that not contained the other table.

After cleaning the solution, the typed list refreshed, and generated the appropriate query.

Thanks

Gabor