Hi,
Is there any way to escape the special character single quote from the email value.
String ownerQry = "Select Id, email from User where email in('0000'";
for(int i=0; i<accountData.length; i++)
{
ownerQry += ",'" + accountData.TEAM_EMAIL+"'";
}
ownerQry += ")";
QueryResult qrTeam = sfdcCtrl.query(ownerQry);
When i tried to set the email value on a custom object, its throwing the error as below and failed to update.
<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>