-
Admin needs to preserve carriage returns in transfer of text fields in Salesforce
Hello developers,
I am working on an apex script to do a one time transfer of data from one object to another. One of the fields that has to be transferred is a large text area field. It will be transferred to a Rich text area field. I can't figure out how to preserve the carriage returns. Below is the simple version of my script that I have been using to try different things out. I know not to to put dmil inside of loops....again this is just a quick to find how to transfer the string. Without really understanding these different escape methods...I tried all of them...escapeEMCAScript, unescapeECMAScript, escapeHTML3 etc. But none of them work. Everything results in the string saved to the field without any returns.for(Project__c mp : [select Id, Brief__c, Opportunity__r.Description from Project__c
where Id = 'a10N0000001hF0WIAU'])
{
mp.Brief__c = mp.Opportunity__r.Description.escapeHtml4();
update mp;
}
Log In to reply.
Popular Salesforce Blogs
How Salesforce Einstein Works for FinTech: Features & Benefits Overview
67% of respondents consider artificial intelligence to be a top technology that will influence fintech over the decade. At the forefront of fintech's dynamic progress, Salesforce…
Top New Features in Spring’24 Release: Sales Cloud in Lightning
As a sales professional, staying up-to-date with the latest technology and features is crucial to ensuring success in your role. With Salesforce’s Spring ’24 release,…
7 Rules for a Better Salesforce Development
Salesforce ventures require arranging your application and at times creating code. To guarantee execution, practicality and stage limits, you have to do the correct design…
Popular Salesforce Videos
Drive Adoption with In-App Guidance and our Prebuilt Salesforce Package!
With In-App Guidance generally available in the Winter ‘20 release, there’s no better time to start taking advantage of the easiest way to add informative…
How to Create an Object in Salesforce Lightning Experience?
Salesforce has always emphasized on declarative development since the beginning. The motto is that enterprise software should be easy to use for customers. With “clicks…
Deep Dive into Salesforce Connected App
In this session, we will deep dive into Salesforce Connected app, its usage for Salesforce developers and admins, various options and configurations provided for Authentication…