New Features for Dynamics 365 Business Central 2021 release wave 1 (BC18): Creating new keys in a tableextension with fields from the base table

Dynamics 365 Business Central

Hi, Readers.
Today, the preview environment for Dynamics 365 Business Central 2021 release wave 1 (BC18) is available. Learn more: https://yzhums.com/10601/.

I will test and share some new features that I hope will help.

Partners can add keys (indexes) to base tables and table extension tables:

Business value:

Index tuning is an important tool for partners to deal with performance issues due to data distributions that are different than the demo company.

Feature details:

Partners can add keys to tables and table extensions in an environment.

As you might know, when developing AL table extensions, it is possible to create one or more keys, but the scope of the new key is solely in the extended table, not the base table that is being extended.
The good news is that from BC18 onwards, Partners can finally create new keys in a tableextension with fields from the base table.

For example:
Add fields from the base app.

key(NewKey; "Posting Date", "G/L Account No.", "Gen. Posting Type", "VAT Bus. Posting Group", "VAT Prod. Posting Group")
{
    SumIndexFields = Amount, "VAT Amount";
}

Add fields from table extension.

key(NewKey2; MyField1, MyField2, MyField3)
{
}

Note: You cannot add tableextension’s fields and base table’s fields to the same key.

The property ‘NewKey3’ can only be set if the specified fields are from the same table. AL(AL0423)

PS: In BC17.5 or previous versions

Reference ‘”Posting Date”‘ in application object ‘MyExtension’ does not exist AL(AL0186)

Update 2021/04/15: Information from Dynamics 365 Business Central Launch Event 2021 release wave 1

END

Hope this will help.

Thanks for reading.

ZHU

コメント

タイトルとURLをコピーしました