web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

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

Incomplete response when using Enum field as filter in Custom Query API

(4) ShareShare
ReportReport
Posted on by 18

I’ve created a custom query API for a custom table that includes an Enum field.

When I add the Enum field as a filter in the query, the API returns an incomplete response, even though the HTTP status code is 200 (OK). There is no explicit error message in the response.
If I remove the Enum field from the query filters, the API works correctly and returns the full expected response.

Is there a known limitation or configuration required when using Enum fields as filters in custom query APIs? Any guidance or best practices would be appreciated.


I have the same question (0)
  • Suggested answer
    NAV_with_Narang Profile Picture
    2,306 Moderator on at
    Hi @Harikrushna Sangani  There is no limitation on using Enum field in API page + you can query with filters on enum as well.
  • Harikrushna Sangani Profile Picture
    18 on at

    Thanks for the response!

    There is no filter applied at the API level. The filter is applied only when I select the query parameters in Postman.


    The image below shows the response without adding the filter row filter(type; Type) { } in the Query object, where Type is an enum data type.




    The next image shows the response with the filter row filter(type; Type) { } added to the Query object. However, no OData filter has been applied yet.

     








     
  • Suggested answer
    OussamaSabbouh Profile Picture
    7,836 on at
    Hello,
     
    There’s no special configuration needed for Enum fields, but OData only supports a single $filter parameter — in your request you’re sending multiple $filters, which can silently break the response (200 OK with empty/incomplete value). The fix is to combine all conditions into one $filter using and, and make sure the Enum filter uses the exact enum value as exposed in $metadata (not the caption), sometimes as a fully qualified enum literal. Once you use one $filter + correct enum literal, the query API behaves correctly.
     
    Regards,
    Oussama Sabbouh
  • Suggested answer
    Dhiren Nagar Profile Picture
    964 on at
    Hi,
     
    As such there is no limitation on using Enum field in API page as well as you can query with filters on Enum field. I've tried that and it works.

    Also in your screenshot I can see filter on date, code and Boolean field but no Enum field filter. Also make sure when you apply filter on Enum field, treat it same as text filter.
     
    I hope this helps.
     
    Regards,
    Dhiren.

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,476

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 789 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 719 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans