REST Filter Not Working

I’m trying to pull a specific PO Line, so I tried the filter, but it still pulls back all lines. Am I missing something?

/api/v1/Erp.BO.POSvc/POes(ISI,70707)/PODetails?$select=POLine&$filter=POLine eq 1

Results:

  {
    "odata.metadata":"/api/v1/Erp.BO.POSvc/$metadata#Epicor.RestApi.PODetails&$select=POLine","value":[
      {
        "POLine":1
      },{
        "POLine":2
      },{
        "POLine":3
      },{
        "POLine":4
      },{
        "POLine":5
      },{
        "POLine":6
      }
    ]
  }

Expected:

  {
    "odata.metadata":"/api/v1/Erp.BO.POSvc/$metadata#Epicor.RestApi.PODetails&$select=POLine","value":[
      {
        "POLine":1
      }
    ]
  }

Other than the spaces in the URL - which I assume are because of auto-formatting in the post - that looks correct. There are a few places in the API where I’ve found things just don’t work as expected. Report it up as a bug.

Can you use /PODetails({Company},{PONUM},{POLine}) instead?

Yeah, it comes up as %20 in the URL.

/api/v1/Erp.BO.POSvc/POes(ISI,70707)/PODetails?$select=POLine&$filter=POLine%20eq%201

Looks like /PODetails({Company},{PONUM},{POLine}) will do.
Thanks!

1 Like

This is an old post but, in case anybody like me came to the forums after banging their head against the wall, I thought I would at least note what was required to resolve this in my case. In my case I was trying to do something like this (URL encoding omitted here for readability):

/Erp.BO.ResourceSvc/Resources?$filter=ResourceGrpID ne '9999' and ResourceGrpID ne '9998'

I could not see what could have possibly been wrong with that. Then it hit me that I had a BPM in place that looked like this:

In my case here, Epicor was doing exactly what I was telling it to do - I was overriding the $filter (GetRows whereClauseResource) with what was in my BPM. Doh!

3 Likes

Been there.

Your website was very helpful when I got started btw. Thank you.

4 Likes