I added a new field - creation date on Project Management and Accounting > Common >Projects > All Projects list. I like the list is displayed in descending order of creation date by default. Basically I like to see the newest project on the top of the list. Currently the default is ascending order so the newest project is on the bottom of the list.
I added following code in openProjectsListPage method which is in projProjectListPage class
QueryBuildDataSource qbds;
qbds.addSortField(fieldNum(ProjTable,Created),SortOrder::Descending);
It didn't work. Does anybody know how to do it.
*This post is locked for comments
Thanks for your responding. For the safe reason, I only changed order by on the ProjTable_NoFilter query. It works!
Thanks to Martin too!
Thanks Dominic. It worked after I changed Order By on the ProjTable_NoFilter query.
The Project list page is based on the ProjTable_NoFilter query.
The query by default is sort by ProjTable.ProjId (asc) and ProjTable.Name (asc). Edit the "Order By" setup of this query should get you what you want.
In addition, even if changing index was a solution, I'd suggest think twice before doing so because modifying indexes could potentially affect other queries.
The list page is based on ProjTable_NoFilter query, which defines the following sorting under Order By node: ProjId (ascending), Name (ascending). You can remove these sort fields, add you own and/or change Direction property of a sort field to Descending.
This is due to the Primary Index on the table..
may be you should consider updating ProjTable Index and add the new field (Created) in it for your requirment
Please verify and update us with your findings
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,900 Super User 2024 Season 2
Martin Dráb 229,297 Most Valuable Professional
nmaenpaa 101,156