Sales Order entities (SalesOrdersHeader, SalesOrdersHeadersV2) not returning any data from OData endpoint

I have a requirement to expose the entries inside the SalesTable as OData endpoints.

I’ve looked around for the right data entities to consume and des

Here’s the postman endpoint response…

I

There are three records in the SalesTable. Here’s the snapshot of the SalesTable

I really need the records in the sales table from the OData endpoint or have i missed out something…

Most likely you’re getting data from a wrong company.

I see you added a filter for data area ‘dat’, but you didn’t use cross-company=true, therefore you’re still getting data from primary company of the current user.

thanks for reaching out Martin…

I’ve changed the data entity to the right one and even added cross-company=true.

Try the request first without the filter to see if you get anything and if so, in which companies.

Note that hhe screenshot in your question shows three records in ‘dat’ company and I can’t say whether you have anything in ‘cpl’.

Apparently, the sales order type for the created sales order entries were all of type “Journal”, not “Sales Order”.

So, when I ensured the type was set to “Sales Order”, I got my records as json response, everything is OK now…

Thanks Martin!

That’s correct. The entity has a filter that makes sure that it returns only sales orders, not returns, items requirements or - as in your case - journals.