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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Sorting by RecId

(0) ShareShare
ReportReport
Posted on by
I see lots of code samples that access records in a table while sorting them on recId. I would think CreatedDateTime is a better field to sort on, if enabled.
 
Is it always guaranteed that every new record in a table receives a record id greater than the previous one?
  • André Arnaud de Calavon Profile Picture
    307,416 Super User 2026 Season 2 on at
    Hi SMC,
     
    Usually, the record ID is greater for newer records. SQL sequence technology is used. In many cases, there is an index created for the RecId field and not for the CreatedDateTime. Sorting on a non-indexed field is slower compared to retrieving the records in order of an index.
  • Suggested answer
    Martin Dráb Profile Picture
    240,930 Most Valuable Professional on at
    No, it's not guaranteed that the order of record IDs matches the order of creation. For example, you have two AOS servers, both pre-allocate 50 record IDs from the sequence, e.g. 1-50 and 51-100. The second AOS will create records with IDs 51 and 52 and only then the first AOS will create a record with ID 1.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 555 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 484 Super User 2026 Season 2

#3
CU10121822-0 Profile Picture

CU10121822-0 378

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans