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)

Is there any Possibility to set ascending and descending order to record in table through code?

(0) ShareShare
ReportReport
Posted on by

Hi All,

Is there any Possibility to set ascending and descending order to record in table through code i know is there Ascending Function but it is workable to table primary Key but i want to set ascending order for other field in table.

if i wrote like this RecordVariable.Ascending; this done as per recordvariable primary key value?

but i want other field that is integer field.

How can i done this through code?

Regards,

Ramesh.

*This post is locked for comments

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

    create if needed a new key.

    then use setcurrentkey.

  • Verified answer
    Suresh Kulla Profile Picture
    50,269 Super User 2026 Season 1 on at

    You can use ASCENDING function on any field, you just need to create a key for that field and then use SETCURRENTKEY function on the field before you use ASCENDING on that field.

  • Verified answer
    Community Member Profile Picture
    on at

    yes suresh,

    i used SETCURRENTKEY and after that i used this Ascending Function

    as

    RecordVariable.SETCURRENTKEY(Field);

    RecordVariable.ASCENDING;

    It works Fine.

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans