14-06-2013, 12:37 PM
Visualforce Developer's Guide
Introducing Visualforce
Over the past several years, salesforce.com has created a comprehensive platform for building on-demand applications. Like
other sophisticated application development platforms, the Force.com platform offers separate tools for defining:
• The structure of the data—that is, the data model
• The rules that detail how that data can be manipulated—that is, the business logic
• The layouts that specify how that data should be displayed—that is, the user interface
Note: Splitting up application development tools based on whether they affect the data model, business logic, or user
interface is also known as the Model-View-Controller (MVC) application development pattern—the Model is the data
model, the View is the user interface, and the Controller is the business logic.
While the tools for building the data model and business logic for applications are powerful solutions that run natively on
Force.com platform servers, the existing tools for defining user interfaces have had certain limitations:
• Page layouts, the point-and-click tool that allows application developers to organize fields, buttons, and related lists on
record detail pages, do not provide much flexibility in how sets of information are displayed. Fields must always appear above
related lists, buttons must always appear above fields, and s-controls and custom links can only be placed in particular areas.
• S-controls, the tool that allows application developers to display custom HTML in a detail page or custom tab, provide
more flexibility than page layouts, but:
What is Visualforce?
Visualforce is a framework that allows developers to build sophisticated, custom user interfaces that can be hosted natively on
the Force.com platform. The Visualforce framework includes a tag-based markup language, similar to HTML.
In the Visualforce markup language, each Visualforce tag corresponds to a coarse or fine-grained user interface component,
such as a section of a page, a related list, or a field. The behavior of Visualforce components can either be controlled by the same logic that is used in standard Salesforce pages, or developers can associate their own logic with a controller class written
in Apex.
Where Can Visualforce Pages Be Used?
Developers can use Visualforce pages to:
• Override standard buttons, such as the New button for accounts, or the Save button for contacts
• Override tab overview pages, such as the Accounts tab home page
• Define custom tabs
• Embed components in detail page layouts
• Create dashboard components or custom help pages
• Customize, extend, or integrate the sidebars in the Service Cloud console (custom console components)
When Should I Use Visualforce?
The Salesforce prebuilt applications provide powerful CRM functionality. In addition, Salesforce provides the ability to
customize the prebuilt applications to fit your organization. However, your organization may have complex business processes
that are unsupported by the existing functionality. When this is the case, the Force.com platform includes a number of ways
for advanced administrators and developers to implement custom functionality. These include Visualforce, Apex, and the
SOAP API.
How is Visualforce Versioned?
Starting with the Summer '09 release, Visualforce pages and components are versioned. When a page or component has a
version number, the functionality of older Visualforce elements does not change as new implementations are introduced.
Visualforce versions start at 15.0. If you try to set the version of a Visualforce page to a version earlier than 15.0, it will
automatically be changed to 15.0.
To aid backwards-compatibility, each Visualforce page is saved with version settings for the specified version of the API as
well as the specific version of Visualforce. If the Visualforce page references installed managed packages, the version settings
for each managed package referenced by the Visualforce component is saved too. This ensures that as Visualforce, the API,
and the components in managed packages evolve in subsequent versions, a page is still bound to versions with specific, known
behavior.