Troubleshooting a Business Central Query Builder List with Multiple Joins
When a Business Central Query Builder list joins several tables, you may find the list is slow to load, times out, returns duplicate rows, or is missing records you expected to see. In most cases, the cause comes down to one of the joins: the wrong join field, a join field with blank values, the wrong join type, or a query that pulls back far more data than it needs.
Before You Begin
The methods below show how to isolate which join is causing the problem and how to tune your Query Builder list so it returns exactly the data you need. If you are not familiar with building a Query Builder list, see How to Create a Query Builder List first.
Method 1: Publish Each Side of the Join as a Single Table List
Before troubleshooting the join itself, look at the raw data on each side of the join. By publishing the left table and the right table as their own single table Query Builder lists, you can see exactly what values Business Central stores in the fields you plan to join on.
In this example, the list joins the Sales Header table to the Sales Line table.
1. Navigate to your Dynamics 365 Business Central Sandbox connector and select the Edit icon to the right of the connector.
2. In the left navigation, select Lists and then select the Query Builder tab.
3. Select Add list.
4. Give the list a name that makes it easy to identify as a test list, such as TEST – Sales Header. The API endpoint is generated automatically from the name. Then select a Group for the list.
5. Select Query builder in the left navigation menu and then select Add a table. Add only the left side of your join (in this example, Sales Header).
6. Add the field(s) you are currently joining on, along with a few identifying fields such as Document Type, No., and Sell-to Customer No.
7. Repeat Steps 2 through 6 for the right side of your join. In this example, Sales Line is the right side of the join. Add the matching join field(s), such as Document Type and Document No.
8. Open your Sandbox connector and select Publish in the left navigation menu.
9. Select Publish.

You should now have both test lists published. Add both lists to a tab on your Popdock homepage. Compare a few records you know should match and confirm the values in the join fields line up exactly between the two lists. If the values don’t match the way you expected, you’ve found your issue before ever looking at the join list.
Method 2: Verify You Are Joining on the Correct Field
Now that you have both sides of the join in their own lists, use them to answer the following questions about your join field.
Are you joining on the right field?
A field name that looks correct is not always the field Business Central uses to relate the two tables. For example, the Sales Line table relates back to the Sales Header using Document No., not No. (on the Sales Line, No. is the item, G/L account, or resource number). Joining on the wrong field will either return no matches or match records that have nothing to do with each other.
Do you need more than one join field?
Sort the left list by the join field and look for repeated values. If the same value appears more than once, a single join field isn’t enough to uniquely identify a record. In this example, the same document number can exist for different document types, so the join should be on both Document Type and Document No. Joining on Document No. alone can multiply your rows and produce duplicates.
Does the join field contain blank values?
Filter each list for records where the join field is empty. Business Central typically stores an empty value as a blank or a 0 rather than a true null, so check for both. Common examples are a Dimension Set ID of 0 or a blank No. on comment lines.
Blank values matter because every blank on the left side matches every blank on the right side. If you have 5,000 lines with a blank join value on one side and 2,000 on the other, the join can return 10,000,000 rows from those records alone. This is one of the most common causes of a Query Builder list that becomes very slow or times out.
If you find blank values, you can resolve them by:
1. Adding a restriction to exclude blank values from the join field (see Method 3 below).

2. Adding a second join field that makes the match unique.

3. Changing the join type so records without a match are handled the way you expect (see the join types section below).

Join Types Available in Query Builder
When you add a table to your Query Builder list, you can choose the Join type from the dropdown. All five join types are available, and choosing the right one affects both the rows returned and how quickly the list loads.
| Join type | What is returned | When to use / performance |
|---|---|---|
| Cross join | Every record in the left table combined with every record in the right table. | No join field is used. Row counts multiply quickly and can cause timeouts. |
| Full outer | All records from both tables, matched where possible. | Returns the most data. Use for reconciliation rather than everyday reporting. |
| Inner | Only records that have a match in both tables. | Usually the fastest option, since unmatched records are dropped. |
| Left outer | All records from the left table, plus matching records from the right table. | Use when every left record must show, even with no match. |
| Right outer | All records from the right table, plus matching records from the left table. | Useful for finding right table records with no parent, such as orphaned or bad data. |
If your list is returning more rows than expected, check whether a Left outer or Full outer join could be an Inner join instead. If your list is missing rows, check whether an Inner join is dropping records that don’t have a match on the other side. For examples of the data each join type returns, see Understanding Join Types in Popdock.
Method 3: Build Restrictions Into the Query Builder List
When you filter a list, Popdock first has to retrieve the data from Business Central and then apply the filter. If your Query Builder list returns every record from several joined tables, that is a lot of data to pull back just to filter most of it away.
A restriction in Query Builder is applied inside the query itself, so Business Central only returns the records that meet your criteria. This reduces the amount of data being joined and returned, which can make a large difference in performance.
1. Edit your Query Builder list and select Query builder in the left navigation menu.
2. Select the field you want to restrict, for example, the Document Type field on the Sales Header table.
3. Add a restriction for the value you need, such as Document Type equal to Order.
4. Add any additional restrictions.
5. Publish the query to your Sandbox environment (see Method 1, Steps 8-9) and test the list.

Good candidates for restrictions include:
- Document types or entry types your report never uses.
- Blank or 0 values in a join field (see Method 2 above).
- Line types you do not need, such as comment lines.
- A date range when the report only ever covers recent periods.
Keep in mind that a restriction is built into the published query, so every user of the list will only see the restricted data. If users need to change a value regularly, such as a date range, leave that as a Popdock filter and restrict only the values that never change.
Method 4: Duplicate the List and Remove Tables to Isolate the Problem
If you’re still not sure which join is causing the issue, you can work backward by removing tables one at a time. Using the Duplicate option lets you do this without touching the original list your users rely on.
1. Navigate to your Dynamics 365 Business Central Sandbox connector and select the Edit icon to the right of the connector.
2. Select Lists in the left navigation menu.
3. Select the Query Builder tab, locate your list, and then select the Duplicate icon.
4. Rename the duplicated list so it is easy to identify, such as TEST – Sales Analysis.
5. Select Query builder in the left navigation menu and remove the last table that was added to the query, along with its fields.
6. Publish the query to your Sandbox environment and test the list.
7. If the list is still slow or returning incorrect data, remove the next table and publish again. Repeat until the list loads quickly and returns the data you expect.
Once the list works, the last table you removed is the most likely cause of the issue. To work out why it causes the problem:
1. Publish that table on its own as a single table list (see Method 1) and compare its join field values to the table it joins to.
2. Check the join field for blank or 0 values and for repeated values that would require a second join field (see Method 2).
3. Add the table back to the duplicated list. Review the join type and confirm it is returns only the rows you need (see Join Types Available in Query Builder).
4. Add restrictions to that table to limit the records it brings into the join (see Method 3).
After each change, publish and test the duplicated list again. Once it works the way you expect, apply the same changes to your original Query Builder list and remove the test lists from your Sandbox.
In some cases, you may find the list works better without that table at all. If you only needed one or two fields from that table, check whether those fields are available on another table already in the query.
If you have questions about troubleshooting your Business Central Query Builder list, contact support@eonesolutions.com.