DataPerCompany must be explicitly set on table objects

Properties
AC0008 Hidden Design Code Fix Ignore Obsolete

The DataPerCompany property controls whether a table stores data per company or shares a single set of records across all companies. The implicit default is true.

When a developer omits the property and later discovers the table should have been shared, the change cannot be applied through a normal upgrade:

You cannot change the value to false if there is data in the table in any of the companies.

The reverse direction is equally restrictive — switching from false to true requires ForceSync and the table must be empty in all companies or contain data in only one. Once an extension ships with the wrong implicit default, there is no clean migration path.

Setting the property explicitly records the design intent in code and prevents this irreversible situation.

Example

The following table does not explicitly define DataPerCompany:

table 50100 MyTable // The table object does not explicitly define the DataPerCompany property. [AC0008]
{
    fields
    {
        field(1; MyField; Integer) { }
    }
}

To fix this, explicitly set the property. Use true when each company should have its own copy of the data:

table 50100 MyTable
{
    DataPerCompany = true;

    fields
    {
        field(1; MyField; Integer) { }
    }
}

Use false when the data is shared across all companies (shared configuration, integration records):

table 50100 MyTable
{
    DataPerCompany = false;

    fields
    {
        field(1; MyField; Integer) { }
    }
}

Exception

The diagnostic is not reported on temporary tables, since they exist only in memory and are never persisted to the database.

See also