• Ilse
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

Hi,

I have copied text from an exisitng long text area field to a new rich text area field successfully using the following apex method (Encapsulation_NewInstructions__c is a rich text area field):

 

WebService static void UpdateEncapsSteps()

{

List <Solution> solutions = new List<Solution>();

for (Solution mySol : [Select Id, Encapsulation_Instructions__c, Encapsulation_NewInstructions__c From Solution])

{

mySol.Encapsulation_NewInstructions__c = mySol.Encapsulation_Instructions__c;

solutions.add(mySol);

}

update solutions;

}

 

All went well except text have been copied without the break lines (I suppose that in long text area break line is '/r/n' and the new rich text area field doesn't know to convert it into an HTML structure).

 

for example:

 

The origin was:

"straight forward. Need to run the Encapsulator from a short path (For example E:\43a and not C:\documents and settings\user\desktop\encapsulator 1.0.0.43a').
Otherwise, the encapsulation fails." 

 

The result was:

straight forward. Need to run the Encapsulator from a short path (For example E:\43a and not C:\documents and settings\user\desktop\encapsulator 1.0.0.43a'). Otherwise, the encapsulation fails.

 

How can I convert text to HTML format and saving the structure?

Do I have build in method for this?

 

Thanks

Shuky