0

I am doing old Note conversion to new Note. For some special character , I can use escapeHTML4() and it works like charm but for some character such as '£', '~' is fail.I tried to use escapeUnicode() but it still fail.

So I plan to search those notes that contains special character that not able to be converted and convert it manually.

Is there any list of special character that cannot be converted so I can work with conversion plan?

1
  • Have you tried using a data loader to import ContentNotes with £' and '~' symbols. Using a data loader, I am able to insert ContentNorte.
    – Devendra
    Sep 19, 2016 at 11:43

2 Answers 2

1

I ran into this very issue and considering I have thousands of Content Notes to import I went ahead and wrote a simple python script that I call 'notedog' to search and replace the disallowed characters for the allowed characters. The script takes the file name(s) as input and the modification is made in place. As a disclaimer I would recommend backing up your files first.

Sample usage:

python notedog.py c:\migration\notes\23.txt
# (build a script with your entire list of files)

Here's the script:

import sys
import os
import fileinput
import re


for line in fileinput.input(inplace=True):
    line = re.sub('&','&', line.rstrip())
    line = re.sub("'","'", line.rstrip())
    line = re.sub('"','"', line.rstrip())
    line = re.sub('<','&lt;', line.rstrip())
    line = re.sub('>','&gt;', line.rstrip())

    print(line)

that's it!

0

Note can't be saved because it contains HTML tags or unescaped characters that are not allowed in a Note.

Resolution- You must use the Data Loader when inserting ContentNote object records. Attempting to insert ContentNote records via Workbench for example will always result in this error.

It is recommended to use the most recent version of the Data Loader available but a minimum of version 32 required.

A batch size of 1 is highly recommended to ensure the best success rates when inserting ContentNote records and is ideal for identifying the exact records or rows in your file that resulted in the error.

Note: It's not currently possible to insert Notes via the Data Loader with advanced formatting such as unordered (bullets) and ordered (numbered) lists or indentations using either a .html or .txt file.

There is no direct path or tool available to prepare data or migrate legacy notes to the enhanced note-taking tool and externally manipulating the data outside of Salesforce is required to properly prepare files for insert.

As an alternative to migrating legacy notes to enhanced notes, consider maintaining the legacy Notes & Attachments related list on page layouts so that users can continue to view and reference past notes while instructing them to add and work with new notes via the Notes related list moving forward.

Importing Notes to the ContentNote object using the Apex Data Loader

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .