DvK wrote:
Use a ScalarQueryExpression, see the documentation for more info -> Generated code - Field expressions and aggregates
Hello Dvk
I got it right by fluke I think. I got it after chatting to the Aurelien.
Here is the code which I have posted below for everyone else to know.
Regards,
Simon
groupBy.HavingClause = new PredicateExpression();
groupBy.HavingClause.Add(new FieldCompareSetPredicate(
DocumentGroupingDocumentTypeFields.DocumentGroupingId.SetAggregateFunction(AggregateFunction.Count),
null,
DocumentGroupingDocumentTypeFields.DocumentGroupingId.SetAggregateFunction(AggregateFunction.Count),
null,
SetOperator.Equal,
(DocumentGroupingDocumentTypeFields.DocumentGroupingId == ID),
false));