Loading
Ongoing maintenance for Salesforce HelpRead More
Feature degradation | Gmail Email delivery failureRead More
Extend Salesforce with Clicks, Not Code
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Custom Button and Link Fields

          Custom Button and Link Fields

          This table describes the fields that are available when you create a custom button or link.

          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

          Attribute Name Description
          Label Enter the text that displays in the user interface for the custom button or link.
          Name Accept or enter the unique name to use for the button or link when it’s referenced from a merge field. This name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
          Namespace Prefix Enter the prefix that uniquely identifies your package. In a packaging context, a namespace prefix is a one to 15-character alphanumeric identifier that distinguishes your package and its contents from packages of other developers on AppExchange. Namespace prefixes are case-insensitive. For example, ABC and abc aren’t recognized as unique. Your namespace prefix must be globally unique across all Salesforce organizations. It keeps your managed package under your control exclusively.
          Protected Component Optionally limit use in a subscriber org. Protected components can’t be linked to or referenced by components created in a subscriber org. A developer can delete a protected component in a future release without worrying about failing installations. However, after a component is marked as unprotected and is released globally, the developer can’t delete it.
          Description Enter text that distinguishes the button or link from others. This text displays only to administrators when setting up buttons and links.
          Display Type

          Determine where the button or link appears on page layouts.

          Detail Page Link
          Adds the link to the Custom Links section of your page layouts.
          Detail Page Button
          Adds the custom button to a record’s detail page. You can add detail page buttons to the Button section of a page layout.
          List Button
          Adds the custom button to a list view, search result layout, or related list. You can add list buttons to the Related List section of a page layout or the List View and Search Result layouts.

          For list buttons, Salesforce selects the Display Checkboxes (for Multi-Record Selection) option to include a checkbox next to each record in the list. Users can select the records they want applied to the action on the list button. If your custom button doesn’t require the user to select records, deselect this option.

          Behavior

          Choose the outcome of clicking the button or link.

          When applicable, some settings have default values. For example, if you choose Display in new window, the default height of a new window is 600 pixels. See Edit Window Open Properties.

          Some custom button and link behavior can’t be changed.

          • Custom buttons that use a URL to link to a Visualforce page open the page in the same tab, even if the Display in new window option is selected.
          • Custom button links open in a new tab in Experience Builder sites, even if any of the Display in existing window options is selected.
          Content Source

          Choose whether to use a URL, s-control, JavaScript action, or Visualforce page as the content of the button or link.

          Salesforce checks the correctness of URLs in custom links and custom buttons. When you create or edit custom links or buttons that contain invalid URL markup, such as scripts, Salesforce blocks the links from rendering. Instead, an error message is shown on hover. Reconfigure the URLs to be valid and well formed. The URL can be a relative URL or an absolute http://, https://, file://, ftp://, or mailto:// address. Invalid URLs in custom links or custom buttons created before Spring ’13 aren’t checked for correctness until you edit them.

          Content

          Enter the content of the button or link for buttons and links of type URL or OnClick JavaScript.

          • To insert a field, choose the field type from Select Field Type and choose a field from Insert Field.
          • To insert activity merge fields, select Event or Task from Select Field Type.
          • To insert an operator, choose the appropriate operator icon from the Insert Operator dropdown list.
          • To insert a function, double-click its name in the list, or select it and click Insert Selected Function. To filter the list of functions, choose a category from the Functions dropdown list. Select a function and click Help on this function to view a description and examples of formulas using that function.

          Internet standards require special encoding for URLs. Salesforce encodes the text from any merge field you insert into a link. Encode extra text in your link manually. For example, to generate this URL:

          http://www.google.com/search?q={!user.name} Steve Mark 50%

          Use this content:

          http://www.google.com/search?q={!user.name}+Steve+Mark+50%25

          Salesforce strips double quotes from URLs when the content source is a URL. If you must use double quotes, encode them manually. For example, to generate the URL http://www.google.com/search?q="salesforce+foundation", use this content: http://www.google.com/search?q=%22salesforce+foundation%22

          Link Encoding Choose the encoding setting. Encoding defaults to Unicode (UTF-8). Change the default encoding setting if the target of a link requires data in a different format. Encoding is available if your Content Source is URL.
           
          Loading
          Salesforce Help | Article