You need to sign in to do that
Don't have an account?
Selva
I am using the following logic in JPD file to set the email value.
unable to set the field value which contains quote!
Hi,
I am trying to set the email value which contains single quote into Contact object's email field, but couldn't. Weblogic server thrown the following error. Is there any way to escape the single quote.
Code:
<xml-fragment xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><faultcode>sf:MALFORMED_QUERY</faultcode><faultstring>MALFORMED_QUERY: 'dean.rose@gmail.com','brenden.o'connor@gmail.com','karen.davenport@gmail.com' ^ ERROR at Row:1:Column:963 expecting a right parentheses, found 'connor'</faultstring><detail><sf:fault xsi:type="sf:MalformedQueryFault" xmlns:sf="urn:fault.enterprise.soap.sforce.com"><sf:exceptionCode xmlns:sf="urn:fault.enterprise.soap.sforce.com">MALFORMED_QUERY</sf:exceptionCode><sf:exceptionMessage xmlns:sf="urn:fault.enterprise.soap.sforce.com"> 'dean.rose@gmail.com','brenden.o'connor@gmail.com','karen.davenport@gmail.com' ^ ERROR at Row:1:Column:963 expecting a right parentheses, found 'connor'</sf:exceptionMessage><sf:row xmlns:sf="urn:fault.enterprise.soap.sforce.com">1</sf:row><sf:column xmlns:sf="urn:fault.enterprise.soap.sforce.com">963</sf:column></sf:fault></detail></xml-fragment>
I am using the following logic in JPD file to set the email value.
Code:
private String getUserId(QueryResult qr, String emailId) throws Exception { String userId = ""; for(int i=0; i < qr.getRecordsArray().length; i++) { User usr = User.Factory.parse(qr.getRecordsArray(i).xmlText()); if(usr.getEmail().equals(emailId)) { userId = usr.getId(); break; } } return userId; }
..................
String usrId = getUserId(qrTeam,accountData[i].TEAM_EMAIL); if(!usrId.equalsIgnoreCase("")) { account.setOwnerId(usrId); }
.....................
Thanks.
Thanks Simon for the hint. :-)
The following code worked out.
ownerQry += ",'" + accountData[i].TEAM_EMAIL.replaceAll("'", "\\\\'") +"'";