8. Use Case 1 Features
Standard Controller
– Required to override standard page
– Manages a Salesforce record
• Account in this example
– Declarative – no Apex code
10. Use Case 2 Features
Standard Controller
– As use case 1
– Managing Account
Extension Controller
– Coded in Apex
– Extends Standard Controller
– Managing Contacts
– Delegate to Standard Controller
12. Use Case 3 Features
Custom Controller
– No standard controller to extend
– Coded in Apex from scratch
– Method to execute search
– All data managed in properties
14. Use Case 4 Features
Any type of controller (including none)
Exclude Salesforce Styling, Elements
Regular HTML
External CSS and JavaScript Libraries
Surfaced through Force.com Site
16. Example Page - Markup
Page tag - container
Standard controller – no code!
Standard component with attributes
Regular HTML
Standard component – no attributes
Closing page tag
20. Data Binding
Merge syntax – {! <expression> }
Display fields from managed record
– <apex:page StandardController=“Account”>
You are viewing <apex:outputField value=“{!Account.Name}”
/>.
21. Data Binding
Update fields from managed record
<apex:page StandardController=“Account”>
<apex:form>
<apex:inputField value=“{!Account.Industry}” />
22. Data Binding
Access properties from controller
– Public with public getter:
public String myStr {get; set;}
– <apex:page controller=“MyController”>
<apex:form>
Enter text: <apex:inputText value=“{!myStr}” />
24. Where Next?
https://developer.salesforce.com
– Developer Portal
– Documentation, Wiki, Blogs, Forums
Developer Edition - http://bobbuzz.me.uk/1n2NND2
– All Salesforce features
– Restrictions on users and records
Must be wrapped in form, as will generate an HTML input element.
Note that the appropriate input for the field type is generated – in this case the field is a picklist, so a select input is generated to allow the user to choose one of the defined picklist values.