Help get this topic noticed by sharing it on Twitter, Facebook, or email.
I’m freaking out

Content Load failing when converted to varbinary(max) with error "Contains HTML tags or unescaped characters"

I am loading content directly from SQL Server to the ContentNote object in Salesforce. In order to do this, i am loading the field that contains the note as casting it as a varbinary(max). This fails in every occasion, with the error: "Note can't be saved because it contains HTML tags or unescaped characters that are not allowed in a Note."

The problem is, the field does not contain either HTML tags or unescaped characters. In fact. If I hard code the exact values into the query it will load fine. If i pull the fields directly from a database I encounter the error.

Utilizing the command: Exec sf_bulkops 'Insert,'Salesforce','ContentNote_Load'

The 'Content' field is what is failing.
It does not matter what value is in the 'content' field, even an empty string. It will fail with this error. The source field in SQL is NVarChar(255).

Here is a sample statement that fails.
SELECT
CAST('' AS nchar(18)) AS [ID],
CAST('' AS nvarchar(255)) AS Error,
a.Title as Title,
CAST(a.[Description] AS varbinary(max)) AS Content
INTO ContentNote_Load
FROM Source

Here is a sample statement that works:
SELECT
CAST('' AS nchar(18)) AS [ID],
CAST('' AS nvarchar(255)) AS Error,
a.Title as Title,
CAST('This is a Test' AS varbinary(max)) AS Content
INTO ContentNote_Load
FROM Source

Urgent need to resolve quickly!
1 person has
this problem
+1
Reply