You need to sign in to do that
Don't have an account?
Splitting Text area field into multiple lines
How can we split an address field(text area) into multiple lines. It shows in multiple lines. But when used in template will show all in one line.
Lets consider Billing Street. I am building a rich text area field where I need to display that field in a template. Now it is showing Billing Street in one line. I need to show them into mulitple lines.
I was using
String s = billingstreet.replaceAll('\r\n','<br/>');
String s = billingstreet.replaceAll('\n','<br/>');
Eg: 123 broad street <br/> headquarters of office
Even when i try this in rich text area its not displaying in seperate lines. Showing as same.
But nothing is working. Any Ideas!!!
I got it resolved... Text area can contain \n. If you press enter on address and again give a backspace when multiple lines are there. It changes from \n to '\r\n'
So u need to make sure u replaceall of \r\n with \n and then do a split and add <br/>.
That way <br/> gets appended to multiple lines and richtext area field will recognise <br/> and split into multiple lines.
All Answers
try this one.
checked your email template type, i think it's a Text, it's not html.
@samba... No its a html email template only.
I got it resolved... Text area can contain \n. If you press enter on address and again give a backspace when multiple lines are there. It changes from \n to '\r\n'
So u need to make sure u replaceall of \r\n with \n and then do a split and add <br/>.
That way <br/> gets appended to multiple lines and richtext area field will recognise <br/> and split into multiple lines.
I am also stuck in same Porblem.I have created a visualforce email template.I need to show T_Last_External_Post__c (field in Case object) on email template.
Here is my code.
but it not working .
any help is much appreciated.