You need to sign in to do that
Don't have an account?
Chidanand M
controller.getRecord();
Hello, friends
public Account ac{get;set;}
ac= (Account)controller.getRecord();
And
ac= new Account();
Are these both declaration produce the same difference??
I am getting the correct output for both the declaration?
Which one is correct??
Can anyone clear my doubt? M bit confused..
Visualforce
<apex:inputField value="{!ac.Site}"/>
<apex:inputField value="{!ac.Description}"/>
<apex:inputField value="{!ac.Name}"/>
public Account ac{get;set;}
ac= (Account)controller.getRecord();
And
ac= new Account();
Are these both declaration produce the same difference??
I am getting the correct output for both the declaration?
Which one is correct??
Can anyone clear my doubt? M bit confused..
Visualforce
<apex:inputField value="{!ac.Site}"/>
<apex:inputField value="{!ac.Description}"/>
<apex:inputField value="{!ac.Name}"/>
ac= new Account(); // Get a new sobject instance of account.
Visualforce:
<apex:page standardController="Account" extension="myController" >
<apex:inputField value="{!ac.Site}"/>
<apex:inputField value="{!ac.Description}"/>
<apex:inputField value="{!ac.Name}"/>
Both are corrected, depends on your needs. If you define as standardController in the visualforce page, then user controller.getRecord(); thefore you will take advantage of capturing parameters of the page as the id or other value stated on it.