Skip to main content

#msdyn365bc - Add keys to Base Tables?

Hi Readers,

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.

Regards,
Saurav Dhyani
www.sauravdhyani.com

Comments

Popular posts from this blog

VIEW SERVER STATE permission on SQL Server?

Hi all, Sometime While trying to Login into a database we face an error message as shown below. --------------------------- Microsoft Dynamics NAV Classic --------------------------- You cannot start Microsoft Dynamics NAV Classic because you do not have the VIEW SERVER STATE permission on SQL Server. Contact your system administrator. --------------------------- OK    ---------------------------

BC 21 and Higher - PowerShell Cmdlet (Replacement of Business Central Administration).

Hi Readers, As discussed in last article about deprecating of Business Central Administration, there are few common actions that we use in administration till Business Central 20. For our on-prem customers, we will still require doing activities. As Microsoft suggest we need to start using PowerShell cmdlet.    Let's see how to do those via PowerShell, or Administration Shell. I will be keep adding commands as you comment to this article.

Send Mail with Attachment From Navision.

Hi all, We have seen how to save a report into PDF and how to send mail to a customer. Let's link these two post in one i.e. Mailing statement to a customer into PDF Format. This article is part of the Series. Please Refer  Table of Content here . If you have the old objects set let me brief you what I will be changing -