Explicitly set AllowInCustomizations for excluded fields

Properties
AC0026 Info Design Code Fix Ignore Obsolete

Developers often add table fields that are never placed on a page — internal flags, processing state, or fields reserved for future use. They assume these fields stay hidden from end users.

Since Business Central 2023 wave 2, page customizations can add any table field to a page through the Add field to page pane — including fields that no page or page extension references. By default, every field is available for customization. Without an explicit AllowInCustomizations setting, an administrator customizing a profile page can surface an internal field in the UI, exposing data that was never intended to be visible.

Set AllowInCustomizations explicitly on every field not exposed on a page: Never to block it from page customizations entirely, AsReadOnly to allow it as a read-only column, or AsReadWrite to allow full editing.

Example

The "Sync Batch ID" field is not referenced on any page. Without AllowInCustomizations, it can still be added through page customization:

table 50100 "Booking Setup"
{
    fields
    {
        field(1; "Primary Key"; Code[10]) { }
        field(2; "Default Location Code"; Code[10]) { }
        field(3; "Sync Batch ID"; Guid) // Explicitly set AllowInCustomizations for excluded fields [AC0026]
        {
        }
    }
}

page 50100 "Booking Setup"
{
    SourceTable = "Booking Setup";

    layout
    {
        area(Content)
        {
            field("Default Location Code"; Rec."Default Location Code") { }
        }
    }
}

To fix this, set the AllowInCustomizations property explicitly. Use Never for fields that should not appear in page customizations, AsReadOnly for fields that may be shown but not edited, or AsReadWrite for fields that may be both shown and edited:

table 50100 "Booking Setup"
{
    fields
    {
        field(1; "Primary Key"; Code[10]) { }
        field(2; "Default Location Code"; Code[10]) { }
        field(3; "Sync Batch ID"; Guid)
        {
            AllowInCustomizations = Never;
        }
    }
}

When all fields in a table or table extension should share the same setting, set the property at the object level:

table 50100 "Booking Setup"
{
    AllowInCustomizations = Never;

    fields
    {
        field(1; "Primary Key"; Code[10]) { }
        field(2; "Default Location Code"; Code[10]) { }
        field(3; "Sync Batch ID"; Guid) { }
    }
}

When the diagnostic is reported

  • The field is not referenced by any page or page extension for the table.
  • Neither the field nor the containing table or table extension has AllowInCustomizations set.
  • The table has at least one page with it as SourceTable. For table extension fields, the base table must have a page or define LookupPageId or DrillDownPageId.

Exception

The rule skips field types that cannot be added through page customizations: Blob, Media, MediaSet, RecordId, and TableFilter. FlowFilter fields, disabled fields (Enabled = false), and fields with Access set to Local or Protected are also excluded.

See also