ContentNote inserted using Apex with body containing 4(x) characters displays special characters when Note is viewed in Lightning Experience.
Last updated 2021-05-26 ·Reference W-8247404 ·Reported By 0 users
ContentNote inserted using Apex with body containing 4 characters (or multiple of 4) displays special characters when Note is viewed in Lightning Experience. The issue is seen only in LEX. In classic, it works fine.
Notes body is different, although the text preview on the sidebar of notes object home is correct.
Editable Note body is the same as what was inserted (and what shows up in classic)
Reproducer in fresh demo org :
- Login to the org and enable Notes (Setup>>Notes Settings)
- Go to the Accounts tab and create a new account. (Please note down the Account ID we would use it while inserting notes).
- Edit the Account Layout and Add Notes to the Related List Section.
- Run the following code using execute Anonymous window to Inset a Note and attach it to an Account record.
ContentNote objCntNote = new ContentNote();
objCntNote.Title = 'title';
objCntNote.Content = Blob.valueOf('Test');
objCntNote.SharingPrivacy = 'N';
ContentDocumentLink objCntDocLink = new ContentDocumentLink();
objCntDocLink.LinkedEntityId = '001Bxxxxxxxxxxx';
objCntDocLink.ContentDocumentId = objCntNote.Id;
objCntDocLink.shareType = 'I';
objCntDocLink.Visibility = 'AllUsers';
- Now open the notes from the Account related list and view in LEX and classic.
 Using a space with the string example "Test " instead of "Test"
 Embedding the String in <p> for example <p>Test<p/>
Reported By (0)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.