Pawan
(Reddy)
August 5, 2019, 12:49pm
1
Dear Experts,
Rest call is not filtering data. What am I doing wrong? This call is returning all the parts. Also, if you can point me to where I can learn some of the basics of using REST and some example code, that would be a great help. Thanks.
Dictionary<string, string> dic = new Dictionary<string, string>();
string PartNums = @“PartNum eq ‘test’”;
dic.Add($“filter”, PartNums);
var filteredParts = EpicorRestAPI.EpicorRest.DynamicGet(“Erp.BO.PartSvc”, “Parts”, dic);
Olga
(Olga Klimova)
August 5, 2019, 1:25pm
2
dic.Add($“filter”, PartNums);
Looks incorrect. It should be “$filter”.
Can you check what query string is created at the end?
hmwillett
(Hannah Willett)
August 5, 2019, 1:29pm
3
This how I use it:
dic.Add($"$filter", string.Format("PartNum eq {0}", partNum));
Pawan
(Reddy)
August 5, 2019, 1:30pm
4
Sorry Olga. Very new to this. Don’t know how to check the query string. Thanks.
Pawan
(Reddy)
August 5, 2019, 1:32pm
5
Thanks for the time and reply. Both Olga’s and your solution worked. thanks.
1 Like
Olga
(Olga Klimova)
August 5, 2019, 2:14pm
6
or
dic.Add("$filter", $“PartNum eq {partNum}”);
1 Like