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

Custom API page returns error "The node count limit of '100' has been exceeded."

(4) ShareShare
ReportReport
Posted on by 20
Hi, 
 
I've created a custom API page to retreive records from a custom table. To get the records I need, I use odata filterexpression, e.g.: 
"startswith(itemNo,'11054') or startswith(itemNo,'11057') or startswith(itemNo,'11058') or startswith(itemNo,'11062') or startswith(itemNo,'11063') or startswith(itemNo,'11064') or startswith(itemNo,'11065') or startswith(itemNo,'11066') or startswith(itemNo,'11081') or startswith(itemNo,'11082') or startswith(itemNo,'11083') or startswith(itemNo,'11084') or startswith(itemNo,'11085') or startswith(itemNo,'11086') or startswith(itemNo,'11115') or startswith(itemNo,'11090') or startswith(itemNo,'11091') or startswith(itemNo,'11104') or startswith(itemNo,'11105') or startswith(itemNo,'11106') or startswith(itemNo,'11107') or startswith(itemNo,'11108') or startswith(itemNo,'11109') or startswith(itemNo,'11110') or startswith(itemNo,'11111') or startswith(itemNo,'11112') or startswith(itemNo,'11140') or startswith(itemNo,'11114') or startswith(itemNo,'11128') or startswith(itemNo,'11129') or startswith(itemNo,'11138')"
The I get the error "The node count limit of '100' has been exceeded. To increase the limit, set the 'MaxNodeCount' property on EnableQueryAttribute or ODataValidationSettings". When I only use 1 or 2 'or' statements it works fine. I found out this is standard Odata behaviour. MaxNodeCount exceeded · Issue #579 · OData/RESTier · GitHub.
 
Is there a possibility to increase the MaxNodeCount? If yes, how and where? Would this be possible in the code of my API page? Or are there other solutions to avoid this problem? I was not able to find any information about this error in combination with Business Cental. 
  • Verified answer
    Sohail Ahmed Profile Picture
    11,178 Super User 2026 Season 1 on at
    You're right — the error you're seeing is caused by exceeding the OData filter complexity limit (MaxNodeCount), which is hardcoded in the Business Central OData stack and cannot be increased or bypassed from within AL code or API Page definitions.
     
    Why it's happening
     
    OData queries like yours with many or startswith() conditions build a complex expression tree, and BC enforces a default node limit of 100 to avoid performance issues. Unfortunately, this value cannot be overridden through any AL-level property (like EnableQueryAttribute), since BC doesn't expose those low-level OData server controls to developers.
     
     
    ---
     
    ✅ Workarounds you can use:
     
    1. Filter with a Custom Field or Table
     
    If you can prepare the list of matching item numbers in advance, you could:
     
    Create a temporary table or blob to store the item numbers.
     
    Use a custom API page that reads from that list and returns the matching results.
     
     
    2. Use $filter with in instead of multiple or startswith()
     
    Business Central OData doesn't support in natively, but if you’re in control of the logic, you can make multiple smaller API calls (e.g., batches of 5 startswith() conditions per call).
     
    3. Use custom AL code to handle input list
     
    Create a custom API that takes a body payload (like JSON array of item numbers) and returns filtered data via a codeunit or query object. This avoids the OData filter altogether.
     
     
    ---
     
    ❌ You cannot:
     
    Increase MaxNodeCount from BC extension code.
     
    Set ODataValidationSettings in AL.
     
    Use web.config or server-side modifications in SaaS (only possible on On-Prem via IIS configs).
     
     
     
    ---
     
    Recommendation (especially for SaaS):
    Build a custom API endpoint (via a codeunit exposed as a web service) that takes a filter payload and returns the matching data programmatically.
     
     
     
    ✅ Mark this answer as verified if it helps you.
     
     
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    23,159 Super User 2026 Season 2 on at
  • Gerardo Rentería García Profile Picture
    27,623 Super User 2026 Season 2 on at
  • Suggested answer
    YUN ZHU Profile Picture
    103,767 Super User 2026 Season 2 on at
    Can you simplify your filterexpression? You can try other keywords other than startwith.
     
    Hope this helps as well.
    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

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
OussamaSabbouh Profile Picture

OussamaSabbouh 727 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 512 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 321 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans