-
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
Apex Batch - Use of Interface Database.Stateful in Batch Class
Hello guys, Today, we will talk about interface named as Database.Stateful, it is used when we want to maintain the state across the batch call…
Don’t Neglect these Salesforce Application Development Considerations
Are you a Salesforce user and have the thought of building dynamic apps on the Salesforce platform? If yes, then you have come to the…
Boosting B2B Sales with AI and Automation in Commerce Cloud
B2B sales are rapidly evolving. Today’s consumers desire the same level of convenience and customization that they enjoy when making online purchases. Even when making…
Popular Salesforce Videos
Direct Messaging In Salesforce | Salesforce Lightning
Salesforce has addressed the main challenge retailers face is replicating the one-to-one in-store interactions with their customers, and supporting a seamless buying experience. Resolving these…
How Is Salesforce Overcoming the Rise In Generative AI?
Discover how Salesforce is harnessing the power of Generative AI to revolutionize customer experiences, streamline processes, and innovate like never before. In this extract discover…
Email to Case Advance | Converting Cases from Emails Effectively | Salesforce Tutorial
Email-to-Case Advance is an enhanced version of the Salesforce Email-to-Case functionality that converts customer email to cases. It works for Salesforce Service Cloud and provides…