Skip to content

DataItemLink using FlowFilter not recognized in Query for runtime < 19 #8199

@KOTRET

Description

@KOTRET

1. Describe the bug
For the latest preview of the al-extension, the compiler throws an error for DataItemLink if FlowFilters are used and the runtime is before 19.

Compiling against runtime 14, we extended the Customer table by some flow-filters and using them in a Query, filtering Detailed Cust. Ledger Entries.
These Fields are marked with a warning in the query:

The field 'our flow-filter-field' cannot be used in a query DataItemLink because it is a FlowField or FlowFilter. This warning will become an error when targeting a runtime with version '19.0' or higher.

This is totally fine in general, and we compile against runtime 14.
But as a follow-up, the nested DataItem gets a compiler error:

The property 'DataItemLink' must be set for nested data items. Specify how this data item relates to its parent data item. AL(AL0344)

This prevents compilation, although the runtime is set to 14.
Removing the Flow-Filters from the DataItemLink removes the warning and also resolves the compiler-error for the DataItem.

2. To Reproduce
Steps to reproduce the behavior:

example of minimal al-files:

table 50149 Test {
    fields {
        field(1; "No."; Integer) { }
        field(10; "Date Filter"; Date) {
            FieldClass = FlowFilter;
        }
    }
}

table 50148 "Test Sub" {
    fields {
        field(1; "No."; Integer) {
            TableRelation = Test."No.";
        }
        field(2; "My Date"; Date) { }
    }
}

query 50149 "Test Query" {
    elements {
        dataitem(Test; Test) {
            column(No; "No.") { }
            dataitem(TestSub; "Test Sub")
            {
                DataItemLink = "No." = Test."No.", "My Date" = Test."Date Filter";
            }
        }
    }
}

this example does not compile unless the flow-filters are removed from the DataItemLink.

3. Expected behavior
Using runtime 14 I'd not expect the compiler to error for the dataitem, just warn about the flow-filter.

4. Actual behavior
Compiler throws an additional error instead of only the warning.

5. Versions:

  • AL Language: 17.0.2107262
  • Visual Studio Code: 1.109.0
  • Business Central: 25.3
  • List of Visual Studio Code extensions that you have installed: all other disabled
  • Operating System:
    • Windows
    • Linux
    • MacOS

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions