Visualforce is a collection of commands that mention what takes place when a user communicates with the components mentioned in related visualforce markup. Controllers also facilitate access to data that is to be exhibited on a page and can change the behavior of the component. The Lightning platform enables a lot of standard controllers that comprise the same service logic that is employed for standard salesforce pages. Standard list controllers can be used with the following objects.
Visualforce uses Model-view-controller techniques to use the data; they are as follows:
1. Model
It comprises application data, and it does not contain the logic required for presenting the data.
2. View
It comprises the data of the model. View understands how to use the data of the model.
3. Controller
The Controller is present between the model and the view. It withholds the events that are invoked by the view and implements a suitable response to these events.
In Visualforce pages, we use a standard controller by using the “StandardController” attribute in the <apex: page> tag. We will not be able to use the controller attribute while implementing the “standard controller” method in the visual force pages.
Steps to create a visualforce page that implements and perceives the utility of the Standard controllers:
Example for Visualforce Page
The standard controller Actions are as follows:
1. Save: This action inserts a new record and updates a record if it is available. When this action is completed, the save action comes back to the starting page.
2. Quicksave: This action inserts a new record and updates an available record, and the “quicksave” does not divert users to the initial page.
3. Edit: Through this action, users can edit the page for the record that is available. When this task is completed, the edit action returns the user to the page.
4. List: It gives a Page reference object of the normal List page.
The page related to a standard controller systematically acquires the style which is used for regular salesforce pages related to the mentioned object. Pick the object that looks to be chosen. You can overrule the page styling that uses the standard Controller through the “tab style” property of the <apex: page> tag. For example :
<apex:page StandardController=” Mindmajix” tabstyle=”Python training”>
</apex:page>
Checkout Salesforce Interview Questions
If a user types data on a visualforce page that access a standard controller and that data induces a validation rule fault, the fault can be exhibited on the visualforce page. If the error location of the validation rule is at the top of the page, then we will utilise the <apex: pagemessage> or <apex:message> method under the <apex:page> to exhibit the error.
If a person has not enough permissions to see the object, the visual force page that employs a controller to make that object unapproachable, to evade this fault, you should assure that your components will only deliver if a user has entry to the object related to the Controller.
Through the statement, you can monitor the availability of an object like this:
{!object_Type. Object_name. available}
Conclusion
Visualforce uses standard controllers to control the data of the visual force page. Controllers communicate with the database and fetch the data from the database. By using the recordID, it will display a particular record and a bunch of records. In an Independent page, we are required to mention the ID of the record.
In the next topic, we will discuss in detail about “Custom Controller In Salesforce”. Keep following us for more info on Salesforce Development/Programming.
Are you looking to get trained on Salesforce, we have the right course designed according to your needs. Our expert trainers help you gain the essential knowledge required for the latest industry needs. Join our Salesforce Certification Training program from your nearest city.
Salesforce Training Chennai, Salesforce Training Dallas, Salesforce Training Bangalore, Salesforce Training Hyderabad, Salesforce Training Mumbai, Salesforce Training Delhi, Salesforce Training Noida, Salesforce Training New York, Salesforce Training Chicago, Salesforce Training Kolkata, Salesforce Training Gurgaon, Salesforce Training Pune.
These courses are equipped with Live Instructor-Led Training, Industry Use cases, and hands-on live projects. Additionally, you get access to Free Mock Interviews, Job and Certification Assistance by Certified Salesforce Trainers.
Mindmajix offers different Salesforce certification training according to your desire with hands-on experience on Salesforce Concepts :
Our work-support plans provide precise options as per your project tasks. Whether you are a newbie or an experienced professional seeking assistance in completing project tasks, we are here with the following plans to meet your custom needs:
Name | Dates | |
---|---|---|
Salesforce Training | Nov 23 to Dec 08 | View Details |
Salesforce Training | Nov 26 to Dec 11 | View Details |
Salesforce Training | Nov 30 to Dec 15 | View Details |
Salesforce Training | Dec 03 to Dec 18 | View Details |
Arogyalokesh is a Technical Content Writer and manages content creation on various IT platforms at Mindmajix. He is dedicated to creating useful and engaging content on Salesforce, Blockchain, Docker, SQL Server, Tangle, Jira, and few other technologies. Get in touch with him on LinkedIn and Twitter.