You need to sign in to do that
Don't have an account?
sumanth v 7
REST API String parse Issue
If i give hard code the value as below
String toolingendpoint ='https://xxxxxxx.xxxxxx.com/sap/opu/odata/sap/xxxx_xxx_xxx/xxxx_xx?mat_num=\'*1160\'&sap-client=300';[1160 is hardcode value here] able to retrieve data. But when i try as below unable to retieve
String toolingendpoint ='https://xxxxxxx.xxxxxx.com/sap/opu/odata/sap/xxxx_xxx_xxx/xxxx_xx?mat_num=\'*searchstring\'&sap-client=300'; [searchstring the value comes from VF page].
There is some mistake with '\' i am doing here. Please help.
String toolingendpoint ='https://xxxxxxx.xxxxxx.com/sap/opu/odata/sap/xxxx_xxx_xxx/xxxx_xx?mat_num=\'*1160\'&sap-client=300';[1160 is hardcode value here] able to retrieve data. But when i try as below unable to retieve
String toolingendpoint ='https://xxxxxxx.xxxxxx.com/sap/opu/odata/sap/xxxx_xxx_xxx/xxxx_xx?mat_num=\'*searchstring\'&sap-client=300'; [searchstring the value comes from VF page].
There is some mistake with '\' i am doing here. Please help.
When You are using string varaible in soql query you need to use + sign.
For example
Try this
Please refer below post for similar discussion.
https://developer.salesforce.com/forums/?id=906F000000093fyIAA
Always try to print your query through system.debug so that you will be able to find if the query is formed properly.
Hope this helps you!
Please mark it as Best Answer if my reply was helpful. It will make it available for other as the proper solution.
Thanks and Regards
Sandhya
I solved this morning. You are right!
Thanks for your reply.
Thanks and Regards
Sandhya