Duplicate OData EntityName on page controls (PC0033)
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 MyPage
{
PageType = List;
SourceTable = MyTable;
layout
{
area(Content)
{
repeater(Lines)
{
// PC0033: Both produce OData name "PTE_No"
field("PTE No."; Rec.MyField) { }
field("PTE No"; Rec.MyField2) { }
}
}
}
}
To fix this, rename one of the controls so that their OData names are unique after transformation.
OData name transformation rules
| Character | Transformation | Example |
|---|---|---|
Space ( ) | _ (underscore) | "PTE No" → PTE_No |
Dot (.) | Removed | "No." → No |
Parentheses () | Removed | "Balance (LCY)" → Balance_LCY |
Slash (/) | _ (underscore) | "Country/Region" → Country_Region |
Apostrophe (') | _x0027_ | "O'Brien" → O_x0027_Brien |
Percent (%) | Percent | "Tax%" → TaxPercent |
Page types checked
This rule applies to pages with the following PageType values:
- Card
- Document
- List
- ListPart
- ListPlus
- Worksheet
API pages, RoleCenters, and other page types are 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.
Scenarios that are not flagged
- All controls have unique OData names after transformation
- API pages (have separate naming rules enforced by AL0528)
- RoleCenter and other non-data page types
- Obsolete pages (standard ALCops convention)