CustomPageWebLink

Represents a custom link defined in a home page component.

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.

Important

All other custom links are stored as a WebLink in a CustomObject.

Parent Type 

This type extends Metadata and inherits its fields.

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 

availability 

  • Type: WebLinkAvailability (enumeration of type string)
  • Required: Yes
  • Description: Required. Indicates whether the link is only available online (online, or if it is also available offline (offline).

description 

  • Type: string
  • Required: No
  • Description: A description of the link.

displayType 

  • Type: WebLinkDisplayType (enumeration of type string)
  • Required: Yes
  • Description: Represents how this link is rendered.
  • Possible values:
    • link — for a hyperlink
    • button — for a button
    • massActionButton — for a button attached to a related list

encodingKey 

  • Type: Encoding (enumeration of type string)
  • Required: No
  • Description: Required. The default encoding setting is Unicode: UTF-8. Change it if your template requires data in a different format. This is available if your content source is URL. Valid values include:
  • Possible values:
    • UTF-8 — Unicode (UTF-8)
    • ISO-8859-1 — General US & Western Europe (ISO-8859–1, ISO-LATIN-1)
    • Shift_JIS — Japanese (Shift-JIS)
    • ISO-2022-JP — Japanese (JIS)
    • EUC-JP — Japanese (EUC-JP)
    • x-SJIS_0213 — Japanese (Shift-JIS_2004)
    • ks_c_5601-1987 — Korean (ks_c_5601-1987)
    • Big5 — Traditional Chinese (Big5)
    • GB2312 — Simplified Chinese (GB2312)
    • Big5-HKSCS — Traditional Chinese Hong Kong (Big5–HKSCS)

fullName 

  • Type: string
  • Required: No
  • Description: The name used as a unique identifier for API access. The fullName 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.

hasMenubar 

  • Type: boolean
  • Required: No
  • Description: If the openType is newWindow, this field indicates whether to show the browser menu bar for the window (true or not (false). Otherwise, leave this field empty.

hasScrollbars 

  • Type: boolean
  • Required: No
  • Description: If the openType is newWindow, this field indicates whether to show the scroll bars for the window (true) or not (false). Otherwise, leave this field empty.

hasToolbar 

  • Type: boolean
  • Required: No
  • Description: If the openType is newWindow, this field indicates whether to show the browser toolbar for the window (true) or not (false). Otherwise, leave this field empty.

height 

  • Type: int
  • Required: No
  • Description: Height in pixels of the window opened by the link. Required if the openType is newWindow. Otherwise, leave this field empty.

isResizable 

  • Type: boolean
  • Required: No
  • Description: If the openType is newWindow, this field indicates whether to allow resizing of the window (true) or not (false). Otherwise, leave this field empty.

linkType 

  • Type: WebLinkType (enumeration of type string)
  • Required: Yes
  • 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.
  • Possible values:
    • url
    • sControl
    • javascript
    • page
    • flow — Reserved for future use.

masterLabel 

  • Type: string
  • Required: No
  • Description: The label for the link.

openType 

  • Type: WebLinkWindowType (enumeration of type string)
  • Required: Yes
  • Description: Required. When the link is clicked, this field specifies the window style used to display the content.
  • Possible values:
    • newWindow
    • sidebar
    • noSidebar
    • replace
    • onClickJavaScript

page 

  • Type: string
  • Required: No
  • Description: If the value of linkType is page, this field represents the Visualforce page. Otherwise, leave this field empty.

position 

  • Type: WebLinkPosition (enumeration of type string)
  • Required: No
  • Description: If the openType is newWindow, this field indicates how the new window should be displayed. Otherwise, leave this field empty.
  • Possible values:
    • fullScreen
    • none
    • topLeft

protected 

  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether this component is protected (true) or not (false). Protected components cannot be linked to or referenced by components created in the installing organization.

requireRowSelection 

  • Type: boolean
  • Required: No
  • Description: If the openType is massAction, this field indicates whether to require individual row selection to execute the action for this button (true) or not (false). Otherwise, leave this field empty.

scontrol 

  • Type: string
  • Required: No
  • Description: If the value of linkType is sControl, this field represents the name of the sControl. Otherwise, leave this field empty.

showsLocation 

  • Type: boolean
  • Required: No
  • Description: If the openType is newWindow, this field indicates whether or not to show the browser location bar for the window. Otherwise, leave this field empty.

showsStatus 

  • Type: boolean
  • Required: No
  • Description: If the openType is newWindow, this field indicates whether or not to show the browser status bar for the window. Otherwise, leave this field empty.

url 

  • Type: string

  • Required: No

  • Description: If the value of linkType is url, this field represents the URL value. If the value of linkType is javascript, this field represents the JavaScript content. If the value is neither of these, leave this field empty.

    Content must be escaped in a manner consistent with XML parsing rules.

width 

  • Type: int

  • Required: No

  • Description: Width in pixels of the window opened by the link.

    Required if the openType is newWindow. Otherwise, leave this field empty.

Declarative Metadata Sample Definition 

The following is the definition of a Weblink. For related samples, see HomePageComponent and HomePageLayout.

1<?xml version="1.0" encoding="UTF-8"?>
2<CustomPageWebLink xmlns="http://soap.sforce.com/2006/04/metadata">
3    <availability>online</availability>
4    <displayType>button</displayType>
5    <encodingKey>UTF-8</encodingKey
6    <hasMenubar>false</hasMenubar>
7    <hasScrollbars>true</hasScrollbars>
8    <hasToolbar>false</hasToolbar>
9    <height>600</height>
10    <isResizable>true</isResizable>
11    <linkType>url</linkType>
12    <masterLabel>detailPageButon</masterLabel>
13    <openType>newWindow</openType>
14    <position>none</position>
15    <protected>false</protected>
16    <showsLocation>false</showsLocation>
17    <showsStatus>false</showsStatus>
18    <url>http://google.com</url>
19</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.