Merge Fields for Custom Buttons and Links

A merge field is a field that incorporates values from an object record. You can put merge fields in an email template, mail merge template, custom link, or formula.

Required Editions

Available in: Salesforce Classic

Custom buttons and links are available in: All Editions

Visualforce pages and s-controls are available in: Contact Manager, Group, Professional, Enterprise, Performance, Unlimited, and Developer Editions

Syntax and Formatting

When you insert a merge field in a custom button or link, the syntax consists of an open curly brace and exclamation point, followed by the object name, a period, the field name, and a closing curly brace.

{!Object_Name.Field_Name}

To ensure that you’re using the correct syntax, select merge fields from the dropdown list in the editor for custom buttons and links.

Note
Note Custom objects named Org can’t be used in a merge field. Objects named org are explicitly filtered from the Select Field Type list for a custom button.

Tips

  • To insert activity merge fields, select Event or Task from the Select Field Type dropdown list.
  • You can add links quickly to the sidebar by using the standard home page’s Custom Links component.
    Warning
    Warning The standard home page’s Custom Links component doesn’t support
    • Merge fields
    • Functions, such as URLFOR
    • JavaScript execution
    • Customizable window opening properties