WebLink
Represents a custom button or link defined in a custom object.
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.
This type extends Metadata and inherits its fields.
WebLinks are available in API version 12.0 and later.
- Type: WebLinkAvailability (enumeration of type string)
- Required: Yes
- Description: Required. Indicates whether the button or link is only available online (
online, or if it is also available offline (offline).
- Type: string
- Required: No
- Description: A description of the button or link.
- Type: WebLinkDisplayType (enumeration of type string)
- Required: Yes
- Description: Represents how the button or link is rendered.
- Possible values:
- link — for a hyperlink
- button — for a button
- massActionButton — for a button attached to a related list
-
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)
-
Type: string
-
Required: No
-
Description: The name of the custom button or link with white spaces and special characters escaped for validity. The name can only contain characters, letters, and the underscore (_) character. The name must start with a letter, and can’t end with an underscore or contain two consecutive underscore characters.
Inherited from the Metadata component, this field isn’t defined in the WSDL for this component. It must be specified when creating, updating, or deleting. See create() to see an example of this field specified for a call.
- Type: boolean
- Required: No
- Description: If the
openTypeisnewWindow, this field indicates whether to show the browser menu bar for the window (true) or not (false). Otherwise, leave this field empty.
- Type: boolean
- Required: No
- Description: If the
openTypeisnewWindow, this field indicates whether to show the scroll bars for the window (true) or not (false). Otherwise, leave this field empty.
- Type: boolean
- Required: No
- Description: If the
openTypeisnewWindow, this field indicates whether to show the browser toolbar for the window (true) or not (false). Otherwise, leave this field empty.
- Type: int
- Required: No
- Description: Height in pixels of the window opened by the custom button or link. Required if the
openTypeisnewWindow. Otherwise, leave this field empty.
- Type: boolean
- Required: No
- Description: If the
openTypeisnewWindow, this field indicates whether to allow resizing of the window (true) or not (false). Otherwise, leave this field empty.
- 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.
- Type: string
- Required: No
- Description: Master label for this object. This display value is the internal label that is not translated.
- Type: WebLinkWindowType (enumeration of type string)
- Required: Yes
- Description: Required. When the button or link is clicked, specifies the window style that will be used to display the content.
- Possible values:
- newWindow
- sidebar
- noSidebar
- replace
- onClickJavaScript
- Type: string
- Required: No
- Description: If the value of
linkTypeispage, this field represents the Visualforce page. Otherwise, leave this field empty.
- Type: WebLinkPosition (enumeration of type string)
- Required: No
- Description: If the value of
OpenTypeisnewWindow, this field indicates how the new window should be displayed. Otherwise, don’t specify a value. - Possible values:
- fullScreen
- none
- topLeft
- Type: boolean
- Required: Yes
- Description: Required. Indicates whether this subcomponent is protected (
true) or not (false). Protected subcomponents can’t be linked to or referenced by components or subcomponents created in the installing organization.
- Type: boolean
- Required: No
- Description: If the
displayTypeismassActionButton, 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.
- Type: string
- Required: No
- Description: If the value of
linkTypeissControl, this field represents the name of the sControl. Otherwise, leave this field empty.
- Type: boolean
- Required: No
- Description: If the
openTypeisnewWindow, this field indicates whether to show the browser location bar for the window (true) or not (false). Otherwise, leave this field empty.
- Type: boolean
- Required: No
- Description: If the
openTypeisnewWindow, this field indicates whether to show the browser status bar for the window. Otherwise, leave this field empty.
-
Type: string
-
Required: No
-
Description: If the value of
linkTypeisurl, this is the URL value. If the value oflinkTypeisjavascript, this is the JavaScript content. If the value is neither of these options, leave this field empty.Content must be escaped in a manner consistent with XML parsing rules.
-
Type: int
-
Required: No
-
Description: Width in pixels of the window opened by the button or link.
Required if the
openTypeisnewWindow. Otherwise, leave this field empty.
The following is the definition of a WebLink in a custom object. For related samples, see Declarative Metadata Sample Definition and Declarative Metadata Sample Definition.
The following Java sample shows sample values for WebLink fields:
This metadata type doesn’t support 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.