Duplicate OData EntityName on page controls

Properties
PC0033 Warning Design Code Fix Ignore Obsolete

Page controls can produce duplicate OData EntityNames after the EDMX name transformation. When two controls resolve to the same OData property name, Business Central fails at runtime when users use Edit in Excel or any OData-based integration.

The AL compiler has similar checks (AL0757/AL0758) but they use a different name mangling that does not match the OData/EDMX transformation. For example, dots (.) are mapped to a46 in the compiler’s check but are removed in OData. This means "PTE No." and "PTE No" pass the compiler checks but produce the same OData name PTE_No.

Example

page 50100 "My Page"
{
    PageType = List;
    SourceTable = "My Table";

    layout
    {
        area(Content)
        {
            repeater(Lines)
            {
                field("PTE No."; Rec.MyField) { } // Duplicate OData EntityName on page controls [PC0033]
                field("PTE No"; Rec.MyField2) { } // Duplicate OData EntityName on page controls [PC0033]
            }
        }
    }
}

Rename one of the controls so that their OData names are unique after transformation:

page 50100 "My Page"
{
    PageType = List;
    SourceTable = "My Table";

    layout
    {
        area(Content)
        {
            repeater(Lines)
            {
                field("PTE No."; Rec.MyField) { }
                field("PTE Number"; Rec.MyField2) { }
            }
        }
    }
}

OData name transformation rules

Business Central field names are mapped to EDMX property names by applying the following transformations:

  • Spaces are replaced with underscores (_)
  • Dots (.) are removed (example: No.No)
  • Parentheses are removed (example: Balance (LCY)Balance_LCY)
  • Slashes (/) are replaced with underscores (example: Country/RegionCountry_Region)
  • Apostrophes (') are encoded as _x0027_ (example: Don'tDon_x0027_t)
  • Percent signs (%) are replaced with Percent (example: Profit %Profit_Percent)

Use OData to Return and Obtain a Service Metadata Document on Microsoft Learn

Page types checked

This rule applies to pages with the following PageType values:

  • Card
  • Document
  • List
  • ListPart
  • ListPlus
  • Worksheet

API pages are excluded — the compiler already enforces unique entity names via AL0528. RoleCenters and other non-data page types are also excluded.

Primary key fields

Primary key fields from the source table are automatically included as OData properties per the EDMX specification. This rule checks for collisions between page controls and primary key field names.

Page extensions

Page extensions are checked against the combined set of base page controls and primary key fields. Diagnostics are only reported on the extension’s own controls, since the developer cannot rename base page controls.

See also