Skip to content

[Bug]: "Object Type" members off-by-one vs Caption in "Application Object Metadata" #8668

Description

@MaximeCaty

Describe the issue

[Bug]: "Object Type" option on virtual table "Application Object Metadata" — OptionMembers off-by-one vs OptionCaption / NavObjectType

Describe the issue

On the system virtual table Application Object Metadata (2000000071), the Object Type Option field has OptionCaption and OptionMembers out of sync.

-OptionCaption is correct and aligned with the platform NavObjectType values;
-OptionMembers is missing one separator between EnumExtension and PermissionSet (,,, in the caption vs ,, in the members).

Every member from PermissionSet onward is therefore shifted down by one ordinal when referenced in AL.

Resolved ordinals:

Member OptionMembers (current) OptionCaption / NavObjectType (correct)
PermissionSet 19 20
PermissionSetExtension 20 21
ReportExtension 21 22

Impact

Stored data uses the real NavObjectType values, so AL code that references these members by name resolves to the wrong integer:

  • SetRange("Object Type", "Object Type"::ReportExtension) filters on 21 → returns PermissionSetExtension records and never matches actual ReportExtension objects.
  • ::PermissionSetExtension resolves to 20 → matches PermissionSet.
  • ::PermissionSet resolves to 19 → matches an unused slot.

Expected: "Object Type"::ReportExtension = 22
Actual: "Object Type"::ReportExtension = 21

Suggested fix

Add one comma before "PermissionSet" in OptionMembers so it matches OptionCaption.

field(3; "Object Type"; Option)
{
    Caption = 'Object Type';
    OptionCaption = ',Table,,Report,,Codeunit,XMLport,MenuSuite,Page,Query,,,,,PageExtension,TableExtension,Enum,EnumExtension,,,PermissionSet,PermissionSetExtension,ReportExtension';
    OptionMembers = ,"Table",,"Report",,"Codeunit","XMLport",MenuSuite,"Page","Query",,,,,"PageExtension","TableExtension","Enum","EnumExtension",,,"PermissionSet","PermissionSetExtension","ReportExtension";
}

Expected behavior

Expected: "Object Type"::ReportExtension = 22
Actual: "Object Type"::ReportExtension = 21

Steps to reproduce

"Application Object Metadata".SetRange("Object Type", "Object Type"::ReportExtension) filters on 21 → returns PermissionSetExtension records and never matches actual ReportExtension objects.

Additional context

No response

I will provide a fix for a bug

  • I will provide a fix for a bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions