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...
Suggested Answer

Filtering Data in a Temporary Table Based on Document Type in a Worksheet Page

(3) ShareShare
ReportReport
Posted on by 111

Hi everyone,

I am developing a worksheet page in Dynamics 365 Business Central. You can refer to the snapshot of the page below for reference. Here's the functionality I aim to achieve:

  1. In the Roll Center, there is a Cue Group. When I click on a cue, it opens this worksheet page with data related to a specific sales person.

  2. This worksheet page includes a list that shows:

    • Quotes and Orders (from the Sales Header table).
    • Invoices (from the Customer Ledger Entry table).
  3. To achieve this, I am using a temporary table to consolidate data from these two sources.

Problem:

There is a field in the worksheet called Document Type with four options:

  • All
  • Quote
  • Order
  • Invoice

I want the list to dynamically filter the data based on the selected Document Type. For example:

  • If "Order" is selected, only Orders should be displayed in the list.
  • If "All" is selected, all data (Quotes, Orders, and Invoices) should be displayed.

My Questions:

  1. Is it possible to set a filter on a temporary table dynamically to achieve this behavior?
  2. Is this approach (using a temporary table to combine data from two different tables) the best practice?
  3. If not, what would be a better approach to implement this functionality?

Any suggestions or code samples would be greatly appreciated!

Thank you in advance!

I have the same question (0)
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    22,350 Super User 2026 Season 1 on at
  • Gerardo Rentería García Profile Picture
    26,467 Most Valuable Professional on at

    Hi, good day
    I hope this can help you, and give you some hints.

    Filtering on a temporary table

    Solved: AL: Get Selected Rows from List of Temp Table

    To join information from two tables you could use a query. Dynamics 365 Business Central: Using the query as a data source for a page (Query.Open Method) | Dynamics 365 Lab

    Best Regards
    Gerardo

  • CU09100938-0 Profile Picture
    10 on at
    You can filter a temporary table dynamically by setting a filter based on the selected document type. If "All" is selected, you can clear the filter; otherwise, apply the appropriate filter based on the selection. This approach is valid, but be mindful of performance, especially when dealing with larger datasets. Optimizing the temporary table handling can help. As a final-year student, writing my dissertation was a daunting task, and I didn’t know where to begin. A friend recommended https://domypaper.com/ and I decided to give it a try. Their expert writers helped me craft a well-structured and insightful dissertation. The process was smooth, and their customer support team was always available for queries. I couldn’t have asked for a better service during such a crucial phase of my studies.
  • Suggested answer
    YUN ZHU Profile Picture
    100,473 Super User 2026 Season 1 on at
    I don't think it's necessary to think so complicated. This is a temporary table and data needs to be inserted when the page is opened.
    When inserting data, just add different filters according to your conditions.
    You can add a function passing parameters in the page you need to open.
     
    Hope this can give you some hints as well.
    Thanks.
    ZHU
  • Shraddha Jadav Profile Picture
    111 on at
    Hello @YUN ZHU,
     
    Ya you are right but Inserting all the data when the page opens can take a lot of time. Is there an alternative solution to handle this more efficiently?
  • Suggested answer
    YUN ZHU Profile Picture
    100,473 Super User 2026 Season 1 on at
    Then don't use a temporary table.
    Sorry, I don't know the purpose of this temporary table. If the table contains data, you only need to change the filters according to the conditions.
    You can update this table when needed instead of reinserting data every time you open it.
     
    Thanks.
    ZHU

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,072 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,129 Super User 2026 Season 1

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 650 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans