Skip to main content

Notifications

Community site session details

Community site session details

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

Filtering G/L Account Table Efficiently

(1) ShareShare
ReportReport
Posted on by 78
Hi Experts, 
 
Recently I was asked a question , which was 'To filter a G\L account table efficiently' means performance of filter should be very efficient.
 
I know about setCurrentKey , also applied that, but result was not fast.
 
I found that the field which was used as filter parameter, that was not there in G\L account table ,may be this can make setcurrentkey slow. 
 
 
Could someone help me to suggest the best efficient way to filter out large dataset tables in Business Central ? 
 
Thanks, 
Ankit
  • Verified answer
    Mustafa Omerbegović Profile Picture
    1,420 Super User 2025 Season 1 on at
    Filtering G/L Account Table Efficiently
    Hello,
     
    you can find almost all the information on Microsoft Learn and below are the links where you can read more about filtering.
     
     
    Also, you can find a lot of different material on the next blogs.
    Search for main words and you will find something useful for sure.
     
     
    If you have specific questions about a problem, I am at your disposal.
     
    Greetings
  • Unanonyms.5974 Profile Picture
    78 on at
    Filtering G/L Account Table Efficiently
    Thanks , @Mustafa and @VK for you response .
     
    @Mustafa , Could you suggest some resource to know better , how to make indexes for filtered fields . 
     
    @VK, just want to know about efficiently filtering on large datasets tables.
     
    Thanks both of you...
  • VK-16090859-0 Profile Picture
    14 on at
    Filtering G/L Account Table Efficiently
    Ankit, though GL Account Table is short, seems you are facing challenge into GL Entry associated as one of the  flowfield of COA. Can you explain what actually are you trying to advise you.
  • Mustafa Omerbegović Profile Picture
    1,420 Super User 2025 Season 1 on at
    Filtering G/L Account Table Efficiently
    Hello,
     
    it depends on the data you are filtering, but there are some best practices:
     
    • Index the filtered fields to speed up process.
    • Use SETRANGE for simple filtering as it is more efficient than SETFILTER, but SETFILTER can handle more complex conditions.
    • Apply filters in the begging and filter on indexed fields first.
    • Also you can use temporary tables or SQL queries if necessary, for very large datasets and this is the fastest way to get data I think.
    It is also necessary to consider the basic principles of SQL filtering that integer fields will be filtered the fastest, even better if they are indexed.
     
    I hope someone else will give some ideas.

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 1,452

#2
YUN ZHU Profile Picture

YUN ZHU 1,313 Super User 2025 Season 1

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 1,083 Most Valuable Professional

Featured topics

Product updates

Dynamics 365 release plans