1
votes

Good day,

I have an aggregate projection where it counts a certain number of records.

[PXProjection(typeof(Select4<SalesContractInformation, 
                        Aggregate<
                            GroupBy<SalesContractInformation.salesContractNbr,
                                Count<SalesContractInformation.salesContractLineID>>>>), Persistent = false)]

Now, I am trying to assign the Count column to the DAC,

#region TotalTermCount

public abstract class totalTermCount : IBqlField { }
[PXDBInt(BqlField = typeof(SalesContractInformation.salesContractLineID))]
[PXUIField(DisplayName = "Total Terms Count")]
public virtual int? TotalTermCount { get; set; }

#endregion

The problem with this is that, it returns the MAX value of the SalesContractLineID field instead of the COUNT value.

This question is already been asked, unfortunately there still no answers until now.

GroupBy aggregate with record count in projection DAC

Thank you so much for your replies.

1

1 Answers

2
votes

I asked the acumatica support team for help regarding this issue, but unfortunately up until now there is no current way to solve this problem (Maybe ask them to add this feature).

Assigning the Count column to a projection field seems to be a limitation based on this reference.

But they suggested to use the ScalarCount BQL Operator.