web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Query Left Join Not Working

(0) ShareShare
ReportReport
Posted on by 3,297

Hi Guys

On Query object -I'm struggling with a left join from Item table to attributes table. Some items don't have all the attributes and these items are not displayed since the DataItemTableFilter acts as a where clause. Is there anyway get all items including items without attributes.  Sample code:

                                    dataitem(ItemAttributeValueMapping; "Item Attribute Value Mapping")
                                    {
                                        DataItemLink = "No." = Item."No.";
                                        SqlJoinType = LeftOuterJoin;
                                        DataItemTableFilter = "Table ID" = const(27), "Item Attribute ID" = const(12);
Converted to SQL what I really want is something like:
Left Join No = Item.No and Table ID = 27 and Attribute ID = 12 
So all items are displayed.  I'm wondering if BC queries are advanced enough to handle this or we have develop pages with variables etc
I have the same question (0)
  • Verified answer
    AliHamza Profile Picture
    175 on at

    Hi Samantha,

    DataItemTableFilter would be used to filter the Sales Line table before joining it to the Item table. It turns out that the join is processed first, respecting the DataItemLink properties, and the DataItemFilter property is used to filter the joined results afterwards.

    This is the limitation of AL Query objects.

    Better solution is to develop pages with variables

    Verify my answer if it resolves your query

  • Verified answer
    Samantha73 Profile Picture
    3,297 on at

    Thanks for verifying this is a limitation, which is really disappointing since we cannot invest in queries unless we know for sure requirements will not end up hitting limitations and in most cases we need to expand on reports and queries as we use the system.  And I expect this will be improved in a future version without  having to create an Idea!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,965 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,125 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 961 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans