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

Notifications

Announcements

No record found.

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,243 Super User 2025 Season 2 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans