You need to sign in to do that
Don't have an account?
geniot
escaping apostraphe and backslash revisited
Hello,
I've done some search in the forum and managed to run queries without 'malformed' exceptions.
Although I cannot get the account's name in salesforce right:
Pdq \'&"\\he Rockies
For test's sake my primary string was:
Pdq '&"\he Rockies
I'm escaping it with:
elementValue = elementValue.replaceAll("\\\\","\\\\\\\\");
elementValue = elementValue.replaceAll("\\'","\\\\'");
Note: backslash should be escaped before apostraphe =), otherwise it won't work.
After escaping the java string in the debugger looks like:
Pdq \\'&"\\\\he Rockies
and that's what is sent in the query.
Hopefully you'll see that post like I wrote it. Otherwise check out the screenshot:
Regards,
Vitaly
I've done some search in the forum and managed to run queries without 'malformed' exceptions.
Although I cannot get the account's name in salesforce right:
Pdq \'&"\\he Rockies
For test's sake my primary string was:
Pdq '&"\he Rockies
I'm escaping it with:
elementValue = elementValue.replaceAll("\\\\","\\\\\\\\");
elementValue = elementValue.replaceAll("\\'","\\\\'");
Note: backslash should be escaped before apostraphe =), otherwise it won't work.
After escaping the java string in the debugger looks like:
Pdq \\'&"\\\\he Rockies
and that's what is sent in the query.
Hopefully you'll see that post like I wrote it. Otherwise check out the screenshot:
Regards,
Vitaly
Thanks,
Vitaly
As a result of my mistake the fields of salesforce objects where propagated with escaped strings as well and hereafter populated to salesforce.
Thank you for your help.
:-(