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 :
Microsoft Dynamics NAV (Archived)
Answered

Can I change the Default Sort in a Page?

(0) ShareShare
ReportReport
Posted on by 2,445

Nav 2009 R2

We would like to change the default sort order for a table - in our case Vendor Ledger Entry's to be newest on top, how do we do this? Posting Date is a Key, but at the moment the page defaults to Entry No A to Z, if I go to customise this page & change arrange by to be Posting Date Z to A it does not change anything, can we change the default Sort? I can change the sort when in the page, but as soon as I come out & then go back in the default is back.

*This post is locked for comments

I have the same question (0)
  • keoma Profile Picture
    32,729 on at

    hi,

    add a new key "Posting Date" to table "vendor ledger entry" at the end of the key list.

    then edit form "vendor ledger entries" and set property SourceTableView to the new key "Posting Date" with Order "Descending".

  • Tharanga Chandrasekara Profile Picture
    23,118 on at

    You can do this easily in NAV.

    First you have to add a new secondary key to "Vendor Ledger Entry" table. On how to do that please refer below link:

    msdn.microsoft.com/.../dd301433.aspx

    Then open the page/form which you want to sort depending on the posting date. Then go to the properties of the form and in there set the property of the "SourceTableView" to the new key (Posting Date") and set the order according to your requirement.

    Save and compile the form.

  • Saurabh Shah Profile Picture
    4,560 on at

    Yes, if you want this as change for all then you need to change in as suggested by jonathan or else for RTC, you can sort the record and do Save as View and can put on the role center. this will create customised view and will save as it.

  • 4BzSoftware Profile Picture
    6,073 on at

    Hi Ian,

    The table is default sorted ascending by its primary key (the first key) and we must not change it for standard tables. We should use secondary key and sort data via Form View or Page View. What client type do you use (Classic or RTC)?

    As your requirement, you should:

    - Create a secondary key "Posting Date, Open" for Vendor Ledger Entry table (as Archer, Tharanga and Saurabh mentioned).

    - Edit Vendor Ledger Entries Form or Page to use new key with descending sort.

  • Ian Fletcher Profile Picture
    2,445 on at

    Hi All,

    To clarify, we use 2009 R2 - so RTC & hence why we want to change the sort on a page & so I assume that we don't actually use Forms or they are applicable for me?

    @Saurabh - We do not want a new View as you have suggested as this is the Vendor Ledger entries & we do not want to access all entry's every time, usually Finance will go the vendor & then select Ledger Entry's so that they are already filtered to just the vendor, want they then want is the newest at the top, rather than at the end, as is the current option.

    As I first motioned, I have already added a key for Posting date which I can manually sort from, what I want to change is the default sort from Entry No A to Z as it is currently.

    If I look at Page design for 29 then I do not see an option for sorting? How or where to I get to the default sorting for a Page?

    I have changed the Form but it does not seem to affect my Page 29?

    Have I missed something?

  • Verified answer
    keoma Profile Picture
    32,729 on at

    edit page 29 in dev.env./object designer. select last (empty) line in the edited page. view the properties. set following value to property SourceTableView: SORTING(Posting Date) ORDER(Descending)

  • Suggested answer
    Ian Fletcher Profile Picture
    2,445 on at

    @jonathan - This is what I was looking for, this has worked, many thanks for your help, it was that last bit of the new line & setting SourceTableView in the page design that I was missing,

    Thanks

    Ian

  • Tharanga Chandrasekara Profile Picture
    23,118 on at

    As Jonathan said edit the page 29 in the development environment and then go to the empty line of the page and then click on properties. In the property window you can see a field called "SourceTableView"

    In the right side of the SourceTableView click on the drildown icon and it will open a small window which will allow you to select the keys for the page. In that select your key and then set the ascending or descending order as you want. Then compile the page and save it.

  • Ian Fletcher Profile Picture
    2,445 on at

    Hello again, whilst this has worked to a point, we have now found that when opening the list view, it is sorted by posting date as expected, BUT, the row that is selected is still the oldest row, so when the entrys go over one page you only see the oldest first as the selected row is the last (oldest) row, is there a way for the page to open & be on (selected)(highlighted) the most recent row by posting date rather than the last?

    Hope you follow this?

  • Community Member Profile Picture
    on at

    Hi Ian,

    After two years, I hope you found out what the solution to your sorting problem is? 

    Because I have the same issue, default sorting is not the problem, but the selection is still the oldest one on the lowest part of the screen.

    So the users still have to scroll to the top of the page. 

    Did you manage to select the top record of the page, combined with the default selection change?

    Thanks for the information. 

    --edit--

    Doing the job is changing the OnOpenPage propertie code, but for doing this you need a developer key?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
TAHER_El_Mehdi Profile Picture

TAHER_El_Mehdi 2

#1
sliderxb Profile Picture

sliderxb 2

#1
broberts Profile Picture

broberts 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans