microsoft / microsoft/AL

AL0186 erroneous message

Open
#8,122 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

accepted
Dominant language
PowerShell
Stars
881
Forks
285
Avg merge
3d 36m
Merged PRs (30d)
1

Description

1. Describe the bug
A clear and concise description of what the bug is.

Error that a standard field does not exist (it does), when linking a flowfilter using "filter()" instead of "field()".

src\tableext\TeamMemberCue.TableExt.al(13,127): error AL0186: Reference 'Starting Date' in application object 'Time Sheet Header' does not exist

2. To Reproduce
Steps to reproduce the behavior:

        field(73901; "Active Time Sheets ASDF"; Integer)
        {
            CalcFormula = count("Time Sheet Header" where("Owner User ID" = field("User ID Filter"), "Starting Date" = filter("Active Date Filter ASDF")));
            Caption = 'Active Time Sheets';
            FieldClass = FlowField;
            Editable = false;
        }

3. Expected behavior
Should give the real error.

4. Actual behavior
Gives a nonsense error.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by compiling the provided AL snippet and compare the AL0186 diagnostic when the FlowFilter uses filter() instead of field(). Trace the compiler path that resolves the referenced field and reproduce the case with the Time Sheet Header and Starting Date references. Done means the diagnostic reports the actual invalid reference or misuse rather than claiming that Starting Date does not exist.

Written by the indexing model from the issue text.

Assessment

Domain
compilers, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.