Scontrol defines a legacy s-control user interface component. Its content can be HTML, an external website URL, or a reusable snippet included in other s-controls. It defines the component itself; layouts, tabs, links, and other consuming metadata define where it is referenced.
The type is deprecated and superseded by Visualforce pages. Organizations that have not previously used s-controls cannot create them. Existing s-controls remain editable. This creation restriction matters when moving legacy configuration to another org: the ability to edit an existing component does not establish that the destination org can create it.
Key Elements
| Element | What the Element Controls |
|---|---|
contentSource |
Required. Selects how to interpret the content: HTML for direct content, URL for an external website link, or Snippet for content intended for inclusion in other s-controls. |
encodingKey |
Required, but behaviorally applies to URL mode. Controls character encoding when passing information to the URL. The default is UTF-8. Allowed values are Big5, Big5-HKSCS, EUC-JP, GB2312, ISO-2022-JP, ISO-8859-1, ks_c_5601-1987, Shift_JIS, UTF-8, and x-SJIS_0213. |
supportsCaching |
Required boolean. For HTML s-controls, true enables caching so that the page remembers which s-controls are present when it reloads; false disables it. This setting does not apply to URL or snippet content. |
fileContent |
Optional file contents displayed when the s-control is added to a custom link. Applies only when contentSource is HTML. |
fileName |
The unique file name, relevant only when fileContent has a value. Its naming restrictions match those of fullName. It cannot be changed for a component installed by a managed package. |
fullName |
The developer name and unique identifier for API access. It is separate from name and must satisfy the identifier restrictions described below. |
name |
Required unique name for the s-control, separate from fullName. The documented character restrictions conflict with the examples; see Documentation Inconsistencies. |
Behavior and Constraints
contentSource determines the meaning of the inherited content field and which settings affect behavior:
-
HTML:
contentholds the s-control's content.supportsCachingcontrols whether the page remembers which s-controls are present on reload. OptionalfileContentsupplies additional file contents displayed through a custom link. -
URL:
contentholds an external website link.encodingKeycontrols the character encoding used when passing information to that URL. Select an encoding other thanUTF-8when the destination requires it. -
Snippet:
contentholds reusable content intended for inclusion in other s-controls. A change can therefore affect the s-controls that incorporate the snippet, not just configurations that reference the snippet directly.
encodingKey and supportsCaching are required metadata elements even though their behavioral applicability is limited to URL and HTML modes, respectively. A supportsCaching value on a URL s-control does not establish caching behavior for that mode.
fullName must be unique, begin with a letter, and contain only alphanumeric characters and underscores. It cannot contain spaces, end with an underscore, or contain consecutive underscores. The same naming restrictions apply to fileName, which must also be unique in the org.
The managed-package restriction is specifically on changing fileName for an installed component. It does not establish that every s-control property is immutable.
description stores optional explanatory text visible only to users with View All Data permission. That permission restriction concerns the description; it is not a documented prerequisite for using the s-control.
Deployment and Retrieval
Scontrol extends MetadataWithContent and inherits content and fullName. In API transport, content is base64-encoded binary data. Clients making those calls must encode outgoing content and decode returned content; SOAP clients handle that conversion. Base64 is a way to represent binary data as text, and it is distinct from the URL character encoding selected by encodingKey.
The separate content file does not need to contain base64 text. For example, a URL s-control's content file can contain the website URL directly.
-
Directory: Components are stored in the
scontrolsfolder in the corresponding package directory. -
Content file: The suffix is
.scf. -
Companion metadata: The complete declarative example pairs
Myriad_Publishing.scfwithMyriad_Publishing.scf-meta.xml. The directory description uses a different companion-file naming form, as noted below. -
Manifest:
Scontrolsupports the*wildcard inpackage.xml.
When moving an s-control, account for the destination org's creation restriction separately from the file format and required elements. An org that has never used s-controls cannot create them, even though existing s-controls remain editable in orgs that already have them.
When replacing or removing an s-control, inspect its consuming configurations and any s-controls that include it as a snippet. The relationships below identify possible places to check. They do not prove actual usage in an org or establish a mandatory deployment sequence.
Relationships
The listed references are incoming: each element belongs to the consuming metadata, not to Scontrol. Separately, snippet inclusion creates a content dependency between s-controls that matters when changing shared content.
Referenced By
-
CustomApplication:content. -
CustomObject:content,customHelp,scontrol. -
CustomPageWebLink:scontrol. -
CustomTab:content,scontrol,splashPageLink. -
Dashboard:scontrol. -
Layout:scontrol. -
Translations:namein the corresponding s-control translation structure. -
WebLink:scontrol.
Documentation Inconsistencies
-
Allowed characters in
name: The field description requires alphanumeric characters only and an initial letter, but its example contains underscores, and the complete XML example contains a space. This leaves the documented restrictions fornameinconsistent. Neither example relaxes the explicit restrictions onfullName. -
Companion metadata filename: The directory description calls the file
ScontrolName-meta.xml, while the complete example usesMyriad_Publishing.scf-meta.xml. The example includes.scfbefore-meta.xml; the prose naming form does not.
Reported Issues
-
Existing s-controls were reported as copied during sandbox creation without a separate deployment. A 2015 community answer lists
Scontrolamong setup-related objects copied by default when creating a sandbox. The answer does not distinguish sandbox types. See the sandbox-copy discussion. -
Apex queries were reported as an option for s-control inventory. A 2021 community answer lists the
ScontrolsObject, the API record representation, among objects queryable from Apex and defined in both the SOAP and Tooling APIs. This is a query capability, not a statement that a destination org can create or deploy new s-controls. See the Apex queryability discussion.
Common Questions
Can I deploy an s-control to an org that has never used s-controls?
Organizations that have not previously used s-controls cannot create them. Existing s-controls remain editable, but that does not remove the creation restriction when moving legacy configuration to another org.
Are encodingKey and supportsCaching required for a URL s-control?
Yes. Both are required metadata elements. For URL mode, encodingKey controls character encoding and defaults to UTF-8. supportsCaching applies only to HTML mode, so setting it on a URL s-control does not establish caching behavior.
Does an Scontrol .scf file need base64-encoded content?
No. Base64 applies to the inherited content field during API transport, with SOAP clients handling conversion. It does not require the separate .scf file to contain base64 text, and it is unrelated to encodingKey.
What is the difference between name and fullName?
fullName is the developer name and unique API identifier. name is a separate required name. The examples conflict with the documented character restrictions for name, but the explicit restrictions on fullName still apply.
What references should I check before replacing or removing an s-control?
Check the consuming metadata listed under Relationships, including layouts, dashboards, links, objects, tabs, applications, and translations. Also check other s-controls that include it as a snippet. These possible connections do not by themselves prove usage or require a particular deployment order.