Skip to main content

Notifications

Announcements

No record found.

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 31
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
    Mustafa Omerbegović 1,249 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
    Unanonyms.5974 31 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
    VK-16090859-0 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
    Mustafa Omerbegović 1,249 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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans