Skip to main content

Ax2012 Table Keys.


We are going to see the concept of keys on Tables in Ax2012.
These all following keys that we are going though appears in the AOT Table properties window.

Primary Key
The primary key is usually the type of key that other tables, called child tables, refer to when a foreign key field in those other tables need a relational identifier.
When we create a new table in AX2012 the Primary key was enforced by an index that has one field, this field should be unique, by default the primary key is based on Recid field. This is represented as surrogateKey in the table properties primary index.
By default the CreateRecIdIndex property was true and ClusterIndex as surrogateKey.


The ClusterIndex value is given to the underlying Microsoft SQL Server database system as a performance tuning choice. This choice generally controls the physical sequence in which the records are stored in the underlying database.


ReplacementKey
This key is used to define the replacement fields to display in your design when you referred  to some relation using the Recid.
for ex:-
Table B is referring to Table A where the TableB have the Refrecid from Table A, but when you open the form for TableB We cant show the Recid of the TableA in the Presentation,So whatever the field that you want to display, you will define one index on TableA with the fields that you want to show and and index alternateKey property to Yes. define the Replacement key property for the table A as this index.


If a ReplacementKey is chosen, its fields can appear on forms to helpfully identify each record.The ReplacementKey should be a set of fields that represent the natural key.


In AX2012 Relation represents a foreign key.


In Ax2012 we will use different Terms that used to describe the keys, These terms we wont see anywhere in AX physically in property names.


Foriegn Key-In Microsoft Dynamics AX, an AOT node under MyTable > Relations represents a foreign key. 
natural key-A key whose value has meaning to people. Most replacement keys are natural keys.(ReplacementKey).
unique key-this applies to primary keys and to alternate keys. It does not apply to foreign keys. This term emphasizes that all values for a given key must be unique within one table. All fields in a unique key must be not-nullable.

Comments

Popular posts from this blog

Process of Sales order in Technical terms in D365Fo

 ðŸ”¥ Sales Order Technical Flow in D365FO (Creation → Confirmation → Picking → Packing Slip → Invoice → Accounting) 1. Sales Order Creation Tables SalesTable → SO header SalesLine → SO lines CustTable → Customer master InventDim / InventDimCombination → Dimensions InventTable / EcoResProduct → Item master Framework Classes SalesTableType / SalesLineType Responsible for validation, defaulting, creation logic Key Methods SalesTable.initValue() SalesLine.initFromSalesTable() SalesTable.validateWrite() SalesLine.validateWrite() Events (Extensions) SalesTableType.createSalesTable() SalesLineType.createSalesLine() 2. Reservation (Optional) If reservation is done: Tables InventTrans (Reservation status) InventReservation Classes InventUpd_Reservation InventTransReservation Reservations impact picking and inventory availability. 3. Sales Order Confirmation Confirms order and freezes price/quantity. Posti...

Top 200 Q&A in D365FO Technical

  SECTION 1 — X++ BASICS (10 Q&A) 1. What is X++? A proprietary object-oriented language used in Dynamics 365 Finance & Operations for business logic, similar to C# but integrated with D365 runtime. 2. What is a TableBuffer? It is an in-memory object referencing a table. Example: CustTable custTable; 3. What is difference between select and select firstonly ? select → returns all matching rows firstonly → returns only the first matched row 4. What is ttsbegin & ttscommit ? Used to wrap database transactions; ensures atomicity. 5. Can we write SQL queries directly in X++? No. X++ uses a database-abstracted select statement. 6. What is a container? A collection datatype used to store mixed data types. 7. Difference between container and map? Map stores key-value pairs; container is indexed and immutable. 8. What is a temp table? A table that stores data temporarily in memory or database depending on property. 9. What is recursion in X++? A method c...

Process of Purchase order in Technical terms in D365Fo

  Purchase Order Technical Flow in D365FO (Step-by-Step) (From creation → approval workflow → posting → product receipt → invoice → accounting) 1. Purchase Order Creation Tables involved PurchTable → PO header PurchLine → PO lines VendTable → Vendor master InventDim / InventDimCombination → Item dimensions EcoResProduct / InventTable → Item master Classes / Framework PurchTableType / PurchLineType Framework that controls creation, validation, defaulting. Key methods PurchTable.initValue() PurchLine.initFromPurchTable() PurchTable.validateWrite() PurchLine.validateWrite() Events (Extension points) PurchTableType.createPurchTable() PurchLineType.createPurchLine() 2. Purchase Order Confirmation Document Status update PurchTable.DocumentState → Confirmation PurchParmBuffer tables used for versioning. Posting Class PurchFormLetter_Confirm Called internally via PurchFormLetter::construct(DocumentStatus::Co...