DataPerCompany must be explicitly set on table objects (AC0008)
The DataPerCompany property on table objects can be used to specify whether there should be a SQL table for each company or a single SQL table used by all companies.
The implicit default of the DataPerCompany property is true, which means that if the developer intended it to be false but forgets to set it and the solution is released, there is no proper way to resolve this with a future update, i.e., there is no way to decide which values and/or records are the ones that should be retained when changing from a DataPerCompany = true table to a DataPerCompany = false table.
Explicitly declaring this property ensures that the design intent is clear and documented in the code, preventing data isolation issues in multi-company environments.
Note: This rule is disabled by default. Enable it in your project’s .editorconfig or ruleset file if you want to enforce explicit DataPerCompany declarations.
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:
table 50100 MyTable
{
DataPerCompany = true;
fields
{
field(1; MyField; Integer) { }
}
}