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 Microsoft Employee

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

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Is there any Possibility to set ascending and descending order to record in table through code?

    yes suresh,

    i used SETCURRENTKEY and after that i used this Ascending Function

    as

    RecordVariable.SETCURRENTKEY(Field);

    RecordVariable.ASCENDING;

    It works Fine.

  • Verified answer
    Suresh Kulla Profile Picture
    Suresh Kulla 44,614 on at
    RE: Is there any Possibility to set ascending and descending order to record in table through code?

    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
    keoma Profile Picture
    keoma 32,675 on at
    RE: Is there any Possibility to set ascending and descending order to record in table through code?

    create if needed a new key.

    then use setcurrentkey.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans