Ajax (1) Apex Class (12) Apex Trigger (2) Community (2) Home Page (1) HTML (4) Integration (3) JS (7) KB (1) Label (1) Licenses (1) Listing (1) Log (1) OOPs (5) Sharing (1) Static Resource (1) Test Class (3) URI (1) Visualforce (10)

Wednesday, 5 March 2014

StandardController Methods and Constructors

StandardController Methods

The following are methods for StandardController. All are instance methods.

  • addFields(List<String>) 
    When a Visualforce page is loaded, the fields accessible to the page are based on the fields referenced in the Visualforce markup. This method adds a reference to each field specified in fieldNames so that the controller can explicitly access those fields as well.
  • cancel() 
    Returns the PageReference of the cancel page.
  • delete() 
    Deletes record and returns the PageReference of the delete page.
  • edit() 
    Returns the PageReference of the standard edit page.
  • getId() 
    Returns the ID of the record that is currently in context, based on the value of the id query string parameter in the Visualforce page URL.
  • getRecord() 
    Returns the record that is currently in context, based on the value of the id query string parameter in the Visualforce page URL.
  • reset() 
    Forces the controller to reacquire access to newly referenced fields. Any changes made to the record prior to this method call are discarded.
  • save() 
    Saves changes and returns the updated PageReference.
  • view() 
    Returns the PageReference object of the standard detail page

StandardController Constructors

The following are constructors for StandardController.

  • StandardController(SObject) 
    Creates a new instance of the ApexPages.StandardController class for the specified standard or custom object.

No comments:

Post a Comment