Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)
Answered

Can I change the Default Sort in a Page?

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

  • Suggested answer
    keoma Profile Picture
    keoma 32,675 on at
    RE: Can I change the Default Sort in a Page?

    add following code

    in a list form: trigger onopenform

    in a list page: trigger onopenpage

    if findfirst then;

    result: the form/page always opens with the first top row selected.

  • Suggested answer
    Yogesh Kulkarni_ Profile Picture
    Yogesh Kulkarni_ 1,762 on at
    RE: Can I change the Default Sort in a Page?

    You will need a developer license for this.

    IF FINDFIRST THEN;

    will set your cursor to the first record, as per the current key and sort order.

     

    -Yogesh Kulkarni
    Please verify, if you find answer helpful.

  • Ian Fletcher Profile Picture
    Ian Fletcher 2,445 on at
    RE: Can I change the Default Sort in a Page?

    Hi, a couple of questions, does this require a developers license, as I do not have one. Secondly we are not inserting any records, just opening page 29 to view the entries, this talks about opening forms which we are not doing?

  • Suggested answer
    Yogesh Kulkarni_ Profile Picture
    Yogesh Kulkarni_ 1,762 on at
    RE: Can I change the Default Sort in a Page?

    Please check if this post from Suresh helps you.

    http://www.navisionworld.com/2016/12/move-cursor-to-first-record-on-nav-form.html

     

    -Yogesh Kulkarni
    Please verify, if you find answer helpful.

  • Ian Fletcher Profile Picture
    Ian Fletcher 2,445 on at
    RE: Can I change the Default Sort in a Page?

    As said we have the page sorted with newest at the top, BUT, when we open this page, the row that is selected first of all is the oldest which can be several pages down, what we want to happen when we open the page view is to have the newest record at the top (as it currently is) & then this row selected/highlighted so the user can see the most recent first without have to move around the pages

    Thanks

  • Suggested answer
    Yogesh Kulkarni_ Profile Picture
    Yogesh Kulkarni_ 1,762 on at
    RE: Can I change the Default Sort in a Page?

    Ian,

    To create a secondary key, you must have a developer license.

    But in NAV 2009 on the Action Panel there is one button "Sort" which will show you list of all the active keys for the base table of the Form.

    Check whether that helps you.

     

    -Yogesh Kulkarni
    Please verify, if you find answer helpful.

  • Ian Fletcher Profile Picture
    Ian Fletcher 2,445 on at
    RE: Can I change the Default Sort in a Page?

    Hi, no I never managed to change this sort order, if anyone knows without a developers licence, please let me know

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Can I change the Default Sort in a Page?

    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?

  • Ian Fletcher Profile Picture
    Ian Fletcher 2,445 on at
    RE: Can I change the Default Sort in a Page?

    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?

  • TharangaC Profile Picture
    TharangaC 23,116 on at
    RE: Can I change the Default Sort in a Page?

    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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans