1

The \ character is an escape character in Apex. If you wanted it to be a literal backslash in the resulting string, you'd have to double up on it: \\. However, this won't work the way you expect, as the characters need to be escaped in HTML. Use escapeHtml4() to do this: newArticle.Article_Body_Long_T__c = result.SolutionNote.escapeHtml4(); Or, to ...


1

To retain the formatted value of long text area while coping to the rich-text area, You need to replace all the carriage returns with br's as rich text area accepts HTML instead of a string. I did something like this and it worked:- Account__c acc= [SELECT Id, Name, Long_Text__c, Rich_Text__c FROM Account__c where id='a0WB0000000WrLUMA0']; acc.Rich_Text__c = ...


Only top voted, non community-wiki answers of a minimum length are eligible