You need to sign in to do that
Don't have an account?

TextArea NewLine Character
Hi all,
I am just creating a new Note within an Apex method, does anyone know how I can add a new line to the text? I have tried all the standard escape characters but none of them seem to work...
Cheers
James
Please try this:-
Controller:
public String getStr() {
return 'Test message before
LineFeed';
}
Documentation on linefeed states:-
A Boolean value that specifies whether sensitive HTML and XML characters should be escaped in the HTML output generated by this component. If you do not specify escape="false", the character escape sequence displays as written. Be aware that setting this value to "false" may be a security risk because it allows arbitrary content, including JavaScript, that could be used in a malicious manner.
Also the following worked for me:-
trigger helloWorldAccountTrigger on Account (before insert) {
Account[] accs = Trigger.new;
trigger.new[0].nav_isp__Competition__c='ooo---\n=====';
//in this nav_isp__Competition__c is a Textarea field and I got the following output ooo---
// ======
MyHelloWorld.addHelloWorld(accs);
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
All Answers
Please try this:-
Controller:
public String getStr() {
return 'Test message before
LineFeed';
}
Documentation on linefeed states:-
A Boolean value that specifies whether sensitive HTML and XML characters should be escaped in the HTML output generated by this component. If you do not specify escape="false", the character escape sequence displays as written. Be aware that setting this value to "false" may be a security risk because it allows arbitrary content, including JavaScript, that could be used in a malicious manner.
Also the following worked for me:-
trigger helloWorldAccountTrigger on Account (before insert) {
Account[] accs = Trigger.new;
trigger.new[0].nav_isp__Competition__c='ooo---\n=====';
//in this nav_isp__Competition__c is a Textarea field and I got the following output ooo---
// ======
MyHelloWorld.addHelloWorld(accs);
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
Cheers for that, I was sure I had tried using \n before and it didn't work (infact I'm sure I tried \r too!). Oh well, \n seems to be working for me now...
Thanks again
James