-
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
A Complete Guide On How To Implement Salesforce For Better Results
Salesforce implementation is of key importance for any company, big or small, and no matter what their specific needs and preferences are. Being one of…
Migrate Attachments and Files Seamlessly with iSyncSF: Your Trusted Salesforce Data Migration Solution
Salesforce is a powerful CRM platform that allows businesses to store and manage a variety of data, including attachments and files. When migrating data from…
What is Salesforce Marketing Automation in 2024?
Without a question, automation is growing more and more prevalent in today's majority of businesses. Automated machinery is seen at hotels, restaurants, and manufacturing facilities,…
Popular Salesforce Videos
What is Lead Assignment rule in Salesforce and How to create it?
This video explains Lead Assignment rules in depth in an interesting way and fun way. This video is divided into 4 parts: - What is…
Introduction to Journey Builder in Salesforce Marketing Cloud
Marketing Cloud's Journey Builder is a campaign planning tool that enables you to design and automate campaigns that guide customers through their journey with a…
Salesforce Anywhere – Release Readiness LIVE, Spring '21
Salesforce, the global leader in CRM, introduced Salesforce Anywhere – bringing together powerful new technologies and platform services to help organizations unlock new levels of…