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

此生再无相见时 提交于 2019-12-07 02:48:40

问题


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?


回答1:


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'



回答2:


Put an and in between

Example:

http://YourServer.com/YourOrg/xrmservices/2011/OrganizationData.svc/ContactSet()?$filter=FirstName eq 'George' and LastName eq 'Washington'



来源:https://stackoverflow.com/questions/15276617/how-to-filter-w-r-t-multiple-fields-in-odata-using-filter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!