Solved

OData V4 Group By Not Working

  • 13 March 2024
  • 2 replies
  • 32 views

Userlevel 1

Hi There,

Working with 2023 R1.

I am trying to run the following query through PostMan

http://AcumaticaVM/AcumaticaDemoDB/ODatav4/PX_Objects_GL_GLTran?$apply=groupby((AccountID,BranchID,LedgerID,FinPeriodID),aggregate(DebitAmt with sum as SumDebitAmt))

And Acumatica is coming back with the following error:

"error": {

        "code": "",

        "message": "An error has occurred.",

        "innererror": {

            "message": "Object reference not set to an instance of an object.",

            "type": "System.NullReferenceException",

            "stacktrace": "   at PX.Data.SQLTree.SQLinqExecutor.SQLinqExpressionVisitor.VisitDacProperty(Type propertyType, String propertyName, SQLExpression defaultExpression)\r\n   at PX.Data.SQLTree.SQLinqExecutor.SQLinqExpressionVisitor.VisitMember(MemberExpression expression)\r\n   at Remotion.Linq.Parsing.ThrowingExpressionVisitor.Visit(Expression expression)\r\n   at PX.Data.SQLTree.SQLinqExecutor.SQLinqExpressionVisitor.Visit(Expression expression)\r\n   at PX.Data.SQLTree.SQLinqExecutor.SQLinqExpressionVisitor.VisitMemberInit(MemberInitExpression expression)\r\n   at Remotion.Linq.Parsing.ThrowingExpressionVisitor.Visit(Expression expression)\r\n   at PX.Data.SQLTree.SQLinqExecutor.SQLinqExpressionVisitor.Visit(Expression expression)\r\n   at PX.Data.SQLTree.Async.AsyncSQLinqExecutor.AsyncSQLinqExpressionVisitor.GetSQLProjectionFromAsyncVisitor(SQLinqBqlCommandInfo info, PXGraph g, Expression linqExpression, IDictionary`2 tableAliases)\r\n   at PX.Data.SQLTree.SQLinqExecutor.SQLinqQueryModelVisitor.SetupSelection(Expression selector)\r\n   at PX.Data.SQLTree.SQLinqExecutor.SQLinqQueryModelVisitor.VisitSelectClause(SelectClause selectClause, QueryModel queryModel)\r\n   at PX.Data.SQLTree.SQLinqExecutor.SQLinqQueryModelVisitor.VisitQueryModel(QueryModel queryModel)\r\n   at PX.Data.SQLTree.Async.AsyncSQLinqExecutor.ExecuteCollectionAsync[T](QueryModel queryModel)\r\n   at PX.Data.SQLTree.Async.AsyncSQLinqExecutor.<ExecuteCollectionAsync>d__2`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n

I am a newbie to odata for sure, but all the exmple I can find on line, make me think this should be legal.

Any ideas?

Many thanks in advance,

Daniel Graham

icon

Best answer by Dmitrii Naumov 13 March 2024, 15:57

View original

2 replies

Userlevel 7
Badge +5

Hi @dannygraham ,

Acumatica does not support aggregate function in OData.

Userlevel 1

That would certainly explain it!!

Shame there’s no nice error message. It seemed to give the impression it would as earlier on when the statement was malformed the parser was able to throw the write syntactic errors.

Thanks for your help!

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved