ok.
Now I'm in Adapter, not SelfServicing, and I have:
ArticuloAlmacenTypedList lineas = new ArticuloAlmacenTypedList();
EntityFields2 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);
This make the sum for fields[1]. But I don't want really this. I want to add the value when another field (field[2]) have a determined value, and subtract it in other case. I mean:
if (field[2].value=1){
sum(field[1])
}else{
subtract(field[1])
}
¿How can I achieve this functionality?
Thanks!