How to filter w.r.t. multiple fields in oData using $filter?

Bvrce picture Bvrce · Mar 7, 2013 · Viewed 11.2k times · Source

What is the correct way to filter w.r.t. multiple fields when applying $filter command on more than one field/value pair from JavaScript?

Answer

Konrad Viltersten picture Konrad Viltersten · Mar 7, 2013

It's very canonical.

http://192.168.75.8:5555/Konrad01/
  xrmservices/2011/OrganizationData.svc/
  LeadSet%28%29?$filter=
    Field1%20eq%20%27Value1%27%20and%20Field2%20eq%20%27Value2%27

EDIT:

More readable version.

http://Server:Port/Organization/XrmServices/2011/OrganizationData.svc/
  LeadSet()?$filter=Field1 eq 'Value1' and Field2 eq 'Value2'