Primary key, Clustured Index, Replacement key, Surrogate Key in Axapta
This post is a quick walk-through of surrogate keys, replacement keys, and field preview parts, which are new concepts in Ax2012. Overview The requirement used in this example is as follows: Have a new field on the sales order header called 'Priority'. This should point to a user-configurable table, containing a priority code and description. Before we start there are a couple of terms you need to understand: Natural key . Think of this as the primary key that makes the most sense . eg CustTable.AccountNum and InventTable.ItemID. We can ignore the effect of DataAreaID for non-shared tables for now. Surrogate key . The surrogate key in database terms refers to a field that also uniquely identifies a record, but isn't a natural selector. When looking at Ax, this is the RecID. In other systems this could be a sequential number, or GUID. Typcially, it's something created by the database itself, like an identity column, however in Ax it's managed by