[Bug]: "Object Type" members off-by-one vs Caption in "Application Object Metadata"
Nobody has claimed this yet.
- Dominant language
- AL
- Stars
- 683
- Forks
- 459
- Avg merge
- 3d 26m
- Merged PRs (30d)
- 633
Description
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 on21→ returns PermissionSetExtension records and never matches actual ReportExtension objects.::PermissionSetExtensionresolves to20→ matches PermissionSet.::PermissionSetresolves to19→ 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Application Object Metadata virtual table, field 3, "Object Type", and compare OptionMembers with OptionCaption and the platform NavObjectType values described in the issue. Add the missing separator before PermissionSet, then verify that ReportExtension resolves to 22 and that the SetRange reproduction matches ReportExtension records.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100