What is extension controller in Salesforce

Controller extension in Salesforce is an Apex class containing a constructor that is used to add or extend the functionalities of a Standard Controller or custom controller in Salesforce. Extension controller is also used to leverage the functionality of another controller using our own custom logic.

What are different types of controllers in Salesforce?

  • Apex Class.
  • Apex Controller.
  • Controller Extension.
  • Custom Controller.
  • Field Level Security.
  • Permissions.
  • Salesforce Apex.
  • Salesforce Visualforce.

What is Visualforce extension?

</apex:page>. Controller extension is the third type of controller which extends the behaviour of standard controller. Controller extensions are used to integrate visualforce page with native user interface. Controller extension can not override the functions of standard buttons.

What are the controllers in Salesforce?

Controllers typically retrieve the data to be displayed in a Visualforce page, and contain code that executes in response to page actions, such as a button being clicked. When you use the standard controller, a great deal of, well, standard functionality is provided for you by the platform.

What is an apex controller Salesforce?

Custom controller is an Apex class which is used to implement all the logic of Visualforce without leveraging the standard functionality. In Salesforce.com, Standard controllers provides all the functionalities that are required for Visualforce pages.

What is Visualforce controller in Salesforce?

Visualforce Controllers A Visualforce controller is a set of instructions that specify what happens when a user interacts with the components specified in associated Visualforce markup, such as when a user clicks a button or link.

What is difference between controller and extension in Salesforce?

Use custom controllers when you want your Visualforce page to run entirely in system mode, which does not enforce the permissions and field-level security of the current user. A controller extension is an Apex class that extends the functionality of a standard or custom controller.

What is difference between standard controller and custom controller?

The standard controller is auto geenrated by SF for all objects. Custom controllers are written by you and do what your code tells them to do.

How do I extend a standard controller in Salesforce?

use the custom object api name as value for this attribute. Also you have to set a name of apex class in the “extensions” attribute of <apex:page /> tag. By doing this you are extending the standard behaviour in the custom controller.

What is Ajax in Salesforce?

AJAX is the art of exchanging data between server and client without reloading the complete web page. Visualforce and AJAX. Visualforce has inbuilt support for the AJAX. using the attribute “rerender” we can specify that where the response should be rendered.

Article first time published on

When should you use controller extensions?

  1. You want to leverage the built-in functionality of a standard controller but override one or more actions, such as edit, view, save, or delete.
  2. You want to add new actions.
  3. You want to build a Visualforce page that respects user permissions.

What are standard controller custom controller and extensions?

std+extensions offers you the chance to put multiple apex classes (extensions is a list) on your page whereas a custom controlle is monolithic, all the code must be in one class. a standard controller will build a query and fetch the data (for you) that includes all the fields that you have placed on the page.

What is Visualforce pages in Salesforce?

Visualforce pages are basic building blocks for application developers. A Visualforce page is similar to a standard Web page, but includes powerful features to access, display, and update your organization’s data. Pages can be referenced and invoked via a unique URL, just as they would be on a traditional web server.

How many types of controllers are in a VF page?

There are three types: 1) Standard Controller – Let’s you access the standard functions (Save, Edit, Delete etc) of a standard or custom object. 2) Custom Controller – Let’s you add custom functionality by specifying an apex class that can define new functions for user actions (button clicks, link clicks etc).

What is getter and setter in Salesforce?

Hi, Get (getter) method is used to pass value from controller to VF page while set (setter) is used to set the value back to controller variable. Above two methods are same and will return same results.

What is custom list controller in Salesforce?

A custom list controller is similar to a standard list controller. Custom list controllers can implement Apex logic that you define to show or act on a set of records. The list of sObjects returned by getRecords() is immutable.

What is standard list controller in Salesforce?

The standard list controller allows you to create Visualforce pages that can display or act on a set of records. Displaying a list of records is a fundamental behavior of almost all web apps. Visualforce makes it extremely easy to display a list of records of the same type, using just markup, no back-end code.

Can we use both standard controller and custom controller together?

See below syntax to define extension. We can use Stnadard controller/ Custom Controller and extensions at a time. But we cannot use Standard controller & Custom controller at a time.

What are extension classes in Salesforce?

Controller extension in Salesforce is an Apex class containing a constructor that is used to add or extend the functionalities of a Standard Controller or custom controller in Salesforce. Extension controller is also used to leverage the functionality of another controller using our own custom logic.

What are standard controllers?

Standard controllers fetches data and provide to the views such as page, list, dialog or forms. Controlling data for a single record: One of the key functionality of standard controllers is to provide the data, and to facilitate binding a view’s controls to the records fields for either display or input.

What is Visualforce vs Lightning?

Visualforce assists in the creation of personalized user interfaces with native hosting as a platform that includes tag-based markup language and server-side controllers. Lightning is a cutting-edge user interface framework that helps developers create immersive web applications for both mobile and desktop devices.

What is Visualforce and Apex?

Visualforce is a component-based user interface (UI) framework that allows the development of strong and reusable interfaces. Apex is a platform for developing software as a service (SaaS) applications based on the CRM functionality of Salesforce.

What is difference between with sharing and without sharing in Salesforce?

Use With Sharing when the User has access to the records being updated via Role, Sharing Rules, Sales Teams – any sort of sharing really. Without sharing keyword: Ensures that the sharing rules of the current user are not enforced.

Can we use custom controller and extension in one VF page?

We can’t call multiple custom controllers on a VF Page, but we can call second controller while we have the first controller on VF page, and however you need to define your second controller as Extension rather as controller.

Can we use standard controller for custom object?

Yes, we can create standard controller for custom object in Salesforce, Its upto devlopers’ choice.

What is a wrapper class in Salesforce?

A wrapper or container class is a class, a data structure that contains different objects or collections of objects as its members. A wrapper class is a custom object defined by a programmer wherein he defines the wrapper class properties.

What are the different action tags in Salesforce?

  • actionFunction.
  • actionPoller.
  • actionRegion.
  • actionStatus.
  • actionSupport.
  • AJAX Action Tags.
  • AJAX Request.
  • Apex Controller.

What is the difference between system mode and user mode?

System mode means running apex code by ignoring user’s permissions. User mode means running apex code by respecting user’s permissions and sharing of records.

What is the difference between rendered and Rerender?

Render happens once, at first. Re-render can happen only after render, nth times. Render refers to rendering the content for the initial load. Re-render refers to re-rendering the content upon updating of props.

What is actionSupport in Salesforce?

A component that adds AJAX support to another component, allowing the component to be refreshed asynchronously by the server when a particular event occurs, such as a button click or mouseover.

What is Action Region in Salesforce?

actionRegion provides an area of a Visualforce page that decides and separates which components should be processed by the force.com server when an AJAX request is generated. Only the components which are inside actionregion component are processed by server, so it increases visualforce page performance.

You Might Also Like