HTML S-Control
An HTML S-Control is a now-retired Salesforce mechanism for embedding custom HTML, JavaScript, or CSS into a Salesforce page.
Definition
An HTML S-Control is a now-retired Salesforce mechanism for embedding custom HTML, JavaScript, or CSS into a Salesforce page. S-Controls preceded Visualforce as the first way for developers to extend the Salesforce UI with custom code. An admin would create an S-Control of type HTML, paste in markup, and reference it from a custom button, link, or page section. The browser rendered the HTML in an iframe inside the Salesforce UI, with limited access to Salesforce session data via the AJAX Toolkit.
Salesforce deprecated S-Controls in 2010 and replaced them with Visualforce as the supported UI extension framework. New orgs cannot create S-Controls, and existing orgs cannot edit them (the create-edit interface was removed from Setup years ago). Existing S-Controls still render in Classic UI for backwards compatibility but fail to render in Lightning Experience entirely. Any inherited org still using S-Controls needs a migration to Visualforce, Lightning Components, or Lightning Web Components.
The historical context behind S-Controls and why they were retired
Before Visualforce, before Lightning
Salesforce launched in 1999 with a fixed UI. Customers wanted to extend the experience but had no native framework. The HTML S-Control debuted in 2002 as a way to drop custom markup into pages via the AJAX Toolkit. Developers wrote pure HTML and JavaScript, accessed the user''s session through a JavaScript API, and rendered the result inside an iframe on the Salesforce page. Hundreds of AppExchange apps were built on this model in the mid-2000s.
Why S-Controls were limited
S-Controls had no server-side processing on the Salesforce platform. Every interaction relied on JavaScript executing in the browser, with calls back to Salesforce via the AJAX Toolkit. There was no way to enforce server-side validation, no formal MVC pattern, no Salesforce-supplied component library. Each S-Control reinvented basic UI elements. This made apps fragile and inconsistent across Salesforce''s growing surface area.
Visualforce as the replacement
Salesforce launched Visualforce in 2008 as the supported UI framework. Visualforce introduced a tag-based markup language with server-side controllers (Apex), a component library, automatic state management via ViewState, and tight integration with the Salesforce data model. Visualforce solved the problems S-Controls couldn''t. Salesforce announced S-Control deprecation in 2010 with a five-year sunset window.
Current S-Control state in Salesforce
S-Controls still exist as a metadata type for backwards compatibility. Setup, Custom S-Controls shows the list (when the org has any). The Create button is greyed out; the Edit link is removed. Existing S-Controls still render in Salesforce Classic via the iframe model, but Lightning Experience does not render them at all. Buttons or links that reference an S-Control simply fail in Lightning.
Migration paths
Migration depends on what the S-Control did. Simple HTML pop-ups become Visualforce pages with the same markup. Interactive forms become Lightning Web Components with @AuraEnabled Apex methods. Custom dashboards become Lightning App Builder pages. The migration is non-trivial because S-Control JavaScript was often written before modern Apex existed; the logic needs to be rewritten, not just transplanted.
Lightning Experience incompatibility
The Lightning Experience cutover is the forcing function for S-Control migration. Salesforce has been moving every customer to Lightning for years; orgs still on Classic with active S-Controls cannot make the cutover until the S-Controls are migrated. This is the single most common technical debt blocker for Classic-to-Lightning projects.
Cert exam and legacy documentation
Older Salesforce Platform Developer I and Platform App Builder exams referenced S-Controls. Current exams have removed them; knowing that S-Controls existed, that they were replaced by Visualforce, and that they cannot render in Lightning is the full extent of relevance for modern certification.
Migrate an inherited S-Control to a modern framework
The migration is mandatory for any org on Lightning. Plan a sprint per non-trivial S-Control.
- Inventory existing S-Controls
Setup, Custom S-Controls. List every S-Control with its name, type, where it''s referenced (buttons, links, custom Visualforce includes), and what it does.
- Pick the target framework
Visualforce for simple ports; Lightning Web Component for any UI that should work in Lightning Experience; Lightning App Builder for dashboard-style pages.
- Rewrite the logic
Translate the S-Control HTML and JavaScript into the target framework. Push business logic into Apex methods; render UI with the framework''s component library.
- Update references
Find every custom button, link, or page that referenced the old S-Control. Update each to point to the new Visualforce page or LWC component.
- Test in both Classic and Lightning
Verify the migration works in both UIs during transition. Deactivate the old S-Control once the new component is fully cut over.
- Delete the S-Control
After confirming nothing depends on it, delete the S-Control. The metadata sticks around until explicitly removed, which clutters package deployments.
- S-Controls do not render in Lightning Experience. Any org still on Classic with S-Controls cannot complete a Lightning cutover until they migrate.
- The S-Control editor was removed years ago. Existing S-Controls cannot be edited even in Classic; they can only be deleted or referenced.
- S-Control JavaScript often relies on the AJAX Toolkit. The Toolkit itself is deprecated and may stop working in future releases.
- AppExchange packages built on S-Controls are end-of-life. Replace any such package as part of the migration, not as a separate project.
Trust & references
Cross-checked against the following references.
- S-Controls RetirementSalesforce Help
- Visualforce Developer GuideSalesforce Developers
Straight from the source - Salesforce's reference material on HTML S-Control.
- Lightning Web Components Developer GuideSalesforce Developers
About the Author
Dipojjal Chakrabarti is a B2C Solution Architect with 29 Salesforce certifications and over 13 years in the Salesforce ecosystem. He runs salesforcedictionary.com to help admins, developers, architects, and cert/interview candidates sharpen their fundamentals. More about Dipojjal.
Test your knowledge
Q1. What was an HTML S-Control?
Q2. What replaced S-Controls?
Q3. Should you use S-Controls today?
Discussion
Loading discussion…