jgiese.wci
(Joshua Giese)
November 16, 2020, 3:43pm
1
Has anyone else ever used the filtering on expanded children records? REST v2 is not throwing any errors but it’s also no filtering. I think I have it setup per the odata website under “Nested Filter in Expand” Basic Tutorial · OData - the Best Way to REST
https://myserver/instance/api/v2/odata/COMP/Ice.BO.UserCodesSvc/UserCodes(‘COMP’,‘MyCodeTypeID’)?$expand=UDCodes ($filter=CodeDesc eq ‘ABC Code’)
The above responds but does not filter the children to where CodeDesc is “ABC Code” I just get all the children of the expanded top level.
jgiese.wci
(Joshua Giese)
November 16, 2020, 4:02pm
2
This version of filtering doesn’t filter the children either
$expand=UDCodes&$filter=UDCodes/all(c: c/CodeID eq ‘1’)
@Olga is expanded record filtering supported in v2?
Olga
(Olga Klimova)
November 16, 2020, 4:10pm
3
Probably not, filter was left as it was in v1
hkeric.wci
(Haso Keric)
November 16, 2020, 4:12pm
4
v2 API Docs have
https://EpicorServer/ERP102400/api/v2/odata/EPIC06/Erp.Bo.SalesOrderSvc/Sales
Orders?$expand=OrderDtls($select=OrderLine)&$select=OrderNum
Notice the ($select=OrderLine) right after OderDtls… I wonder if you can also do $filter within the parenthesis, or is that just limited to select?
Aside Note… An Example how to Expand Sub-Tables
{{Host}}/{{Environment}}/{{path}}/{{Company}}/Erp.BO.SalesOrderSvc/SalesOrders?$expand=OrderDtls($expand=OrderRels,OrderMscs),OHOrderMscs&$filter=OrderNum eq 800500
OData atleast shows this example on msdn
https://localhost:port_number/orest/Customers?$expand=Orders($filter=Id eq 10)
1 Like
hkeric.wci
(Haso Keric)
November 16, 2020, 4:16pm
5
Try
$expand=UDCodes($filter=UDCodes/all(c: c/CodeID eq ‘1’))
jgiese.wci
(Joshua Giese)
November 16, 2020, 4:47pm
6
That’s not valid oData @hkeric.wci
hkeric.wci
(Haso Keric)
November 16, 2020, 5:50pm
7
jgiese.wci:
CodeDesc eq ‘ABC Code’
In v2 according to msdn it’s valid… it fires fine in v2… but the results are not filtered
https://server/EpicorERP/api/v2/odata/GLB/Ice.BO.UserCodesSvc/UserCodes?$expand=UDCodes($filter=CodeID eq '1030')&$filter=CodeTypeID eq 'PG_1000'
I guess Epicor doesn’t support it.
https://www.odata.org/getting-started/basic-tutorial/
Also looks like Epicor doesnt support /all either
jgiese.wci
(Joshua Giese)
November 16, 2020, 6:12pm
8
Olga pretty much said that 4 threads ago pay attention LOL!
hkeric.wci
(Haso Keric)
November 16, 2020, 6:15pm
9
I know but I figured since its just OData there was nothing for Epicor to do on their part… OData is OData… but apparently they parse the $commands
–
If you are looking for a single Item I guess you could use this.
jgiese.wci
(Joshua Giese)
November 16, 2020, 6:37pm
10
I just built a BAQ to do what I needed and moved on.
hkeric.wci
(Haso Keric)
November 16, 2020, 6:39pm
11
You mean Epicor Function right?
jgiese.wci
(Joshua Giese)
November 16, 2020, 6:39pm
12
Nope BAQ just returning data a func wouldn’t make sense.
1 Like