Here is my code :
fields.DefineField(ItemFieldIndex.ItemID,
0, ItemFieldIndex.ItemID.ToString());
fields.DefineField(ItemFieldIndex.Name,
1, ItemFieldIndex.Name.ToString());
fields.DefineField(ItemFieldIndex.ItemStatus,
2, ItemFieldIndex.ItemStatus.ToString());
fields.DefineField(ItemBarcodeFieldIndex.Barcode,
3, ItemBarcodeFieldIndex.Barcode.ToString());
fields.DefineField(ItemFieldIndex.TypeCode,
4, ItemFieldIndex.TypeCode.ToString());
fields.DefineField(StockItemFieldIndex.StockItemTypeCode,
5, "StockItemSubType");
fields.DefineField(ServiceItemFieldIndex.TypeCode,
6, "SeriveItemSubType");
fields.DefineField(TranslationItemFieldIndex.Description,
7, TranslationItemFieldIndex.Description.ToString());
bucket.Relations.Add(new ItemRelations().ItemBarcodeEntityUsingItemID, JoinHint.Left);
bucket.Relations.Add(new ItemRelations().StockItemEntityUsingItemID, JoinHint.Left);
bucket.Relations.Add(new ItemRelations().ServiceItemEntityUsingItemID, JoinHint.Left);
bucket.Relations.Add(new ItemRelations().TranslationItemEntityUsingItemID, JoinHint.Left);
expression = new PredicateExpression();
predicate = new FieldCompareValuePredicate(
EntityFieldFactory.Create(ItemBarcodeFieldIndex.IsDefaultBarcode),
null,
ComparisonOperator.Equal,
true);
expression.Add(predicate);
predicate = new FieldCompareNullPredicate( EntityFieldFactory.Create(ItemBarcodeFieldIndex.IsDefaultBarcode), null);
expression.AddWithOr(predicate);
bucket.PredicateExpression.Add(expression);
expression = new PredicateExpression();
predicate = new FieldCompareValuePredicate(
EntityFieldFactory.Create(TranslationItemFieldIndex.LanguageID),
null,
ComparisonOperator.Equal,
language.Trim());
expression.Add(predicate);
predicate = new FieldCompareNullPredicate(
EntityFieldFactory.Create(TranslationItemFieldIndex.LanguageID), null);
expression.AddWithOr(predicate);
bucket.PredicateExpression.Add(expression);
if (pageNumber != -1 && pageSize != -1)
{
DALAdapter.FetchTypedList(
fields, dynamicList, bucket, pageSize, sortExpression, false, null, pageNumber, pageSize);
}
I expect to return just limited data rows (= pagesize), but it returns all existing dat rows in DB that fulfills the defined criteria!