While querying the data from SF OData API of the base entity FOCostCenter i did receive the following error -
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>BadRequestException</code>
<message lang="en-US">Invalid quote usage detected, quotes need to be in pairs.</message>
</error>
This did lead me to a spiral of what went wrong, after a bit of head scratching i did figure out my SF OData API query was :
/FOCostCenter?$select=externalCode,name&$filter=externalCode eq 'A & B'
Well, the issue here is with having "&" between A and B. OData API parser by default expect to have a ' after A and before B. In order to handle this we need to escape & symbol. As usual i escaped it by replacing & with & but then it did not work.
Understanding the protocol of OData API i was led to beleive escaping needs to supported by ASCII format which is %26 which helped us to solve the problem.
Updated query condition which solved the problem is here.
/FOCostCenter?$select=externalCode,name&$filter=externalCode eq 'A %26 B'
End of the long story - if you need to escape special characters within filter condition of OData then please use ASCII encoding.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |