function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Character reference "&#x13" is an invalid XML character

I get the above error when trying to perform an Upsert. I have escaped text fields using SecurityElement.Escape function but still get the above error. Below is the WebResponse:


  <?xml version="1.0" encoding="UTF-8" ?>
- <soapenv:Envelope xmlns:soapenv="">
- <soapenv:Body>
- <soapenv:Fault>
  <faultstring>Character reference "&#x13" is an invalid XML character.</faultstring>



There are certain characters that are not valid in XML, regardless of how you encode them, you'll need to remove the offending character from the data your trying to send to salesforce.