How to get unfiltered access to a table using the API?

I’m a third party developer building an Epicor integration. In the client’s implementation, a unique PartNum is assigned to the first QuoteDtls of each quote and is later used in the order process. Currently, they’re assigning these PartNums manually by using a dropdown that shows all QuoteDtls PartNums, scrolling to the bottom of the list, and entering one up from the highest shown.

In the trace log, I see the dynamic query that is being retrieved and called, and can call it myself, but the dataset it returns is too large to work for an integration. I’ve been trying to figure out how to get access to this data in a different way, but I’ve tried GET requests on QuoteDtls, OrderDtls and Parts, and none of the records I get match the data of that dropdown.

I do not have direct access to Epicor (only through the API), but the client says there’s no QuoteDtls table, only a QuoteDtl table, and it’s data seems to match the dropdown.

Any advice on getting unfiltered access to this table using the API? Ideally, I’d like to use some ODATA magic to pull as limited of a set as possible.

For your use case, I think the best approach would be to create a BAQ within the ERP, and the get the query results through the REST API. Or depending on which erp version you are, you could also write a function that retrieves only what you want, and call that function from REST.

You could try playing with the custom method GetRows.

OData methods are just wrappers around the services GetRows method, which in turn calls a SQL Stored Procedure that retrieves everything including user defined fields for all tables associated with a Business Object. GetRows has where clauses for each of the tables it populates, but I believe unless you bring the header also(QuoteHed), you would not get any child records(QuoteDtl), although it’s been a while since I played with that.

3 Likes

Thanks for the response Jonathan!

In preparation for implementing your solution, I tried calling a BAQ from the API and get an "Invalid API Key qui eu.\r\nCompany (client company).” Do calls to BAQ’s typically require different permissions than OData and RPC calls?

In a separate attempt to get at the QuoteDtl table, I tried the OData call /(client company)/Erp.BO.QuoteDtlSearchSvc/QuoteDtlSearches and got the same error. Unfortunately, I don’t have access to the Epicor system, only the API, but if you know of resources I can use to help troubleshoot this I would greatly appreciate it.

The v1 version of the API does not require an API Key, however if you try the v2 then you need one. The key is generated within the ERP.

The Rest Help switched API versions without me realizing it and I downloaded the wrong swaggers. I found an existing BAQ hitting the full QuoteDtl table that I should be able to filter using Odata. Thanks for the assistance.