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,378

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
  • 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,378 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
11manish Profile Picture

11manish 9 Super User 2026 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 1 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans