RelationPredicateBucket filter = new RelationPredicateBucket();
IEntityField2 setField = EntityFieldFactory.Create(IfFileFieldIndex.FileId);
setField.AggregateFunctionToApply = AggregateFunction.Max;
PredicateExpression setFilter = new PredicateExpression();
setFilter.Add(PredicateFactory.CompareValue(IfFileFieldIndex.AccessBy, ComparisonOperator.Equal, 4));
setFilter.AddWithAnd(PredicateFactory.CompareRange(IfFileFieldIndex.RecortTypeId, 3, 7));
GroupByCollection setGroupBy = new GroupByCollection();
setGroupBy.Add(EntityFieldFactory.Create(IfFileFieldIndex.MimeType));
filter.PredicateExpression.Add(
new FieldCompareSetPredicate(
EntityFieldFactory.Create(IfFileFieldIndex.FileId), null,
setField, null,
SetOperator.In,
setFilter.PredicateExpression,
setFilter.Relations,
string.Empty;
0,
null,
false,
setGroupBy));
I changed to :
RelationPredicateBucket filter = new RelationPredicateBucket();
IEntityField2 setField = EntityFieldFactory.Create(IfFileFieldIndex.FileId);
setField.AggregateFunctionToApply = AggregateFunction.Max;
RelationPredicateBucket setFilter = new RelationPredicateBucket();
//PredicateExpression setFilter = new PredicateExpression();
setFilter.PredicateExpression.Add(PredicateFactory.CompareValue(IfFileFieldIndex.AccessBy, ComparisonOperator.Equal, 4));
setFilter.PredicateExpression.AddWithAnd(PredicateFactory.CompareRange(IfFileFieldIndex.RecordTypeId, 3, 7));
GroupByCollection setGroupBy = new GroupByCollection();
setGroupBy.Add(EntityFieldFactory.Create(IfFileFieldIndex.FileName));
filter.PredicateExpression.Add(
new FieldCompareSetPredicate(
EntityFieldFactory.Create(IfFileFieldIndex.FileId), null,
setField, null,
SetOperator.In,
setFilter.PredicateExpression,
setFilter.Relations,
string.Empty,
0,
null,
false,
setGroupBy));
Got this:
No overload for method 'FieldCompareSetPredicate' takes '12' arguments.
I checked the method signatures of FieldCompareSetPredicate, no way to put group by clause.
Could you please revise it for me?