Christmas Special : Upto 40% OFF! + 2 free courses  - SCHEDULE CALL

- Salesforce Blogs -

What is Standard Controller in Salesforce?

Introduction

Salesforce is one of the easiest, yet one of the trickiest technologies available in the market today. This is simply because in the back end it does deal with a few things that necessarily need a technical skill set to accomplish the tasks at hand. One such tricky thing to comprehend is the concept of Standard Controllers in Salesforce.

Today we would discuss what a standard controller in  Salesforce is? To understand the topic at hand better, we have divided the blog into the following parts- 

What is a Standard Controller in Salesforce?

Visualforce utilizes the conventional model– view– controller (MVC)paradigm and incorporates refined inherent controllers to deal with standard activities and information access handles, furnishing basic and tight integration with the Lightning Platform database. These implicit controllers are referred to by and large as standard controllers, or even the standard controller.

The MVC configuration design makes it simple to isolate the view and its styling from the basic database and rationale. In MVC, the view (the Visualforce page) associates with a controller, and the controller gives usefulness to the page. For instance, the controller can contain the rationale to be executed when a link is clicked. A controller likewise regularly associates with the model (the database)— making available the information that the view s needs to show, or driving changes back to the database. salesforce Curriculum Most of the standard and every custom object have standard controllers that can be utilized to collaborate with the information related to the question, so you don't have to compose the code for the controller yourself. You can stretch out the standard controllers to include new usefulness, or make custom controllers without any preparation.

Take our online Salesforce training course and become an expert on Salesforce in no time.

Salesforce Training For Administrators & Developers

Read: Apex:Actionfunction In The Salesforce VisualForce Page
  • No cost for a Demo Class
  • Industry Expert as your Trainer
  • Available as per your schedule
  • Customer Support Available

What Does a Standard Controller in Salesforce Do?

The collaboration between a client and their business information can be straight forward or complex, yet in any case, it requires a point by point set of guidelines and standards to be overseen. The controller is the object that gives such an administration while saving a perfect detachment between the view layer and the information model.

In the MVC design, Views know how to show their information and acknowledge the contribution from the client, however, they may know nothing about how to really bring that information or process it. Information Models know how to perform different tasks, for example, Save, Delete or Merge, however, should be advised when to work, and should be furnished with the requisite information to work on.

It is the Controller’s job to marshal both data and action selection, as initiated by the user from within the View, to the Model. Controllers are also responsible for responding accordingly with navigation redirection based on the results of any particular action. In the Salesforce MVC paradigm, it is the standard controller that facilitates the ability of users to access and interact with the structured business data contained in records and displayed in the materialized user interface. salesforce quiz It is the Controller's business to marshal both the information and the activity choice, as stated by the client from inside the View, to the Model. Controllers are additionally in charge of reacting appropriately with route redirection in view of the consequences of a specific activity. In the Salesforce MVC worldview, it is the standard controller that encourages the capacity of clients to get to and communicate with the organized business information contained in records and displayed in the appearing UI.

A standard controller's main tasks are as follows:

  • Controlling Data: Standard controllers bring information and give it to the page, list, discourse or shape, all are referred to as perspectives. While it is the view's task to deal with the introduction of its information, the controller accumulates the information from the view as entered or changed by a client, and passes it to the information demonstrated for handling.
  • Controlling Actions: Standard controllers react to the client or automatic orders started from a view. Such summons, generally referred to as Actions, may be related with handling the information accumulated from the view, or essentially to react to a navigational link.
  • Controlling Navigation: Standard controllers navigate the client to a particular view related to an activity. They likewise handle redirection to resulting views, in light of the particular result of different activities and information tasks.

Developers may expect that they should turn to the usage of custom Apex rationale to give complex usefulness that their applications require, yet may be ignorant about the fact that such use may as of now be accessible to them in Visualforce by means of standard controller components. free salesforce demo It is a best practice to ensure that you comprehend what is accessible to use in the standard controller layer before you start to outline and manufacture your own particular custom pages and controllers to abstain from 'reinventing the wheel.'

Standard Controller Methods

Read: What is Salesforce Field Service Lightning and Why is it So Popular?

Standard Controller Methods

The accompanying are methods for Standard Controller. All are instance methods-

  • addFields(fieldNames) - At the point when a Visualforce page is loaded, the fields available to the page depending on the fields referenced in the Visualforce mark-up. This method adds a reference to each field indicated in fieldNames with the goal that the controller can unequivocally get to those fields too.
  • cancel() - Returns the Page Reference of the drop page.
  • delete() - Erases records and returns the Page Reference of the erased page.
  • edit() - Returns the Page Reference of the standard alter page.
  • getRecord() - Returns the record that is currently in setting, in view of the estimation of the id inquiry string parameter in the Visualforce page URL.
  • reset() - Powers the controller to reacquire access to recently referenced fields. Any progressions made to the record before this strategy call is disposed of automatically.
  • save() - Saves changes and returns the refreshed Page Reference.
  • view() - Returns the Page Reference object of the standard detail page.

Learn Salesforce in the Easiest Way

  • Learn from the videos
  • Learn anytime anywhere
  • Pocket-friendly mode of learning
  • Complimentary eBook available

Tips for Using Standard Controller Actions in Salesforce

