In the previous article, I explained how to create a table in D365 FO. In this article, I will explain how to set indexes on table. As we know tables are the core objects used to store data in Microsoft Dynamics 365. A table index increases the speed of the retrieval of data from a table. So, while creating a table don’t forget to set the index for the table. An index helps
- Increase the speed of the retrieval of rows from a table.
- Indexes are used to improve the performance of data retrieval.
- occasionally an index helps to ensure the existence of unique records.
- In D365 FO like other database objects, indexes are synchronized with the database.
- Hence, Once an index is created, indexes are managed automatically by the DBMS every time a record is inserted, updated, or deleted.
So here I am referring to the same table TblEmployee which was created in the previous article, you can refer to the article here.
Restore the structure of the table that we created in the previous article.
- It will create an index with the default name Index1.
- Right-click on Index1 and go to Properties.
- Rename the Index Name, here I renamed it to EmployeeIdx.
- Next, specify whether the index is unique or non-unique by doing one of the following:
- To specify that the index is a non-unique index, confirm that the AllowDuplicates property is set to Yes.Â
- It is recommended that you create non-unique indexes for optimum database performance.
- To specify that the index is unique, set the AllowDuplicates property to No.Â
- When the index is unique, you cannot insert records with duplicate key values.Â
- A warning is issued to the user if he attempts to insert records with duplicate values.
- To disable the index, set the Enabled property to No. When you disable an index, it is deleted from the database.
- You can also delete an index by right-clicking the index, and then click Delete.
- Before building the solution, please make sure that the Table property Synchronize Database on Build is set as True.
Through the next articles, we will learn how to set field groups on a table and how to create a relation to another table. If this post is useful for you, try to share this with your friends also. You can explore more tutorials from this blog. Happy coding with D365 Snippets.
Useful Tags
How to Create an Index
What is an index in Dynamics 365?
When would you create an index?
How do you index data?
What is an example of an index?
Why do we CREATE INDEX?
dynamics 365 table relationships
d365 table relationship type
dynamics 365 finance and operations table relations
an index must contain at least 1 non-included column d365
form Datasource extension d365
select statement in x++
how to create the non-clustered index in ax 2012
on inserting event handler d365