---
schema_version: "1"
id: 42a975caa8543e8379834c4c8546a9b97705413e57f84fc18a668cb8d730bc85
title: Custom Button and Link Fields
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/defining_custom_links_fields.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.defining_custom_links_fields.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 899378a0d74ae4a68b73974e6b8be7a7d00d175a3cf530b08bc45dbd9c2e0fe0
description: This table describes the fields that are available when you create a custom button or link.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# Custom Button and Link Fields

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

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition">
        <colgroup>
          <col>
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>Custom buttons and links are available in: <strong>All</strong> Editions</p>
              <p style="margin-bottom:0;">Visualforce
                pages and s-controls are available in: <strong>Contact Manager</strong>, <strong>Group</strong>,
                <strong>Professional</strong>, <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>,
                and <strong>Developer</strong> Editions
              </p>
            </td>

          </tr>
        </tbody>
      </table> <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:23.076923076923077%">
          <col style="width:76.92307692307693%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d42277e87">Attribute Name</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d42277e90">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Attribute Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d42277e87 ">
              <samp class="parmname">Label</samp>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d42277e90 ">Enter the text that displays in the user interface for the custom
              button or link.</td>

          </tr>
          <tr class="">
            <td data-label="Attribute Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d42277e87 ">
              <samp class="parmname">Name</samp>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d42277e90 ">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.</td>

          </tr>
          <tr class="">
            <td data-label="Attribute Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d42277e87 ">
              <samp class="parmname">Namespace Prefix</samp>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d42277e90 ">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.</td>

          </tr>
          <tr class="">
            <td data-label="Attribute Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d42277e87 ">
              <samp class="parmname" id="defining_custom_links_fields__ProtectedComponentTitle"><a name="defining_custom_links_fields__ProtectedComponentTitle"><!-- --></a>Protected
                Component</samp>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d42277e90 ">Optionally limit use in a subscriber org. <span id="defining_custom_links_fields__ProtectedComponentDef"><a name="defining_custom_links_fields__ProtectedComponentDef"><!-- --></a>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.</span></td>

          </tr>
          <tr class="">
            <td data-label="Attribute Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d42277e87 ">
              <samp class="parmname">Description</samp>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d42277e90 ">Enter text that distinguishes the button or link from others.
              This text displays only to administrators when setting up buttons
              and links.</td>

          </tr>
          <tr class="">
            <td data-label="Attribute Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d42277e87 ">
              <samp class="parmname">Display Type</samp>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d42277e90 ">
              <p>Determine where the button or link appears on page layouts.</p>
              <dl>
                <dt style="font-weight:bold;padding-top:.25rem;">Detail Page Link</dt>
                <dd style="padding-left:1.5rem;padding-bottom:.5rem;">Adds the link to the Custom Links section of your page
                  layouts.</dd>
                <dt style="font-weight:bold;padding-top:.25rem;">Detail Page Button</dt>
                <dd style="padding-left:1.5rem;padding-bottom:.5rem;">Adds the custom button to a record’s detail page.
                  You can add detail page buttons to the Button section of
                  a page layout.</dd>
                <dt style="font-weight:bold;padding-top:.25rem;">List Button</dt>
                <dd style="padding-left:1.5rem;padding-bottom:.5rem;">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.<p style="margin-bottom:0;">For list buttons,
                    Salesforce selects the <strong class="uicontrol">Display Checkboxes
                      (for Multi-Record Selection)</strong> 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.</p>
                </dd>
              </dl>
            </td>

          </tr>
          <tr class="">
            <td data-label="Attribute Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d42277e87 ">
              <samp class="parmname">Behavior</samp>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d42277e90 ">
              <p>Choose the outcome of clicking the button or link.</p>
              <p>When applicable, some
                settings have default values. For example, if you choose <strong class="uicontrol">Display in new
                  window</strong>, the default height of a new window is 600 pixels. See <a href="https://help.salesforce.com/s/articleView?id=platform.editing_window_open_properties.htm&amp;release=264.0.0&amp;type=5" title="Custom buttons and links can open in different types of windows. If you configure a custom button or link to open in a window, set the window properties. If you leave the window properties blank, the custom button or link uses the default settings of the user’s browser.">Edit Window Open
                  Properties</a>.</p>
              <p>Some custom button and link behavior can’t be
                changed.</p>
              <ul>
                <li>Custom buttons that use a URL to link to a Visualforce page open the page in
                  the same tab, even if the <strong class="uicontrol">Display in new window</strong> option is
                  selected.</li>

                <li>Custom button links open in a new tab in Experience Builder sites, even if any
                  of the <strong class="uicontrol">Display in existing window</strong> options is
                  selected.</li>

              </ul>
            </td>

          </tr>
          <tr class="">
            <td data-label="Attribute Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d42277e87 ">
              <samp class="parmname">Content Source</samp>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d42277e90 ">
              <p>Choose whether to use a URL, s-control, JavaScript action, or
                Visualforce page as the content of the button or link.</p>
              <p style="margin-bottom:0;"><span id="defining_custom_links_fields__custom_link_url_correctness"><a name="defining_custom_links_fields__custom_link_url_correctness"><!-- --></a>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
                  <samp class="filepath">http://</samp>,
                  <samp class="filepath">https://</samp>,
                  <samp class="filepath">file://</samp>,
                  <samp class="filepath">ftp://</samp>, or
                  <samp class="filepath">mailto://</samp> address. Invalid URLs in
                  custom links or custom buttons created before Spring ’13
                  aren’t checked for correctness until you edit
                  them.</span></p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Attribute Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d42277e87 ">
              <samp class="parmname">Content</samp>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d42277e90 ">
              <p>Enter the content of the button or link for buttons and links of
                type URL or OnClick JavaScript.</p>
              <ul>
                <li>To insert a field, choose the field type from Select Field
                  Type and choose a field from Insert Field.</li>
                <li>To insert activity merge fields, select
                  <strong class="uicontrol">Event</strong> or
                  <strong class="uicontrol">Task</strong> from <samp class="parmname">Select Field
                    Type</samp>.
                </li>
                <li>To insert an operator, choose the appropriate operator icon
                  from the <samp class="parmname">Insert Operator</samp> dropdown
                  list.</li>
                <li>To insert a function, double-click its name in the list, or
                  select it and click<strong class="uicontrol"> Insert Selected
                    Function</strong>. To filter the list of functions,
                  choose a category from the <samp class="parmname">Functions</samp>
                  dropdown list. Select a function and click <strong class="uicontrol">Help
                    on this function</strong> to view a description and
                  examples of formulas using that function.</li>
              </ul>
              <p>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:</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>http://www.google.com/search?q={!user.name} Steve Mark 50%</code></pre>
              <p>Use
                this
                content:</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>http://www.google.com/search?q={!user.name}+Steve+Mark+50%25</code></pre>
              <p style="margin-bottom:0;">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
                <samp class="filepath">http://www.google.com/search?q="salesforce+foundation"</samp>,
                use this content:
                <samp class="filepath">http://www.google.com/search?q=%22salesforce+foundation%22</samp>
              </p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Attribute Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d42277e87 ">
              <samp class="parmname">Link Encoding</samp>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d42277e90 ">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.</td>

          </tr>
        </tbody>
      </table>