web
You’re offline. This is a read only version of the page.
close
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...
Suggested Answer

Query all fields from table via ODATA API

(6) ShareShare
ReportReport
Posted on by 36
I have created a large number of custom queries to load via the ODATA API set up on the Web Services page (c. 160). For 155 / 160, all the table data loads correctly. For around 5 queries, they do not load at all, returning a 404 error response with no additional information to aid in debugging.
 
I have found the root of the issue. By selectively turning off certain fields in my query objects, I have found certain fields are to blame in triggering the error, and if I remove them from my query, the rest of the table loads as requested.
 
Change Log Entry is a table I have an issue with. If I remove certain fields, including "Table Caption" from the query request it works fine. Below is the field in the table design of the Change Log Entry table (a table I am trying to return). You can see the Table Caption field refers to the AllObjWithCaption table in a lookup. I am unsure exactly why it doesn't like this field, but this is the code the table runs for this field. Is it not possible to access some tables, even via lookups in ODATA APIs? And because of this, the issue propogates to me trying to pull Table Caption from Change Log Entry?
 
I do still require to pull data from the tables I need. Is there a workaround I can employ to fix this at all?
 
field(6; "Table Caption"; Text[250])
        {
            CalcFormula = lookup(AllObjWithCaption."Object Caption" where("Object Type" = const(Table),
                                                                           "Object ID" = field("Table No.")));
            Caption = 'Table Caption';
            FieldClass = FlowField;
        }
I have the same question (0)
  • Suggested answer
    Steven Renders Profile Picture
    5,672 Moderator on at
    This is a flowfield. Adding flowfields to queries should not be an issue, although there has been a bug that causes it to fail.
    A workaround is not adding flowfields to query APIs and instead create an extra query API with the data of the table the flowfield is calculating.
  • Suggested answer
    Jainam M. Kothari Profile Picture
    15,639 Super User 2025 Season 2 on at
  • Suggested answer
    YUN ZHU Profile Picture
    95,729 Super User 2025 Season 2 on at
    Hi, same question
     
    Thanks.
    ZHU
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,601 Super User 2025 Season 2 on at

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

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 2,238

#2
YUN ZHU Profile Picture

YUN ZHU 773 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 630

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans