3

I have a field which is currently of type Text Area (long) but has HTML tags in its content. I want to convert it to Rich Text Area but the no formatting is applied after conversion. Is there any work around for this?

  • 4
    Rather than converting, it's better off creating a new Rich Text Area field and create a workflow that will push the data from the Long Text Area into the Rich Text Area - that way all the HTML content is applied as HTML and not plain text. – Boris Bachovski Aug 22 '13 at 7:18
  • After that, you can mass update the records either through the developers console or data loader etc. – Boris Bachovski Aug 22 '13 at 7:19
  • I've posted that as an answer too. – Boris Bachovski Aug 26 '13 at 4:57
1

The Workflow Field Update also loses the markup so best to stick to Apex Trigger solution

Small Logic to help with

String mailbdy=c.LongareaField__c;
String body=mailbdy.unescapeHtml4();
c.RichareaField_c=body;
0

Wouldn't you be able to:

  • Create a new Rich Text field
  • Pull down all your records with just the Id field and your Long Area Text field using Data Loader
  • Use Data Loader to upload your file back onto the server to Update and map the old Long Area Text field into the new Rich Text field
  • Change the page layout to now use the new Rich Text field

This should take the long area text field and immediately map it into your Rich Text field without having to create any logic to handle that. It will also be completely unseen to your users.

0

Create a new Rich Text Area field and create a workflow that will push the data from the Long Text Area into the Rich Text Area - that way all the HTML content is applied as HTML and not plain text.

Once that is done, you can mass update the records either through the developers console or data loader etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.