Rest

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);

dic.Add($“filter”, PartNums);

Looks incorrect. It should be “$filter”.
Can you check what query string is created at the end?

This how I use it:

dic.Add($"$filter", string.Format("PartNum eq {0}", partNum));

Sorry Olga. Very new to this. Don’t know how to check the query string. Thanks.

Thanks for the time and reply. Both Olga’s and your solution worked. thanks.

1 Like

or
dic.Add("$filter", $“PartNum eq {partNum}”);

1 Like