In this module, you create a Visualforce page to provide a custom user interface for creating and editing speakers.
In the Developer Console, select File > New > Visualforce Page, specify SpeakerForm as the page name and click OK
Implement SpeakerForm as follows:
<apex:page standardController="Speaker__c">
<apex:form >
<apex:pageBlock title="Edit Speaker">
<apex:pageBlockSection columns="1">
<apex:inputField value="{!Speaker__c.First_Name__c}"/>
<apex:inputField value="{!Speaker__c.Last_Name__c}"/>
<apex:inputField value="{!Speaker__c.Email__c}"/>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
Save the file
Test the Visualforce page. There are several ways you can test your Visualforce page. For example, you can:
In this step, you set the SpeakerForm page as the default form for creating and editing speakers:
In Setup, select Build > Create > Objects and click the Speaker link
Scroll down to the Buttons, Links, and Actions section, and click Edit next to New
Check Override With Visualforce Page, and select SpeakerForm
Click Save
In the Buttons, Links, and Actions section, click Edit next to Edit
In Override With select Visualforce Page and select SpeakerForm
Click Save
Click the Speakers Tab
Click New which should display your Visualforce page
Create a new Speaker and select Save
At this stage, the Visualforce page doesn't provide any additional capability compared to the default speaker form. In the next module, you will enhance SpeakerForm to support the upload of the speaker's pictures.