-
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
Is It a Good Idea to Implement Document Workflow Automation in Salesforce?
What is a Document Workflow? A document workflow is the process of routing, reviewing, approving, and managing documents within an organization. Document workflow software can…
Highlights of Salesforce and Alibaba collaboration
Salesforce and Alibaba Cloud have confirmed that they are working on a deal to build Salesforce Social Commerce, a headless commerce platform that will be…
Popular Salesforce Videos
Build an Experience with Salesforce Community Cloud: 4 Steps
Follow 4 fast steps to building a digital experience. Watch to learn how you can make CRM part of the way you deliver sites, forums,…
How to Edit List View Filters in Accounts and Contacts Tabs | Salesforce
Watch this video to learn How to Edit List View Filters in ‘Accounts’ and ‘Contacts’ Tabs. If you find anything confusing or have any questions,…
Dreamforce 2020 FAQs | Dreamforce To You | Salesforce Event
As the COVID-19 situation continues to evolve, questions around virtual Dreamforce 2020 continue to increase and that's why we've gone ahead and answered all the…