I am not clear on the question. Can you please elobrate.
Assumption 1. You have a text area field in an object 2. You are trying to display that field in a VF Page and in Email Body
Solution 1. Enter the values in long text area as per your requirement. Each value in a new line. 2. Display the field in VF Page using apex:output field
This works fine for me. If my understanding is worng let me know. If it solves your query mark it as answer.
acc = new Account();
acc = [select id,description from account where id =: controller.getRecord().id];
system.debug(acc.description);
List<string> tempList = new List<String>();
tempList = (acc.description.split('\r\n'));
system.debug(tempList.size());
String FinalString;
for(string s : TempList){
if(FinalString == ''){
FinalString = s;
}else
FinalString = FinalString + '\n' + s;
}
This code will split the description from account object and the final string will have a values with newlines inbetween the values
Thanks
Manoj S
All Answers
I am not clear on the question. Can you please elobrate.
Assumption
1. You have a text area field in an object
2. You are trying to display that field in a VF Page and in Email Body
Solution
1. Enter the values in long text area as per your requirement. Each value in a new line.
2. Display the field in VF Page using apex:output field
This works fine for me. If my understanding is worng let me know. If it solves your query mark it as answer.
Thanks
Manoj S
acc = new Account();
acc = [select id,description from account where id =: controller.getRecord().id];
system.debug(acc.description);
List<string> tempList = new List<String>();
tempList = (acc.description.split('\r\n'));
system.debug(tempList.size());
String FinalString;
for(string s : TempList){
if(FinalString == ''){
FinalString = s;
}else
FinalString = FinalString + '\n' + s;
}
This code will split the description from account object and the final string will have a values with newlines inbetween the values
Thanks
Manoj S