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

Business Central Odata Endpoint with multiple Contains()

(0) ShareShare
ReportReport
Posted on by 2

Hello Everyone,

I'm currently working on querying the OData v4 /Customer endpoint for Business Central in order to retrieve customers based on a user's search criteria for either name or customer number.

I can successfully make a call to:

https:/api.businesscentral.dynamics.com/v2.0/{_businessCentralOptions.TenantId}/{_businessCentralOptions.Environment}/ODataV4/Company('{_businessCentralOptions.CompanyName}')/Customer


This call retrieves all customers, and I can narrow down the results by adding a filter, for example:

/Customer?$filter=contains(Search_Name,'TESTING')
However, I encountered an issue when attempting to search through both the Search_Name and No fields simultaneously, like this:
 
/Customer?$filter=contains(Search_Name,'TESTING') or contains(No,'50000')
 

This query returns a 501 not implemented error.

In my testing, I found that chaining multiple contains together works if I'm searching within the same field:

/Customer?$filter=contains(Search_Name,'TESTING1') or contains(Search_Name,'TESTING2')
My question is: How can I perform a search on both the Search_Name and No fields simultaneously? I came across an article suggesting the use of the $search option, but it seems to be ignored in my case. Any guidance on this matter would be greatly appreciated.
 
  • Verified answer
    YUN ZHU Profile Picture
    104,110 Super User 2026 Season 2 on at
    Hi, as far as I know, the 'OR' operator does not support different fields.
    More details:
    "message": "The 'OR' operator is not supported on distinct fields on an OData filter.  CorrelationId:  6b597f3e-4e78-4442-96e6-1222475cb8ab."
     
    In addition, it may be easy to do in the database, but this is also a very special process in AL Language.
    Dynamics 365 Business Central: Cross-column search (OR filters on multiple fields) ★FilterGroup(-1)
     
    Hope this helps.
    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

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 645 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 432 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 248 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans