System fields and indexes doubts

Hi Ax Techies

Recently I have Observed

Every Table has one System field with name of "SequenceNum" I don’t know what is the purpose of that field it stores recId values

In WrkCtrTable has primary index WrkCtrIdx but in that index field property doesn’t set Alternate key yes eventhough wrkctrIdx act as primary index how it is possible

Question moved to the developer forum. You forget to mention your version of AX, but it seems it’s about AX 2012, correct?

I don’t agree that every table has SequenceNum field. Why do you think so?

I don’t see any problem in using one of alternate keys as the primary key. From logical perspective, alternate keys are those OK candidates that haven’t been selected as PK. Technically, your requirement would force you to set to change AlternateKey property to No before you could use an index as primary.

SequenceNum field explicitlty not visible but while accessing table fields through code it will show (table.sequenceNum) for every table it will show

In indexes how can i set index to the table propety Primary index without set Alternate key Property yes to that index

I’ll take it as “Yes, I’m talking about some release of Dynamics AX 2012”.

SequenceNum is not a real field; it’s a virtual field for some internal purposes.

If some index is not even a candidate (Alternate) key, how could it be a primary key? Just set it as Alternate.

yes, i am working on Ax2012R3

see System table WrkCtrTable in that Alternate key not set but that index allows as primary index for other tables it does n’t allow I think some thing logic behind this

I think you’re comparing new tables created according rules in AX 2012 and old tables imported from older versions of AX, where were no alternate keys.

Thanks Martin for valuable replies…but still use of sequenceNum question revolving in my mind

I thought I already answered it. What else do you want to hear?

There is no such field in the database. It’s a virtual field, used by AX kernel. Don’t touch it, don’t look at it, forget it exists because you’ll never need it for anything. It’s not a real field. And it’s not for you.