Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Sorting issue - How to show the newly created Project on the top of the All projects list form

Posted on by Microsoft Employee

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Sorting issue - How to show the newly created Project on the top of the All projects list form

    Thanks for your responding. For the safe reason, I only changed order by on the ProjTable_NoFilter query. It works!

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Sorting issue - How to show the newly created Project on the top of the All projects list form

    Thanks to Martin too!

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Sorting issue - How to show the newly created Project on the top of the All projects list form

    Thanks Dominic. It worked after I changed Order By on the ProjTable_NoFilter query.

  • Suggested answer
    dolee Profile Picture
    dolee 11,279 on at
    RE: Sorting issue - How to show the newly created Project on the top of the All projects list form

    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.

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 229,297 Most Valuable Professional on at
    RE: Sorting issue - How to show the newly created Project on the top of the All projects list form

    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.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Sorting issue - How to show the newly created Project on the top of the All projects list form

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,900 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,297 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans