on 03-15-2015 3:57 PM
Hi to all,
I have created OData service endpoint, using the below linked approach,
I got Odata service and am able to list all the data from database.
Now,
I want to list the record based on some conditions like where Name1 = "test"
Pls help me on this ....
FYI.,
am sharing the data format which I am getting from that Service,
http://localhost:8080/Customer_Reg/custlist.svc/CustGeneralDatas()/?$format=json
Output:
{"d":{"results":[{"__metadata":{"id":"http://localhost:8080/Customer_Reg/custlist.svc/CustGeneralDatas('1')","uri":"http://localhost:8080/Customer_Reg/custlist.svc/CustGeneralDatas('1')","type":"Customer_Reg.CustGeneralData"},"Aenam":null,"Anred":"2","Cin":null,"City1":"delhi","City2":"98","Ernam":null,"Ersda":null,"Kunnr":"1","Laeda":null,"Land1":null,"Mcod1":"3","Name1":"mahie","Name2":"5","Panno":null,"PoBox":"6","Pstlz":"9","Regio":null,"Smtp_addr":"mahi@gmail.vom","StrSuppl1":"7","StrSuppl2":"7","Stras":"6","TelNumber":"9738285552","Telf1":null,"Telfx":null,"Telx1":null,"Tin":null},
{"__metadata":{"id":"http://localhost:8080/Customer_Reg/custlist.svc/CustGeneralDatas('2')","uri":"http://localhost:8080/Customer_Reg/custlist.svc/CustGeneralDatas('2')","type":"Customer_Reg.CustGeneralData"},"Aenam":null,"Anred":"7","Cin":null,"City1":"bangalore","City2":null,"Ernam":null,"Ersda":null,"Kunnr":"2","Laeda":null,"Land1":null,"Mcod1":"7","Name1":"itenz","Name2":"8","Panno":null,"PoBox":"09","Pstlz":null,"Regio":null,"Smtp_addr":"test@ted.com","StrSuppl1":"0","StrSuppl2":"0","Stras":"9","TelNumber":"0989745984","Telf1":null,"Telfx":null,"Telx1":null,"Tin":null},
{"__metadata":{"id":"http://localhost:8080/Customer_Reg/custlist.svc/CustGeneralDatas('6')","uri":"http://localhost:8080/Customer_Reg/custlist.svc/CustGeneralDatas('6')","type":"Customer_Reg.CustGeneralData"},"Aenam":null,"Anred":"tf","Cin":null,"City1":"test","City2":null,"Ernam":null,"Ersda":null,"Kunnr":"6","Laeda":null,"Land1":null,"Mcod1":"test","Name1":"test","Name2":"test","Panno":null,"PoBox":"test","Pstlz":null,"Regio":null,"Smtp_addr":"test","StrSuppl1":"test","StrSuppl2":"test","Stras":"test","TelNumber":"test","Telf1":null,"Telfx":null,"Telx1":null,"Tin":null}]}}
Tags edited by: Jitendra Kansal (Moderator)
Hi to all,
I found the issue & it's fixed.
Issue was required library files were missing in Dynamic web-project.
Thanks to all....
Regards,
Mahendran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can set filterable attribute for the properties Name1 as per this guide.
http://localhost:8080/Customer_Reg/custlist.svc/CustGeneralDatas?$filter=Name1 eq 'test'
You can also implement READ operation as per
Where URI would be called like: http://localhost:8080/Customer_Reg/custlist.svc/CustGeneralDatas('1')
Regards,
JK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi JK,
Thanks for the reply,
Here I created Odata service by referring the following link,
for the below request, am getting error like
http://localhost:8080/Customer_Reg/custlist.svc/CustGeneralDatas?$filter=Name1%20eq%20%27test%27
FYI.,
I attached the error file
Regards,
Mahi
Mahendran,
$filter is what you are looking for. Search OData + $filter to get the URL conventions.
Thanks
Krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.