Hi Good night i have a query that works, but i need to aggregate groupBy and orderBy clauses. i saw some examples of the pdf guide but not working.
I need group by :
- BAccount.bAccountId
- BAcount.acctName
- V_CEVendors.idEstimateEstimate
- V_CEVendors.vChecked
- V_CEVendors.total
This is my code that works. (without group by or OrderBy).
PXSelector(typeof(Search2<BAccount.bAccountID,
LeftJoin<V_CEVendors,
On<BAccount.bAccountID,
Equal<V_CEVendors.vendor_Id>>>,
Where<V_CEVendors.estimateNbr.IsEqual<CEEstimate.estimateNbr.FromCurrent>.
And<V_CEVendors.idEstimateEstimate.IsEqual<CEEstimateEstimate.id.FromCurrent>.And<BAccount.type.IsEqual<SQLConstant.ONLYVENDORC>.And<BAccount.deletedDatabaseRecord.IsEqual<SQLConstant.DELETEDRECORDBOOLC>>>>.
Or<V_CEVendors.idEstimateEstimate.IsNull.And<BAccount.type.IsEqual<SQLConstant.ONLYVENDORC>.And<BAccount.deletedDatabaseRecord.IsEqual<SQLConstant.DELETEDRECORDBOOLC>>>>
>
>
),
typeof(BAccount.bAccountID),
typeof(BAccount.acctName),
typeof(V_CEVendors.idEstimateEstimate),
typeof(V_CEVendors.vchecked),
typeof(V_CEVendors.total),
SubstituteKey = typeof(BAccount.acctName),
Filterable = true
)]
This is my code with Order by (but it does nothing). I need to orderBy by V_CEVendors.total descending
PXSelector(typeof(Search2<BAccount.bAccountID,
LeftJoin<V_CEVendors,
On<BAccount.bAccountID,
Equal<V_CEVendors.vendor_Id>>>,
Where<V_CEVendors.estimateNbr.IsEqual<CEEstimate.estimateNbr.FromCurrent>.
And<V_CEVendors.idEstimateEstimate.IsEqual<CEEstimateEstimate.id.FromCurrent>.And<BAccount.type.IsEqual<SQLConstant.ONLYVENDORC>.And<BAccount.deletedDatabaseRecord.IsEqual<SQLConstant.DELETEDRECORDBOOLC>>>>.
Or<V_CEVendors.idEstimateEstimate.IsNull.And<BAccount.type.IsEqual<SQLConstant.ONLYVENDORC>.And<BAccount.deletedDatabaseRecord.IsEqual<SQLConstant.DELETEDRECORDBOOLC>>>>
>,OrderBy<Asc<C_CEVendros.total>>
>
),
typeof(BAccount.bAccountID),
typeof(BAccount.acctName),
typeof(V_CEVendors.idEstimateEstimate),
typeof(V_CEVendors.vchecked),
typeof(V_CEVendors.total),
SubstituteKey = typeof(BAccount.acctName),
Filterable = true
)]
This is my code with groupBy (with error).
PXSelector(typeof(Search2<BAccount.bAccountID,
LeftJoin<V_CEVendors,
On<BAccount.bAccountID,
Equal<V_CEVendors.vendor_Id>>>,
Where<V_CEVendors.estimateNbr.IsEqual<CEEstimate.estimateNbr.FromCurrent>.
And<V_CEVendors.idEstimateEstimate.IsEqual<CEEstimateEstimate.id.FromCurrent>.And<BAccount.type.IsEqual<SQLConstant.ONLYVENDORC>.And<BAccount.deletedDatabaseRecord.IsEqual<SQLConstant.DELETEDRECORDBOOLC>>>>.
Or<V_CEVendors.idEstimateEstimate.IsNull.And<BAccount.type.IsEqual<SQLConstant.ONLYVENDORC>.And<BAccount.deletedDatabaseRecord.IsEqual<SQLConstant.DELETEDRECORDBOOLC>>>>
>.AggregateTo<GroupBy<BAccount.bAccountID>>
>
),
typeof(BAccount.bAccountID),
typeof(BAccount.acctName),
typeof(V_CEVendors.idEstimateEstimate),
typeof(V_CEVendors.vchecked),
typeof(V_CEVendors.total),
SubstituteKey = typeof(BAccount.acctName),
Filterable = true
)]
Can you help me please.