-
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
Building a Custom Community Leaderboard for an Antivirus Software Company – A Salesforce Success Story
Gamification has become critical for running successful online communities. By implementing gamification techniques, online communities can become more active, and garner more user engagement. Regardless…
Comprehensive Salesforce Managed Services for Growing Businesses
As businesses grow, so do their challenges. One of the critical aspects of scaling any organization is managing the complexity that comes with it. Salesforce,…
Learn About the Business Process in Salesforce
A business process in Salesforce allows Admins to set up dedicated leads, sales, and support processes for each line of business of an organization. This…
Popular Salesforce Videos
Salesforce Stock CRM Huge News!
Why is Salesforce Stock CRM Stock going UP? Is Salesforce stock a buy? Should I buy CRM Stock? Is Salesforce stock a good investment? In…
Salesforce Admin Certification Questions and Explained Answers with References to Trailblazers
A Salesforce Admin Certification is the highest form of recognition a Salesforce Administrator can achieve; it demonstrates expertise in the field as well as a…
Salesforce Object Query Language (SOQL) Crash Course | The Complete Hands-on Tutorials
SOQL in Salesforce is used to retrieve data from the Salesforce database for specific information. This video covers everything you need to know as a…