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 AX (Archived)

DIfference between surrogatekey and recid

(0) ShareShare
ReportReport
Posted on by

Hi all,

what is the exact difference between surrogate key and recid.

Thanks&regards,

lalitha.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    André Arnaud de Calavon Profile Picture
    301,231 Super User 2025 Season 2 on at

    Hi,

    In fact there is no difference. The RecId indexes are coming from older versions of AX whereas the SurrogateKey is defaulted for new created tables in AX 2012.

  • Verified answer
    Martin Dráb Profile Picture
    237,990 Most Valuable Professional on at

    RecId is a field used by Dynamics AX to uniquely identify records.

    Surrogate (AKA synthetic) key is a logical concept coming from database design theory, describing a key that is generated by the database system itself; it's not (like usual keys) based on business data. Obviously RecId is such a surrogate key.

    Also note that AX (since AX 2012) automatically creates an index called SurrogateKey (if you create a new table, you'll see it's used as PrimaryIndex and ClusterIndex), therefore when you hear "surrogate key", people may also be talking about this index.

  • Verified answer
    Vilmos Kintera Profile Picture
    46,149 on at

    The exact difference is that RecId is an Extended Data Type based on int64 from which you may create Fields in AX, while a Surrogate Key is a unique identifier in a table. Majority of the AX Tables have RecId field by default that is populated by the kernel automatically from a sequence per each table, thus making it a Surrogate Key by definition.

  • Verified answer
    guk1964 Profile Picture
    10,888 on at

    A surrogate key typically  has no meaning to a user. In Microsoft Dynamics AX 2012 the primary key for every new table is always enforced by an index that has exactly one field. The one field is usually an incremented number, or a completely meaningless number that is generated by the system.

    For new tables the default is a primary key based on the RecId field. This is represented as the surrogate key in the user interface.

    This auto-generated primary key - the surrogate key is linked to the already existing RecId field within any table. A surrogate key is a unique 64-bit integer value that is mandatory for the table and cannot be changed or have duplicates. It is a 64-bit integer (int64) value which means table operations normally perform faster than other types of field such as string fields.

    In the form designer a reference group is a way of displaying the replacement key index fields for a table instead of the surrogate key, which is normally the RecId, for the table.

    While surrogate keys and replacement keys can be helpful, these are not required for functional tables and forms.

    Surrogate keys were available in Ax 2009, but were not so helpful until the kernel changes introduced at Ax 2012  - see this blog for some useful insights axdaily.blogspot.ae/.../surrogate-keys-in-ax-2012.html

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 AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans