Error when filtering on option/enum field in query
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 881
- Forks
- 285
- Avg merge
- 3d 36m
- Merged PRs (30d)
- 1
Description
Please include the following with each issue:
1. Describe the bug
Issue 348390 (solved in NAV 2013 - build 34904) is back in BC 17 and BC 18
The "You have not yet retrieved a data row for this query. The value for column can only be accessed after a row is retrieved with a call to the READ function" error message is received when you set a filter, for example SETRANGE, for an option field in a query
The issue was already logged on colaborate but it was requested to log it here.
2. To Reproduce
Steps to reproduce the behavior:
Execute the DoTest action on the page "My Test Page".

The following line causes the error:
QuantityPerZoneType.SetRange(ZoneType, QuantityPerZoneType.ZoneType::Receipt);
3. Expected behavior
It should be possible to filter on an option/enum field even when the query has not been read. Similar as with record variables.
4. Actual behavior
The Web Client crashes when the DoTest action is executed:

5. Versions:
- AL Language:

- Visual Studio Code:

- Business Central:

- List of Visual Studio Code extensions that you have installed:
Only AL Language
Final Checklist
Please remember to do the following:
-
Search the issue repository to ensure you are reporting a new issue
-
Reproduce the issue after disabling all extensions except the AL Language extension
-
Simplify your code around the issue to better isolate the problem
SampleQueryFilter.zip
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 by opening SampleQueryFilter.zip and reproducing the DoTest action on My Test Page with the shown SetRange call. Trace the query and option/enum filtering behavior before a row is read; done means the filter executes without the Web Client crash and supports the expected pre-read behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vscode
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100