indexes in x++

 what is index?


-> An index is a table-specific database structure that speeds the retrieval of rows from a table.


-> Indexes are used to improve the performance of data retrieval


-> Indexes are associated with a single table and located in the Application Object Tree


There are two types of indexes:


1) Unique Index


2) Non-unique Index


-> Unique index does not allow to create any duplicate values in the table.


-> To create unique records set the allowduplicates property to NO.


-> non-unique index allows us to create duplicate values in the table.


-> To create duplicate records set the allowduplicates property to NO.


Note:


-> If you include a RecId field in an index, the index will be unique.


When you include this field and set the property to Yes, the Microsoft Dynamics AX compiler displays a warning.


-> To disable the index, set the Enabled property to No. When you disable an index, it is deleted from the database.


-> We can also delete an index by right-clicking the index, and then clicking Delete.


-> Microsoft Dynamics AX requires a unique index on each table so if there are no indexes on a table or all the indexes are disabled, 


  a system index is automatically created.

  

-> The system index is created on the RecId and DataAreaId fields if the DataAreaId field exists. 


   Otherwise the system index is created on the RecId field. You can see system indexes in the database but they aren't visible in the AOT.

Comments

Popular posts from this blog

How to Create a wizard in x++ d365

how to post trade agreement journals automatically using x++ code

X++ code to CREATE AND POST A TRADE AGREEMENT IN MICROSOFT DYNAMICS 365 in D365 F & O