Activity methods perform logic or route when a page event happens, for example, when a client clicks on a tab, or is hovering over a region of the page. Activity strategies can be called from page markup by utilizing {!} documentation in the action parameter of one of the accompanying tags:

  • <apex:commandButton> This command creates a tab that calls an action method
  • <apex:commandLink> This command is used to create a link that calls an action
  • <apex:actionPoller> You can use this command to periodically call an action
  • <apex:actionSupport> This command makes an event (such as “onclick”, “onmouseover”, and so on) on another, named component, call an action
  • <apex:actionFunction> This particular command defines a new type of JavaScript function that calls an action
  • <apex:page> This particular command calls action in the Salesforce environment when the page is loaded

How to use Standard Controllers in Visualforce pages?

To utilize Standard Controller in Visualforce pages, the Standard Controller attribute must be utilized on <apex:page> tag. While executing standard controller property in Visualforce pages, we cannot utilize the controller attribute simultaneously. These Standard controllers can control the information, can control activities and control navigation.

Steps for using standard controller attribute on the Visualforce page?

Here in this particular section, let us learn how you can create a visualforce page to execute & also understand the basic functionality of the standard controller attribute.

Read: What Is Salesforce? And What Is Salesforce Used For?
  • The very first step in this exercise is to log in to your Saleforce.com account using username and passwords.
  • The next steps is to go to the given Url and then add apex/visualforce page name as is shown below.
  • You can see that as there is no visualforce page with the name of Standardcontrollers is created in the Salesforce, so the Visualforce error is displayed in order to create a new page in visualforce.
  • Click on the above link to create a visualforce page.

Take a free demo session on our Salesforce training course. Register here!

Salesforce Training For Administrators & Developers

  • Personalized Free Consultation
  • Access to Our Learning Management System
  • Access to Our Course Curriculum
  • Be a Part of Our Free Demo Class

Conclusion

I believe by now it is clear what is controller in Salesforce?Standard Controller in Salesforce is of great use provided you know how to use it properly. It can easily save you a lot of trouble and coding as can be seen from the uses of the standard controller portion of this blog. I am sure that using the Standard Controller in Salesforce can easily increase your efficiency on the Salesforce system.



Salesforce Tutorial Overview

fbicons FaceBook twitterTwitter lingedinLinkedIn pinterest Pinterest emailEmail

     Logo

    JanBask Training

    A dynamic, highly professional, and a global online training course provider committed to propelling the next generation of technology learners with a whole new way of training experience.


  • fb-15
  • twitter-15
  • linkedin-15

Comments

Trending Courses

Cyber Security Course

Cyber Security

  • Introduction to cybersecurity
  • Cryptography and Secure Communication 
  • Cloud Computing Architectural Framework
  • Security Architectures and Models
Cyber Security Course

Upcoming Class

2 days 21 Dec 2024

QA Course

QA

  • Introduction and Software Testing
  • Software Test Life Cycle
  • Automation Testing and API Testing
  • Selenium framework development using Testing
QA Course

Upcoming Class

1 day 20 Dec 2024

Salesforce Course

Salesforce

  • Salesforce Configuration Introduction
  • Security & Automation Process
  • Sales & Service Cloud
  • Apex Programming, SOQL & SOSL
Salesforce Course

Upcoming Class

0 day 19 Dec 2024

Business Analyst Course

Business Analyst

  • BA & Stakeholders Overview
  • BPMN, Requirement Elicitation
  • BA Tools & Design Documents
  • Enterprise Analysis, Agile & Scrum
Business Analyst Course

Upcoming Class

8 days 27 Dec 2024

MS SQL Server Course

MS SQL Server

  • Introduction & Database Query
  • Programming, Indexes & System Functions
  • SSIS Package Development Procedures
  • SSRS Report Design
MS SQL Server Course

Upcoming Class

8 days 27 Dec 2024

Data Science Course

Data Science

  • Data Science Introduction
  • Hadoop and Spark Overview
  • Python & Intro to R Programming
  • Machine Learning
Data Science Course

Upcoming Class

1 day 20 Dec 2024

DevOps Course

DevOps

  • Intro to DevOps
  • GIT and Maven
  • Jenkins & Ansible
  • Docker and Cloud Computing
DevOps Course

Upcoming Class

2 days 21 Dec 2024

Hadoop Course

Hadoop

  • Architecture, HDFS & MapReduce
  • Unix Shell & Apache Pig Installation
  • HIVE Installation & User-Defined Functions
  • SQOOP & Hbase Installation
Hadoop Course

Upcoming Class

1 day 20 Dec 2024

Python Course

Python

  • Features of Python
  • Python Editors and IDEs
  • Data types and Variables
  • Python File Operation
Python Course

Upcoming Class

2 days 21 Dec 2024

Artificial Intelligence Course

Artificial Intelligence

  • Components of AI
  • Categories of Machine Learning
  • Recurrent Neural Networks
  • Recurrent Neural Networks
Artificial Intelligence Course

Upcoming Class

1 day 20 Dec 2024

Machine Learning Course

Machine Learning

  • Introduction to Machine Learning & Python
  • Machine Learning: Supervised Learning
  • Machine Learning: Unsupervised Learning
Machine Learning Course

Upcoming Class

8 days 27 Dec 2024

 Tableau Course

Tableau

  • Introduction to Tableau Desktop
  • Data Transformation Methods
  • Configuring tableau server
  • Integration with R & Hadoop
 Tableau Course

Upcoming Class

1 day 20 Dec 2024

Search Posts

Reset

Receive Latest Materials and Offers on Salesforce Course

Interviews