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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)
Answered

Default sorting on Form screen

(0) ShareShare
ReportReport
Posted on by 32

Hi, I have a form with datasource from a table called penaltytable, and I didn't input any sorting, so from my understanding its supposed to be sorted by primary key as default. But everytime I open the form screen, its sorted by another field instead of primary key. I'm not asking how to change the default sorting which is I already know how to do it, I just want to know why its not sorted by primary key as default? See below pictures for details.

  • Currently how the form screen sorted (sorted by "Contract number" field =

8524.image1.JPG

  • How it should be from my understanding (sorted by "RecId" field which is primary key) =

6866.image2.JPG

Best regards

*This post is locked for comments

I have the same question (0)
  • Verified answer
    guk1964 Profile Picture
    10,886 on at
    RE: Default sorting on Form screen

    The initial sort order for the records shown in a form is prioritized by the system:

    • If sort fields are added to the data source query, the sort specification is used.

    • If an index is specified in the index property on the data source, the sort order that is implicitly specified in that index is used.

    • If the data source is auto joined to another data source, the system finds the index for this join and sorts the data according to that index.

    • If nothing else is specified, the sort order is the one that is implicitly specified in the first index (the one with the lowest ID) on the table that is used in the form data source.

    When no index hints are specified, it is up to the database management system to find an applicable access path that is based on the information in the supplied query.

    The sort order can be changed by the user, by using the different sort options that are presented on the controls and in the query dialog box.

  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: Default sorting on Form screen

    I don't think the form does any sorting if you don't specify it. Instead it shows the data in the same order that it's stored in the database: the cluster index.

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…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
howalker Profile Picture

howalker 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans