Search code examples
axaptadynamics-ax-2009dynamics-ax-2012

Why do all RecIds start with 5637144576?


Here is a completely pointless question... but one that I would like to know the answer to:

Why do all RecIds in Ax2012 (And all since v2.5 I think??) start with 5637144576? Why not start with RecId 1, like in TempDB tables? This must be some legacy thing from an older version.

I remember cases of customers running out of RecId's in older versions, which was supposedly solved by making RecIds unique per table and changing it to a 64bit datatype. But still with this change, it starts from a specific number.

Just curious...


Solution

  • Here comes a purely speculative answer ...

    5637144576 happens to be 0x150000000 which cannot be stored in a 32 bit integer. When RecId grew from 32 to 64 bit (in AX 4.0) this was important for testing purposes.

    Also any new RecId was guaranteed not to collide with an old RecId from AX 3.0. This was important for the upgrade process.

    Why not choose 0x100000000 or 4294967296?
    Because in decimal this would be hard to distinguish from 4294967196 and other small numbers.

    Why not choose 5000000000 decimal?
    Because we programmers best calculate in hex!

    See also Are RecIds unique across Common tables in Dynamics AX 2012?