Hi guys,
I have stumbled on a similar problem related to this thread GetMulti using aggregate Sum in predicate (https://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=5063). However, I only need to use FieldCompareSetPredicate to solve my problem.
When trying to create a new FieldCompareSetPredicate, it takes IEntityField or IEntityFieldCore in the constructor to identify the table column. I have table columns defined as EntityField2.
I am unable to find a way to get EntityField from EntityField2, or IEntityFieldCore from EntityField2. I am using v5 of LLBLGEN.
I also have group by clause in my inner subquery, so I intend to use the below signature for the group by :
public FieldCompareSetPredicate(IEntityFieldCore field, IFieldPersistenceInfo persistenceInfoField, IEntityFieldCore setField, IFieldPersistenceInfo persistenceInfoSetField, SetOperator operatorToUse, IPredicate filter, IRelationCollection relations, string objectAlias, long maxNumberOfItemsToReturn, ISortExpression sorter, bool negate, IGroupByCollection groupByClause);
Sample code I am trying to write :
bucket.PredicateExpression.Add(
new FieldCompareSetPredicate(PlanningHistoryFields.CphUpdatedOn,
PlanningHistoryFields.CphUpdatedOn.Source("InnerHistory")
.SetAggregateFunction(AggregateFunction.Max), SetOperator.In, null));
Compiling error I am receiving :
cannot convert from 'SD.LLBLGen.Pro.ORMSupportClasses.EntityField2' to 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityField'
Can someone please help my problem?