Loading
Connectivity issues between Mulesoft and customer corporate network.Read More
Salesforce Enforces New Security Requirements in Summer 2026Read More
Extend Salesforce with Clicks, Not Code
HTMLENCODE

HTMLENCODE

Encodes text and merge field values for use in HTML by replacing characters that are reserved in HTML, such as the greater-than sign (>), with HTML entity equivalents, such as >.

Use

{!HTMLENCODE(text)} and replace text with the merge field or text string that contains the reserved characters.

Tips

This function is only available in custom buttons and links, and in Visualforce.

Example
Example If the merge field foo__c contains <B>Enter the user's name<b>, {!HTMLENCODE(foo__c)} results in: &lt;B&gt;Enter the user&#39;s name&lt;/b&gt;
 
Loading
Salesforce Help | Article