AllowInCustomizations redundancy (LC0094)
When a table or tableextension defines AllowInCustomizations at the object level, individual fields do not need to repeat the same value. Redundant AllowInCustomizations properties on fields add noise without providing additional value.
A code fix is available for this diagnostic.
Example
The following field redundantly specifies the same AllowInCustomizations as the table:
table 50100 MyTable
{
AllowInCustomizations = Never;
fields
{
field(1; MyField; Integer)
{
AllowInCustomizations = Never;
}
}
}To fix this, remove the redundant property from the field:
table 50100 MyTable
{
AllowInCustomizations = Never;
fields
{
field(1; MyField; Integer)
{
}
}
}
Table extensions
For table extensions the rule only looks at the AllowInCustomizations property defined on the table extension object itself. It does not consider the base table being extended. This means that if the base table sets AllowInCustomizations = Never and your table extension independently sets the same value, no diagnostic is raised. The table extension keeps its own explicit setting so it is unaffected when the base table changes.
The following field is flagged because it repeats the value already set on the table extension:
tableextension 50100 MyTableExtension extends MyTable
{
AllowInCustomizations = Never;
fields
{
field(50100; MyExtField; Integer)
{
AllowInCustomizations = Never;
}
}
}However, setting AllowInCustomizations on the table extension object itself is not considered redundant even when the base table already specifies the same value. The following code does not trigger a diagnostic:
tableextension 50100 MyTableExtension extends MyTable
// Base table already has: AllowInCustomizations = Never;
{
AllowInCustomizations = Never;
fields
{
field(50100; MyExtField; Integer)
{
}
}
}