Saturday, October 6, 2018

Standard controller in visualforce

Standard Controller: 

You can refer standard or custom objects inside standard controller but you cannot refer apex class.
Most standard and all custom objects have Standard controller. Standard controller and its extensions works in user mode.Standard controller reference pre-built visualforce controller provided by salesforce so we do not need to write apex code.We can extends standard controller by using extension controller.

With standard controller you can use standard actions:
create,edit,delete,save with button or link as used in below exmaple.

Syntax:

standardController="Account" or any object.

Sample visualforce page to create a account:


<apex:page standardController="Account">

<apex:form >

Enter name of account....
<apex:inputField value="{!account.name}"/>
<apex:commandButton action="{!save}" value="Submit Account"/>


</apex:form>

</apex:page>

**************************************************************************************************************

No comments:

Post a Comment