-
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
The Sales Cloud: All You Need to Know
Unleashing Growth with Salesforce Sales Cloud: Revolutionizing Customer Engagement In the digital age, where customers are more empowered and discerning than ever before, businesses must…
Salesforce Commerce Cloud Implementation
Salesforce is a globally trusted and most popular cloud-based platform that offers a wide range of digital products to businesses to increase their potential, acquire…
The Salesforce Schema Builder — What You Need To Know
Keeping the pace of change is a constant challenge for systems and IT teams running Salesforce. Luckily, the platform comes with a ton of built-in…
Popular Salesforce Videos
Salesforce Contact Tracing for Employees Demo
As businesses gradually reopen after worldwide closures, many people feel concerned about the second spike in COVID-19 cases. To ensure public safety, local officials have…
Pardot Marketing Automation Tools Overview Webinar
Are you looking to take your Salesforce Marketing Automation to the next level? Learn how to build successful lead nurturing campaigns that empower your sales team…
eShopSync for QuickBooks - A Salesforce QuickBooks Connector
One of the best Quickbooks Integration Solution With Salesforce. It efficiently sends QuickBooks data (Categories, Users, Products, and Orders) to Salesforce. For more information, please…