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;
}