+ Start a Discussion

Custom or extended controller for standard page?

Is it possible to keep the standard page but extend or customize the standard controller? How would this be done?


The question is in general to learn to develop in force. The practical problem I'm facing right now is to set a default value to a a field relating to the user object.


Here is the code.



<apex:page standardcontroller = "Account" extension="myextn">
<apex:inputfield value="{!Account.Name}"/>

Public class myextn{
Public myextn(Apexpage.standardcontroller cnt){
  account a = (Account)cnt.getRecord();
  a.Name = 'DEFAULT VALUE';




Hi Hisrinu,


  The code snipet you provided is not appliable for a standard page (E.g. The edit page for the "Job Applications" example provided in the fundamentals tutorial).

  Is it possible to use a extension controller to a standard page?


Thanks in advance