I’m having an issue adding parameters for API calls only on some tables/services, hoping someone here can give me a clue of what’s going on, my problem is:
I can do this command and it works fine: https://myServer/api/v2/odata/myCompany/Erp.Bo.QuoteSvc/Quotes?$select=QuoteNum&$orderby=QuoteNum desc
I can do this command and it also works more or less okay
but for some reason doesn’t return all results unless i also add $top=999999: https://myServer/api/v2/odata/myCompany/Erp.Bo.QuoteSvc/QuoteDtls?$select=QuoteNum
According to the docs, I should be able to do this command: https://myServer/api/v2/odata/myCompany/Erp.Bo.QuoteSvc/QuoteDtls?$select=QuoteNum&$orderby=QuoteNum desc
But I get this error: Sorry Something went wrong. Please contact your system administrator. Correlation Id: xxxxxxxxxxxx
I’ve tried this within the epicor api help site, through postman, and through my own app in C#, same result.
Well my default answer is always going to be call a function or a baq instead, but failing that, use the custom methods, not the odata. The odata has some quirks.
Thanks this definitely gives me something to think about, as far as I understood this was the way to call the actual methods just from reading the docs on the API help website:
100% best way to learn how to do something in Epicor, is first search here.
99.99175% next best way is to learn how to do tracing, in both the classic and web clients.
The BAQ is far more powerful than the standard services. You can reduce the number of columns returned, reduce the number of rows returned, use calculated fields to make your data views easier to work with in UI, parameterize your selections, they’re easier to maintain, etc.
Yeah BAQs do have some nice things, but for something like quote creation, just sending a POST to the QuotesSvc/Quotes did seem like a nice choice, I was then able to add anything else I needed through a similar service.
Now I’m looking at those Custom methods @klincecum suggested, the GetRows seems like a pain in the sense that it needs all those whereClauses to filled in or empty, also no filters, sorting, selecting that I can see
But it does seem to return the full quote as a nested json object, not ideal but I can live with it.
Then calling all those little methods to add QuoteDtls, QuoteQties honestly sounds doable but a bit of a pain.
I’m back to thinking I’m missing something
Let me try to re-state my issue: In the context of a standalone C# application, on windows, visual studio. What is the “standard” way to GET and POST data to/from Epicor?
The methods under oData where honestly working really well, and I had the entire application pretty much mapped out, until I got to the really weird issue on my first post, which again, only seems to happen in QuoteDtls and QuoteQties, not on QuoteHed
Sure seems like it, until you realize that you’re making several calls over the wire, the client needs to know how to react to each call, changes in the business object have to be reconciled during upgrades.
Or, follow Kevin’s advice and wrap the whole transaction in a function, make a single atomic call, and potentially make your upgrades easier. If you search the list, you will find many people struggling with the same issues as you are and then suddenly, the light hits them.
I see I see, am I mistaken in thinking that is a more “Epicor centered” approach (by function you mean an Epicor function right?)
I think I know what you mean, I’ve been thinking about it the other way, almost just interacting with with the data tables directly (through the oData services)
Could I trouble you for a link showing how to make an Epicor function?
Just to avoid me logging into EpicWeb and spending a couple of hours reading pdfs, that may or may not be the right ones, this is how I got to the REST api and oData stuff by the way.
Just so you get an idea of my epicor knowledge level, I know how to create and use relatively simple BAQs, make calls to the rest api from outside, add custom columns to tables and that is about it.
I’m way more comfortable “outside” epicor and I think that’s why I was basically using it as a data in / data out system.
Thanks, I’m digging into @klincecum 's links and will probably end up rewriting the whole thing so that it calls Epicor Functions instead.
It will take some work. And I was almost done.
In the meantime, if someone can be so kind to test this one on their system, I’m not saying it’s the way to go, but it definitely feels like a bug to me:
That’s fine, it should return an empty list not the “Contact system administrator” error.
Haha, that’s the exact same reason I’m building this app, I figure if I make the quotes happen straight from our CAD system with a streamlined/standardized process, people will be way more inclined to use it.
I’m trying to build an Epicor Function, turns out I can’t because permissions, I’m going to have to go to our system admin again and have him add me to the Access Groups
Functions Administrator
Functions Developer
Functions Power Developer
Can you think of any other basic security clearance thing I will definitely need? This is another reason that I liked the oData calls, I’m not the admin of this system and I hate constantly asking for little tweaks everywhere.