M.App Enterprise Discussions

Discuss topics with other M.App Enterprise Product pioneers and experts to get the most out of it.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Contributor
Posts: 21
Registered: ‎06-18-2018

Workflow List Order By Property

Hi All,

 

I am working on M.App Enterprise Desktop and I have a list set up in one of my workflow forms. This list is displaying data from a database view, but the order by property doesn't appear to be working. In the documentation it states that it is the same as an SQL Order by statement. Therefore, I added "decision_date DESC" to the Order by property of the list (please see attached screenshot.png). 

 

When I saved this, there was no change to my list whatsoever. I had a look to see what statement was being called to retrieve the list data – which was the following:

 

exec sp_executesql N'With PageStatement AS (SELECT ROW_NUMBER() Over ( Order By file_number ASC) AS Row, file_number, (select file_number) AS filenumber FROM GIS_PLAN_VIEW  WHERE ((file_number not in (select file_number from PLANNING_POINT)))) SELECT p.file_number, p.filenumber, surname, forename, number_of_conditio, decision_date FROM pagestatement p INNER JOIN GIS_PLAN_VIEW t0 ON p.file_number=t0.file_number WHERE p.row Between @OFFSET AND @FETCHSIZE ORDER BY p.row',N'@OFFSET int,@FETCHSIZE int',@OFFSET=1,@FETCHSIZE=20

 

INCORRECT RESULT SET RETURNED HERE

 

As you can see, no part of the statement orders by my desired field. My assumption is that the SQL I have made orange in this code block, is where my ordering should be defined. When I run the exact same command in SQL Server Management Studio but Order by decision_date DESC, I get the correct result returned:

 

exec sp_executesql N'With PageStatement AS (SELECT ROW_NUMBER() Over ( Order By decision_date DESC) AS Row, file_number, (select file_number) AS filenumber FROM GIS_PLAN_VIEW  WHERE ((file_number not in (select file_number from PLANNING_POINT)))) SELECT p.file_number, p.filenumber, surname, forename, number_of_conditio, decision_date FROM pagestatement p INNER JOIN GIS_PLAN_VIEW t0 ON p.file_number=t0.file_number WHERE p.row Between @OFFSET AND @FETCHSIZE ORDER BY p.row',N'@OFFSET int,@FETCHSIZE int',@OFFSET=1,@FETCHSIZE=20

 

CORRECT RESULT SET RETURNED HERE

 

Does it appear to be bug in M.App Enterprise (I have tested on both 2016 & 2018 MAE versions) or maybe I am missing something?

 

Thanks you in advance for any help,

Ryan