+ Start a Discussion
PatcsPatcs 

Converting Text Area(Long) into Text Area(Rich)

Hi

 

while converting Text Area(Long) Data Type into Text Area(Rich) will existing data be lost?

 

Thanks!

salesforce expertsalesforce expert

no data will be lost! but vice versa will do the damage! let me know if this helps you!

JNilukJNiluk
You can convert from Text Area (Long) to Email, Phone, Text, Text Area(Rich), or URL without loosing the existing data. But linebreaks in Text Area (Long) will not show in the Rich text field.

Solution: Update the Text with the apex code Text.replaceAll('<','(').replaceAll('>',')').replaceAll('\n','<br/>');

Note: 
You can only convert rich text area fields into long text area fields.
Erik RusselErik Russel
It won't allow me to convert my Text Area (Long) to Text Area(Rich) what am I missing? 
JNilukJNiluk
If you are using this Long text field in an Apex class or trigger, or in Visualforce page saved using Salesforce.com API version 17.0 or earlier, you cannot convert to a rich text area field.
Meredith ReadyMeredith Ready
I got an error and our Apex Class is on version 37.0 :/