function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Salesforce@322Salesforce@322 

Long text passing to the html body with multiple lines

Hi ,

I am generating a html body in apex class.html body contains the text field which contains the dynamic value.
While creating a record this text field value contains a new line then the html body is not properly forming throwing error
Please help me to solve this how to get the multiple lines in the html body.

your help will be appriciatable.
 
Andy BoettcherAndy Boettcher
Typically when displaying either Long Text or Rich Text fields on a Visualforce page, you will want to use the Visualforce components such as apex:outputText or apex:outputField to ensure that your formatting and intent is held true.  If you are directly injecting HTML through a field to your Visualforce page, also investigate the use of the "escape=true" attribute of the previously mentioned Visualforce components as well.
Salesforce@322Salesforce@322
Thanks for your replay Andy,
I just want to confirm one thing here am not using any visualforce page at all.
I am generating the html body and passing in json format as a request (HTTP) 
And am getting response as 505 error.
Andy BoettcherAndy Boettcher

Can you share some more information about what exactly you're doing?  What platform do you have this form on, what are you using to transmit that data back to Force.com, etc.?