Multiple Unique Keys on AL Tables in Business Central

My first thought was FINALLY.

Having multiple unique keys is very common in just about all databases and finally it is coming to Microsoft Dynamics 365 Business Central.

Basically there is a new property that can be set on each key called “unique” which indicates that this key is a unique key.

When you have a unique key there cannot be any records in the database with the same key and it is validated and verified at the time a record is inserted that this is the case. If there is a duplicate key the insert will fail.

Why am I so excited about this? Well one of the things I have wanted for many years is a surrogate key. A key consisting of a single field that is unique and not based on any of the user controlled data in the table. Basically a single unique key on every record in a table. I have wanted that on all tables in Business Central, because it would create a single anchor to connect everything and anything to.

Having multiple unique keys is the start for creating this, so hoping this is just the beginning.

All the information in this blog is public and can be found here: https://docs.microsoft.com/en-us/business-applications-release-notes/April19/dynamics365-business-central/multiple-unique-indexes

This is coming in the April 2019 release as per https://docs.microsoft.com/en-us/business-applications-release-notes/April19/dynamics365-business-central/planned-features

Happy Coding to everyone.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.