-
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 can you Leverage Salesforce Digital 360 for your Business that Everyone is Talking About?
How to effectively develop your business – this is a subject that most business managers and owners grapple with within today’s highly competitive environment. The…

What to Expect from Dreamforce 2024: Salesforce AI and Future Technologies
Dreamforce 2024 is rapidly approaching, and excitement is at an all-time high. Dreamforce, held in San Francisco, USA, is the main gathering place for tech…

Workflows in Salesforce - All You Need to Know
Workflow, like its name workflow, helps to maintain the workflow of any procedure or processes by automating any procedure as well as processes to save…
Popular Salesforce Videos
Get the Most Out of Your Digital Adoption Efforts On Your Salesforce Community with GuideIn
Navigating online communities can be tricky. GuideIn is a Salesforce-native, lightning-ready product from the house of Grazitti that enables you to maximize digital adoption in…
Add Intelligence to Any Salesforce App with Einstein Discovery
Bring intelligence in the context on any Force.com app thanks to the power of Einstein Data Discovery. Any Salesforce Admin or Developer can add in…
Opportunity Manager for Salesforce
Opportunity Manager for Salesforce - The first opportunity manager app that has taken the initiative of converting information and data in the form of user-friendly…