---
schema_version: "1"
id: 76952b62760752703a2847e83ca440de309dd49427ebc8d70da659d03eec0f91
title: CustomPageWebLink
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/custompageweblink.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/custompageweblink.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: dcd3dd18cd6af8df8b31cdcddcfa764f03e7193392be275b988cf84ed57deb53
description: Represents a custom link defined in a home page component.
---
# CustomPageWebLink

Represents a custom link defined in a home page component.

This type extends the [Metadata](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm "The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.") metadata type and inherits its fullName field.

![Important](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/images/icon_note_important.png)

#### Important

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

All other custom links are stored as a [WebLink](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_weblink.htm "Represents a custom button or link defined in a custom object.") in a [CustomObject](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customobject.htm "Represents a custom object that stores data unique to your org or an external object that maps to data stored outside your org.").

## Declarative Metadata File Suffix and Directory Location

There is one file per custom link definition, stored in the weblinks folder in the corresponding package directory. The file suffix is .weblink.

## Version

CustomPageWebLinks are available in API version 13.0 and later.

## Fields

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d63912e125">Field Name</th>

              <th class="featureTableHeader  " id="d63912e128">Field Type </th>

              <th class="featureTableHeader  " id="d63912e131">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname">availability</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">WebLinkAvailability (enumeration of type string)</td>

              <td class="entry" headers="d63912e131" data-title="Description">Required. Indicates whether the link is only available online
                (<samp class="codeph nolang">online</samp>, or if it is also
                available offline (<samp class="codeph nolang">offline</samp>).</td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname">description</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">string</td>

              <td class="entry" headers="d63912e131" data-title="Description">A description of the link.</td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname" id="displaytype"><a name="displaytype"><!-- --></a>displayType</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">WebLinkDisplayType (enumeration of type string)</td>

              <td class="entry" headers="d63912e131" data-title="Description">Represents how this link is rendered.<p class="p">Valid values:</p>
                <ul class="ul bulletList">
                  <li class="li">
                    <samp class="codeph nolang">link</samp> for a
                    hyperlink
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">button</samp> for a
                    button
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">massActionButton</samp> for a
                    button attached to a related list
                  </li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname">encodingKey</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">Encoding (enumeration of type string)</td>

              <td class="entry" headers="d63912e131" data-title="Description">Required. The default encoding setting is Unicode: <samp class="codeph xml">UTF-8</samp>. Change it if your template
                requires data in a different format. This is available if your
                content source is URL. Valid values include:<ul class="ul bulletList">
                  <li class="li">
                    <samp class="codeph nolang">UTF-8</samp>—Unicode
                    (UTF-8)
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">ISO-8859-1</samp>—General US &amp; Western Europe
                    (ISO-8859–1, ISO-LATIN-1)
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">Shift_JIS</samp>—Japanese (Shift-JIS)
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">ISO-2022-JP</samp>—Japanese (JIS)
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">EUC-JP</samp>—Japanese
                    (EUC-JP)
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">x-SJIS_0213</samp>—Japanese (Shift-JIS_2004)
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">ks_c_5601-1987</samp>—Korean (ks_c_5601-1987)
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">Big5</samp>—Traditional
                    Chinese (Big5)
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">GB2312</samp>—Simplified Chinese (GB2312)
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">Big5-HKSCS</samp>—Traditional Chinese Hong Kong
                    (Big5–HKSCS)
                  </li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname">fullName</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">string</td>

              <td class="entry" headers="d63912e131" data-title="Description">The name used as a unique identifier for API access. The
                <span class="keyword parmname">fullName</span> can contain only underscores and
                alphanumeric characters. It must be unique, begin with a letter, not
                include spaces, not end with an underscore, and not contain two
                consecutive underscores.
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname">hasMenubar</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">boolean</td>

              <td class="entry" headers="d63912e131" data-title="Description">If the <span class="keyword parmname">openType</span> is <samp class="codeph nolang">newWindow</samp>, this field indicates
                whether to show the browser menu bar for the window (<samp class="codeph java">true</samp> or not (<samp class="codeph java">false</samp>). Otherwise, leave this field
                empty.</td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname">hasScrollbars</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">boolean</td>

              <td class="entry" headers="d63912e131" data-title="Description">If the <span class="keyword parmname">openType</span> is <samp class="codeph nolang">newWindow</samp>, this field indicates
                whether to show the scroll bars for the window (<samp class="codeph java">true</samp>) or not (<samp class="codeph java">false</samp>). Otherwise, leave this field
                empty.</td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname">hasToolbar</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">boolean</td>

              <td class="entry" headers="d63912e131" data-title="Description">If the <span class="keyword parmname">openType</span> is <samp class="codeph nolang">newWindow</samp>, this field indicates
                whether to show the browser toolbar for the window (<samp class="codeph java">true</samp>) or not (<samp class="codeph java">false</samp>). Otherwise, leave this field
                empty.</td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname">height</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">int</td>

              <td class="entry" headers="d63912e131" data-title="Description">Height in pixels of the window opened by the link. Required if
                the <span class="keyword parmname">openType</span> is <samp class="codeph nolang">newWindow</samp>. Otherwise, leave this field empty.</td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname">isResizable</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">boolean</td>

              <td class="entry" headers="d63912e131" data-title="Description">If the <span class="keyword parmname">openType</span> is <samp class="codeph nolang">newWindow</samp>, this field indicates
                whether to allow resizing of the window (<samp class="codeph java">true</samp>) or not (<samp class="codeph java">false</samp>). Otherwise, leave this field empty.</td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname" id="linktype"><a name="linktype"><!-- --></a>linkType</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">WebLinkType (enumeration of type string)</td>

              <td class="entry" headers="d63912e131" data-title="Description">Required. Represents whether the content of the button or link is
                specified by a URL, an sControl, a JavaScript code block, or a
                Visualforce page.<ul class="ul bulletList">
                  <li class="li"><samp class="codeph nolang">url</samp></li>

                  <li class="li"><samp class="codeph nolang">sControl</samp></li>

                  <li class="li"><samp class="codeph nolang">javascript</samp></li>

                  <li class="li"><samp class="codeph nolang">page</samp></li>

                  <li class="li">
                    <samp class="codeph nolang">flow</samp>—Reserved
                    for future use.
                  </li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname">masterLabel</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">string</td>

              <td class="entry" headers="d63912e131" data-title="Description">The
                label for the link.</td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname" id="opentype"><a name="opentype"><!-- --></a>openType</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">WebLinkWindowType (enumeration of type string)</td>

              <td class="entry" headers="d63912e131" data-title="Description">Required. When the link is clicked, this field specifies the
                window style used to display the content.<p class="p">Valid values are:</p>
                <ul class="ul bulletList">
                  <li class="li"><samp class="codeph nolang">newWindow</samp></li>

                  <li class="li"><samp class="codeph nolang">sidebar</samp></li>

                  <li class="li"><samp class="codeph nolang">noSidebar</samp></li>

                  <li class="li"><samp class="codeph nolang">replace</samp></li>

                  <li class="li"><samp class="codeph nolang">onClickJavaScript</samp></li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname">page</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">string</td>

              <td class="entry" headers="d63912e131" data-title="Description">If the value of <span class="keyword parmname">linkType</span> is <samp class="codeph nolang">page</samp>, this field represents the
                Visualforce page. Otherwise, leave this field empty.</td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname">position</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">WebLinkPosition (enumeration of type string)</td>

              <td class="entry" headers="d63912e131" data-title="Description">If the <span class="keyword parmname">openType</span> is <samp class="codeph nolang">newWindow</samp>, this field indicates how
                the new window should be displayed. Otherwise, leave this field
                empty.<p class="p">Valid values are:</p>
                <ul class="ul bulletList">
                  <li class="li"><samp class="codeph nolang">fullScreen</samp></li>

                  <li class="li"><samp class="codeph nolang">none</samp></li>

                  <li class="li"><samp class="codeph nolang">topLeft</samp></li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname">protected</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">boolean</td>

              <td class="entry" headers="d63912e131" data-title="Description">Required. <span class="ph" id="field_protected_desc"><a name="field_protected_desc"><!-- --></a>Indicates whether this
                  component is protected (<samp class="codeph java">true</samp>)
                  or not (<samp class="codeph java">false</samp>). Protected
                  components cannot be linked to or referenced by components
                  created in the installing organization.</span>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname">requireRowSelection</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">boolean</td>

              <td class="entry" headers="d63912e131" data-title="Description">If the <span class="keyword parmname">openType</span> is <samp class="codeph nolang">massAction</samp>, this field indicates
                whether to require individual row selection to execute the action
                for this button (<samp class="codeph java">true</samp>) or not
                (<samp class="codeph java">false</samp>). Otherwise, leave
                this field empty.</td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname">scontrol</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">string</td>

              <td class="entry" headers="d63912e131" data-title="Description">If the value of <span class="keyword parmname">linkType</span> is <samp class="codeph nolang">sControl</samp>, this field represents the
                name of the sControl. Otherwise, leave this field empty.</td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname">showsLocation</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">boolean</td>

              <td class="entry" headers="d63912e131" data-title="Description">If the <span class="keyword parmname">openType</span> is <samp class="codeph nolang">newWindow</samp>, this field indicates
                whether or not to show the browser location bar for the window.
                Otherwise, leave this field empty.</td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname">showsStatus</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">boolean</td>

              <td class="entry" headers="d63912e131" data-title="Description">If the <span class="keyword parmname">openType</span> is <samp class="codeph nolang">newWindow</samp>, this field indicates
                whether or not to show the browser status bar for the window.
                Otherwise, leave this field empty.</td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname">url</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">string</td>

              <td class="entry" headers="d63912e131" data-title="Description">
                <p class="p">If the value of <span class="keyword parmname">linkType</span> is <samp class="codeph nolang">url</samp>, this field represents the
                  URL value. If the value of <span class="keyword parmname">linkType</span> is
                  <samp class="codeph nolang">javascript</samp>, this field
                  represents the JavaScript content. If the value is neither of
                  these, leave this field empty.
                </p>

                <p class="p">Content must be escaped in a manner consistent with XML parsing
                  rules.</p>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d63912e125" data-title="Field Name"><span class="keyword parmname">width</span></td>

              <td class="entry" headers="d63912e128" data-title="Field Type">int</td>

              <td class="entry" headers="d63912e131" data-title="Description">Width in pixels of the window opened by the link. <p class="p">Required if
                  the <span class="keyword parmname">openType</span> is <samp class="codeph nolang">newWindow</samp>. Otherwise, leave this field
                  empty.</p>
              </td>

            </tr>

          </tbody>

        </table>

## Declarative Metadata Sample Definition

The following is the definition of a Weblink. For related samples, see [HomePageComponent](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_homepagecomponent.htm#HomePageCompenent_example) and [HomePageLayout](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_homepagelayouts.htm#HomePageLayout_meta_example).

<?xml version="1.0" encoding="UTF-8"?>
<CustomPageWebLink xmlns="http://soap.sforce.com/2006/04/metadata">
    <availability\>online</availability\>
    <displayType\>button</displayType\>
    <encodingKey\>UTF-8</encodingKey
    <hasMenubar\>false</hasMenubar\>
    <hasScrollbars\>true</hasScrollbars\>
    <hasToolbar\>false</hasToolbar\>
    <height\>600</height\>
    <isResizable\>true</isResizable\>
    <linkType\>url</linkType\>
    <masterLabel\>detailPageButon</masterLabel\>
    <openType\>newWindow</openType\>
    <position\>none</position\>
    <protected\>false</protected\>
    <showsLocation\>false</showsLocation\>
    <showsStatus\>false</showsStatus\>
    <url\>http://google.com</url\>
</CustomPageWebLink\>

## Wildcard Support in the Manifest File

This metadata type supports the wildcard character \* (asterisk) in the package.xml manifest file. For information about using the manifest file, see [Deploying and Retrieving Metadata with the Zip File](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/file_based_zip_file.htm "The deploy() and retrieve() calls are used to deploy and retrieve a .zip file. Within the .zip file is a project manifest (package.xml) that lists what to retrieve or deploy, and one or more XML components that are organized into folders.").

#### See Also

- [HomePageComponent](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_homepagecomponent.htm "Represents the metadata associated with a home page component. You can customize the Home tab in Salesforce Classic to include components such as sidebar links, a company logo, a dashboard snapshot, or custom components that you create. Use to create, update, or delete home page component definitions.")
- [HomePageLayout](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_homepagelayouts.htm "Represents the metadata associated with a home page layout. You can customize home page layouts and assign the layouts to users based on their user profile.")
- [WebLink](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_weblink.htm "Represents a custom button or link defined in a custom object.")