Sorting

Goooooood Morning! :sunny:

I’m creating an API to pull nonwork hours from one database into kinetic. I’ve been attempting to pull in the most recent data set for an employee to retrieve the template for the time entry and adjust values to resubmit. The current issue I’m having is that I cannot seem to get the returned data to come back sorted! I’vve tried using &$orderby=LaborHedSeq%20desc. I’ve tried adding it to a filter: &$filter=%28$orderby=LaborHedSeq%20desc. Nothing has worked so far.

I realize that REST isn’t the golden child anymore, but I need to work this out before I can approach another avenue. Any ideas?

I’ve also tried typing it without the URL syntax, ie &$orderby=LaborHedSeq desc. That didnt work either.

I don’t have much OData experience, but if you get that data via BAQ you can apply your order before retrieving the data via REST BAQ service.

2 Likes

REST is still golden but using REST for Remote Procedure Calls…not so much. :wink:

Another tool in your REST toolbelt is the BAQSvc. You can control record selection, field selection, and sort order.

2 Likes

I know this is an old request at this point but I wanted to share some relevant information.

Were you trying to OrderBy a child object (like LaborDtl)?

I have found that any child object I have tried to orderby via rest fails. I have not tried them all but I have tried several from:
CustShip
Part
SalesOrder

I think there is a problem with the Epicor REST implementation (or at least something that isnt wired up)

Note parent\main records work fine.

2 Likes

REST comes in two flavors: OData and Custom. I’ve rarely seen issues with the Custom methods since they map one-to-one with the business objects. The OData methods are wrappers with the extra code for the standard. We have seen issues here. If one uses a BAQSvc with the required sort, that will work too.

2 Likes

I was using the laborHed sequence number. We ended up passing this project on to our partners so that i could work on other projects.
Thanks! :innocent: