Skip to main content
Solved

OData V4 Group By Not Working


Forum|alt.badge.img

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

Best answer by Dmitrii Naumov

Hi @dannygraham ,

Acumatica does not support aggregate function in OData.

View original
Did this topic help you find an answer to your question?

2 replies

Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • 632 replies
  • Answer
  • March 13, 2024

Hi @dannygraham ,

Acumatica does not support aggregate function in OData.


Forum|alt.badge.img
  • Author
  • Freshman I
  • 10 replies
  • March 13, 2024

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings