Creating TableExtensions in BC29 like we’re back in NAV!

The biggest under-the-hood change in BC29 is how table extensions are stored in the SQL database. Now everything is back in a single table. Check the video for the details:

https://youtu.be/PZVTTem-nZw

In this video, Erik walks through one of the most significant under-the-hood changes in Business Central 29: table extensions are no longer stored in separate SQL tables. This means we can now create cross-app keys in table extensions — combining base app fields with your own extension fields in a single key. It’s a change that brings us back to the simplicity of the NAV days, but with the modern extension architecture intact.

A Brief History of Table Extensions in Business Central

Back in the NAV days, customizing a table was straightforward. You opened the Object Designer, added fields to a table like the Customer table, and saved it. On SQL Server, it was all one table — your custom fields sat right alongside the standard ones.

Of course, this simplicity came at a cost: it made upgrades extremely painful. Every customization directly modified the base objects, which is a big part of why NAV earned its reputation for being difficult to upgrade.

The Extension 2.0 Model

When Microsoft introduced the Extension 2.0 model with AL code (starting around Business Central version 12), they took a different approach. Extension fields were stored in separate SQL tables — one per app, per extended table. So if you had five apps extending the Sales Header (table 36), SQL Server had to perform a join across six tables just to retrieve a single record.

The Introduction of Load Fields

To address the performance issues caused by these multi-table joins, Microsoft introduced load fields — a way to specify exactly which fields your code needs. If you didn’t reference fields from a particular app’s extension, those tables could be excluded from the join, resulting in significantly faster queries.

This helped, but there were still many cases where you genuinely needed all fields, and it was difficult to predict in advance which fields could safely be excluded — especially in UI scenarios.

The Compaction Step (Around BC24)

Microsoft then introduced table compaction, where all extension fields from all apps were merged into a single companion SQL table. This meant that instead of joining across potentially eight tables, you only ever had a join between two tables: the base table and one extension table. A huge improvement.

However, one major limitation persisted: you could not create cross-app keys. If you added fields to Customer Ledger Entries and wanted a key that combined the standard “Customer No.” field with your custom fields, you simply couldn’t do it. The fields lived in different tables on SQL Server.

BC29: Everything in One Table

With Business Central 29, Microsoft has finally completed the journey. Extension fields are now stored directly in the base table on SQL Server — just like the NAV days, but managed properly through the extension framework. The base table and the extension fields exist as a single table on SQL.

And with that change comes the feature many partners have been waiting for: cross-app keys.

How to Create Cross-App Keys

To take advantage of this feature, you need to target runtime 18.0 and platform 29. Here’s what the setup looks like in your app.json:

{
  "id": "5cf03cc2-18f0-4fc4-b826-122d09ef994a",
  "name": "UsingTheDesigner",
  "publisher": "Default publisher",
  "version": "1.0.0.0",
  "platform": "1.0.0.0",
  "application": "19.0.0.0",
  "runtime": "8.0",
  "idRanges": [
    {
      "from": 50100,
      "to": 50149
    }
  ],
  "resourceExposurePolicy": {
    "allowDebugging": true,
    "allowDownloadingSource": false,
    "includeSourceInSymbolFile": false
  }
}

Note: To use cross-app keys, you’ll need to update the runtime to 18.0 and ensure you’re deploying to a BC29 environment.

Creating the Table Extension with a Cross-App Key

Here’s the key part. You create a table extension as usual, adding your custom fields. But now, in the keys section, you can reference fields from the base table alongside your own:

tableextension 50100 CustomerExtension extends Customer
{
    fields
    {
        field(50100; "Important Field One"; Date)
        {
        }
        field(50101; "The Other Field"; Decimal)
        {
        }
    }

    keys
    {
        key(NewKey; "No.", "Important Field One")
        {
        }
    }
}

That’s it. The "No." field comes from the base Customer table, and "Important Field One" is your extension field. In previous versions of Business Central, this would have been impossible — you’d get a compilation error because the fields resided in different SQL tables.

The Workaround That’s No Longer Needed

Before BC29, some partners resorted to a workaround: duplicating base app fields in their extension table just to build usable keys. For example:

tableextension 50100 CustomerExtension extends Customer
{
    fields
    {
        field(50100; "Important Field One"; Date)
        {
        }
        field(50101; "The Other Field"; Decimal)
        {
        }
        // Workaround: duplicate field just for key purposes
        field(50102; "Customer Number"; Code[20])
        {
            TableRelation = Customer."No.";
        }
    }

    keys
    {
        key(NewKey; "Customer Number", "Important Field One")
        {
        }
    }
}

This meant you had to populate the duplicate field, keep it in sync, and live with the redundancy. Even then, performance wasn’t ideal because the key still operated on a separate SQL table. With BC29, this workaround is completely unnecessary.

Things to Be Aware Of

There are a couple of considerations with this architectural change, though Erik notes they’re more theoretical than practical:

  • Uninstalling apps takes longer: Previously, if your app was the only one extending a table, Microsoft could simply drop the companion table. Now, uninstalling an app and deleting its data requires an ALTER TABLE operation to drop individual columns. SQL Server handles this well, so it’s unlikely to be a real-world problem, but it is a change in behavior.
  • SQL column limits: SQL Server has a practical limit of around 1,024 columns per table in the configuration Business Central uses. If multiple independent apps all add large numbers of fields to the same table, you could theoretically hit this limit. Erik points out that if you’re adding 800 fields to a table, that’s likely a design issue rather than a platform limitation — but it’s worth keeping in mind.

Conclusion

The merging of table extension fields into the base SQL table in BC29 is arguably the most impactful change in this release, even though it’s invisible at the surface level. It eliminates the long-standing performance overhead of SQL joins for extension tables and finally enables cross-app keys — something partners have needed since the Extension 2.0 model was introduced.

This is a significant engineering effort from Microsoft, and as Erik puts it: kudos to them for making such a fundamental architectural improvement this far into the product’s lifecycle. Business Central is effectively on its 18th major version, and changes like this show a commitment to getting the foundation right.

If you work with high-traffic tables, ledger entries, or any scenario where you’ve been duplicating base app fields just to build usable keys, BC29 is going to make your life considerably better.