Mandatory field missing on API page (PC0026)
API pages should expose certain mandatory fields like SystemId, SystemCreatedAt, SystemCreatedBy, SystemModifiedAt, and SystemModifiedBy. These fields are important for API consumers to track record metadata.
A code fix is available for this diagnostic.
Example
The following API page is missing mandatory fields:
page 50100 "My API Page"
{
PageType = API;
SourceTable = Customer; // Mandatory field missing on API page [PC0026]
layout
{
area(Content)
{
field(name; Rec.Name) { }
}
}
}
To fix this, add the mandatory system fields:
page 50100 "My API Page"
{
PageType = API;
SourceTable = Customer;
layout
{
area(Content)
{
field(systemId; Rec.SystemId) { }
field(name; Rec.Name) { }
field(systemCreatedAt; Rec.SystemCreatedAt) { }
field(systemCreatedBy; Rec.SystemCreatedBy) { }
field(systemModifiedAt; Rec.SystemModifiedAt) { }
field(systemModifiedBy; Rec.SystemModifiedBy) { }
}
}
}