Excuse my flooding of posts but i'm on a tight shedule here
In my code i have searchscreens where the user can enter filter fields
In this particular example i have a searchscreen for a perceelcollection, where a user can filter on Postcode (which is a field of a location object linked to a perceel)
PerceelCollection pc = new PerceelCollection();
RelationCollection rc = new RelationCollection();
rc.Add(PerceelEntity.Relations.LocationCodeEntityUsingLocationId);
PredicateExpression pe = new PredicateExpression();
filter = txtPostcode_nt.Text;
if (filter!="")
pe.Add(PredicateFactory.Like(LocationCodeFieldIndex.PostcodeCode,"%"+filter+"%"));
PrefetchPath pp =new PrefetchPath((int)EntityType.PerceelEntity);
pp.Add(PerceelEntity.PrefetchPathLocationCode);
SortExpression sorter = new SortExpression(SortClauseFactory.Create(PerceelFieldIndex.PlId,SortOperator.Ascending));
pc.GetMulti(pe,0,sorter,rc,pp);
Now, the location subobject of a perceel is nullable, and all percelen with such a null LOCATION_ID are never retrieved in the query. I would assume that they should be retrieved if the user doesn't specify a postcode filter ?
However, if i move the relation collection adding into the IF-clause, then all percelen are fetched if no postcode-filter is provided. Is this normal behavior that when you use a RelationCollection, all records with a NULL FK are filtered out of the resultset ?