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
Elad Kaplan 3Elad Kaplan 3 

insert HTML into Rich Text Area

Hi guys,

I'm trying to diplay piece of HTML in a rich text area field.

The problem is that it dispayes it as a pure HTML with all the tags,

Here is the HTML I'm trying to insert :

<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<p><strong>Related issues</strong></p>
<table class="list issues">
<tr class="issue hascontextmenu" id="relation-15556">
<td class="checkbox">*</td>
<td class="subject">
Related to
SX-IB -
<a href="/issues/20226" class="issue tracker-28 status-5 priority-6 priority-lowest closed assigned-to-my-group issue status-30 closed">Bug SW #20226</a>: error message in /var/log/messages: &quot;Failed to get port c...
</td>
<td class="status">Closed</td>
<td class="start_date">04/06/2012</td>
<td class="due_date"></td>
<td class="buttons"><a href="/relations/15556" data-confirm="Are you sure?" data-method="delete" data-remote="true" rel="nofollow" title="Delete relation"></a></td>
</tr>
<tr class="issue hascontextmenu" id="relation-15557">
<td class="checkbox">*</td>
<td class="subject">
Related to
SX-General -
<a href="/issues/365651" class="issue tracker-28 status-38 priority-6 priority-lowest closed assigned-to-my-group issue status-32 closed">Bug SW #365651</a>: [ibd.WARNING]: Failed to get port counters rcv_data MAD_...
</td>
<td class="status">Closed (Rejected)</td>
<td class="start_date">08/01/2014</td>
<td class="due_date"></td>
<td class="buttons"><a href="/relations/15557" data-confirm="Are you sure?" data-method="delete" data-remote="true" rel="nofollow" title="Delete relation"></a></td>
</tr>
</table>
</body>
</html>

Anybody ? 

Thanks !!
Nilesh Jagtap (NJ)Nilesh Jagtap (NJ)
Hi Elad,

Unfortunately, HTML code is not supported in the Salesforce HTML editor(Rich text area). HTML code is treated as text.
This is the reason you see HTML tags as text in your fields.
You can find salesforce documentation at : https://help.salesforce.com/HTViewHelpDoc?id=fields_using_rich_text_area.htm


Thanks,
N.J
Sforce.NinjaSforce.Ninja
Why don't you use a formula field? It displays most HTML
Elad Kaplan 3Elad Kaplan 3
Thanks Sforce.Ninja , 

How can I use a formula field to present HTML as a text ?

Thanks!!
Sforce.NinjaSforce.Ninja
I think we are looking at this the wrong way. You want to display a tabular data on the page, is that correct? I have an idea, why not write HTML component that displays the field using outputText?

I think that should work. Maybe.
Gauri Bhide 2Gauri Bhide 2
The only way it worked for me was through Data Loader.
Ghanshyam Yadav 44Ghanshyam Yadav 44
Hi Gauri, I have requirement, where we are taking data in tabular format from SAP system to SFDC system. Its possible to put table in RTF(Rich text field).
 
V TV T
Gael Axel Guy CangyGael Axel Guy Cangy

Hello, 
You can use the rich Text component used in the appBuilder which is not the same as the richText Areas field. Inside of it you can use a custom Label and store the html inside of the custom label and it will display the rendered html instead of the pure html.

please upvote if this answer helped you. :)