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 :
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?
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    300,824 Super User 2025 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
    237,770 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

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 692 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 558 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 364 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans