Hi
// create the filter for the search.
IRelationPredicateBucket bucket = lineas.GetRelationInfo();
bucket.PredicateExpression.Add(PredicateFactory.CompareValue(MovimientoAlmacenFieldIndex.MovPkSalida, ComparisonOperator.Equal, ucpk));
IEntityFields2 fields = lineas.GetFieldsInfo();
fields[1].AggregateFunctionToApply = AggregateFunction.Sum;
IGroupByCollection groupByClause = new GroupByCollection();
groupByClause.Add(fields[0]);
adapter.FetchTypedList(fields, lineas, bucket,0,null, false, groupByClause);
I'm grouping by fields[0] and applicate a function 'Sum' to fields[1]. But also, I'm filtering with the PredicateExpression 'bucket'.
But the result for the Sum of fields[1] doesn't respect this bucket and make the sum for all the registers, including these that are filtered. I need the sum only for the registers respecting the bucket Expression.
Thanks in advance.