I hope everyone would have heard about new feature
Partners can add keys (indexes) to base tables and table extension tables with Business Central 2021 Wave 1.
Till now We were able to add keys in Table extension which have fields from the same table extension.
In this article, we will understand what changed with Business Central 2021 Wave 1.
#msdyn365bc
Index tuning is an important tool for partners to deal with performance issues.
With changes in Business Central 2021 Wave 1, we (developers) are allowed to add fields in key from base Microsoft table.
Example - Added a Key in Customer Table Using Table Extension. (as shown below)
Key Added - Blocked.
Don't get too excited reading that, lets understand what is possible and not.
When you add a key using table extension (#msdyn365bc V18 and higher) you can create key with -
- All key fields from base tables.
- All key fields from table extension.
But you cannot add a key with combination of fields from base table and table extension. This will be an compilation issue as shown below.
Error Message - The property can only be set if the specified fields are from the same table.
Why Error ? -
- When we add a table extension, a new sql table is created in sql server.
- A Key created in Business Central will be added as index in sql table.
- In this scenario customer (base MS Table) and Customer Extension (Extension table) are two different tables in SQL.
I think its logical but I am sure that is what we (developers) expected from this feature.
Hope you like the article.
Let me know your views as comment to article.
Comments
Post a Comment