web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Business Central forum

Order By on List Page Views

(0) ShareShare
ReportReport
Posted on by 336

When I build a view for a list page and set the OrderBy property, the system automatically selects the lowest number record when the page runs, which defeats the purpose of the order by. Is there something I'm missing on how to accomplish this, or is this a bug?

Categories:
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    Can you post your code?

    Views with OrderBy are working. Do something like:

    view(MyView)

    {

       Caption = 'This is my view!';

       OrderBy = Ascending (YourField);

    }

  • dkkipfer Profile Picture
    336 on at

    This is a view I have added to the Sales Order list page.

    views

    {

           addfirst

           {

               view(Ben)

               {

                   Filters = where ("Salesperson Code" = filter ('BV*'));

                   OrderBy = descending ("Order Date");

               }

           }

    }

  • dkkipfer Profile Picture
    336 on at

    Does anyone have any additional thoughts on this? Are we not able to set an order by on a built-in list page?

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    Views supports order by. I try to ask (maybe stupid, sorry for this) questions to understood: Can you see your view listed in the view box in your list page? If so, have you selected the view?

    The view is not automatically launched when you open the standard page.

  • dkkipfer Profile Picture
    336 on at

    Yes, I can see my view in the view box on the list page. When I select it the page opens and the order by is correct, but it selects the lowest no. record in the list, which means the list opens all the way at the bottom, defeating the purpose of order by. I want the page to open and select the record with the most recent order date at the top of the list without scrolling to get there.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    Despite the selected record, all records are ordered correctly or not?

    The top record is the one with the most recent order date? If so, the order by works as expected.

    This view returns a warning with AL langage extension version 4.X, because it says that "Sorting field 'Order Date' should be part of the keys for table 'Sales Header'".

  • dkkipfer Profile Picture
    336 on at

    Yes, the records are technically ordered correctly, but it is not user friendly.

    For example, say I have a list of 100 records and I want to open it descending by Order Date. I would expect that when I open the list page I will see the records starting with the most recent Order Date at the top. Instead the list page opens with record 1 selected, all the way at the bottom of the list, and I am forced to scroll all the way back up or hit Ctrl+Home to view it in the order I would expect.

    Even if I order by a key for the table, like Document Date, it's the same result.

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 Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

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

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans