microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
719 stars 242 forks source link

Query Object - SqlJoinType is not respected when a DataItemTableFilter is added to the data item. #7694

Closed avaanr closed 3 months ago

avaanr commented 3 months ago

1. Describe the bug SqlJoinType is not respected when a DataItemTableFilter is added to the data item.

2. To Reproduce

query 77000 MyQuery
{
    QueryType = Normal;

    elements
    {
        dataitem(customer; Customer)
        {
            column(systemId; SystemId)
            {
                Caption = 'Id', Locked = true;
            }
            column(customerNumber; "No.")
            {
                Caption = 'Customer No.', Locked = true;
            }
            dataitem(custLedgEntry; "Cust. Ledger Entry")
            {
                DataItemLink = "Customer No." = Customer."No.";
                DataItemTableFilter = "Document Type" = filter(Invoice | "Credit Memo");
                SqlJoinType = LeftOuterJoin;

                column(totalSalesAmount; "Sales (LCY)")
                {
                    Caption = 'TotalSalesAmount', Locked = true;
                    Method = Sum;
                }
                filter(dateFilter; "Posting Date")
                {
                    Caption = 'DateFilter', Locked = true;
                }
            }
        }
    }

}

3. Expected behavior Displays a list of all customers, even those with zero sales.

4. Actual behavior Display a list of customers who have made sales. This behavior only occurs when the DataItemTableFilter property is set. The expected behavior occurs if the mentioned property is not added.

5. Versions:

Final Checklist

Please remember to do the following:

BazookaMusic commented 3 months ago

Could be a runtime bug or a generated code issue

thloke commented 3 months ago

Checked, this is a runtime issue so the bug cannot be handled through github and should go through CSS.

thloke commented 3 months ago

Hi, this issue is out of scope of for this repository. You should do one of the following:

As a reminder, this repository only handles issues to do with the compiler or VSCode development experience for AL.