Standard & Custom Controller in Salesforce


What are the controllers and their types?

Salesforce controllers, also known as Visualforce controllers, are used to execute a set of instructions. Controllers specify what happens when a user interacts with the Visualforce Markup components such as Visualforce tags, HTML, fields, etc. When a user clicks on a button or link on a Visualforce page, the associated controllers will display the data related to the user action or component. The controllers have the ability to modify component behavior. They work on an MVC(Model-View-Controller) approach. Salesforce provides the below types of controllers.

  • Standard controllers
  • Standard List Controllers 
  • Custom Controllers

Wish to make a career in the world of salesforce? Start with HKR’S  salesforce online training !

1.Standard controllers

The standard controllers are the default controllers provided by Salesforce. They contain the same logic and functionality that are used for standard Salesforce pages. Every Salesforce object contains a standard controller that can be queried using the Salesforce Lightning Platform API. When a user interacts with a component on the page, the controller interacts with the database, fetches the relevant data, and displays it on the page. To display the relevant data on the Visualforce page, we need a record ID. So, we need to send an ID as a query string parameter in the page URL. The standard controller has a getter method that returns the record related to the query ID. If a user doesn’t have access to a certain object (or component) on the page, which is associated with a standard controller, it will display an insufficient privileges error message to the user. 

Associating a standard controller with a Visualforce page

To associate a standard controller to a Visualforce page, we have to use the “standardController” attribute on the tag. We should specify the name of any Salesforce object, which can be queried using the Lightning Platform API. Here is the syntax to associate a standard controller to a standard object on a page,

Salesforce Training

  • Master Your Craft
  • Lifetime LMS & Faculty Access
  • 24/7 online expert support
  • Real-world & Project Based Learning

2.Standard List Controllers

Standard list controllers are used for displaying or act on a set of records on the Visualforce pages. Related lists, list pages, and mass action pages are some of the examples of Salesforce pages that work with a set of records. The following are the objects that can be used with standard list controllers.

  • Account
  • Contract
  • Idea
  • Order
  • Product2
  • Solution
  • User
  • Lead
  • Opportunity
  • Asset
  • Campaign
  • Case
  • Contact
  • Custom objects

Associating a standard list controller with a Visualforce page

Associating a standard list controller is very much similar to associating a standard controller. In the standard list controller, we can set an object through the “standardController” attribute on the tag and then set the recordSetVar attribute on the same component. Here is the syntax to associate a standard list controller with an object on a page,

Once the standard list controller is associated, we can act on a set of records using expression language syntax. We can use a standard list controller to add pagination to a page with the help of the next and previous actions.

Cloud Technologies, salesforce-controllers-description-0, Cloud Technologies, salesforce-controllers-description-1

Subscribe to our YouTube channel to get new updates..!

3.Custom Controllers

Custom controllers are used to implementing custom logic and data manipulation for a Visualforce page. If we want to perform things like calling an external web service, validate and insert data, we can use a custom controller. The custom controllers override the existing functionality and implement customized navigation through an application. They execute entirely in system mode and users will have full control over the app’s logic. 

Create a Visualforce page that uses a custom controller

To add a custom controller to a Visualforce page, we have to set the “controller” attribute in the tag. When we use a custom controller, we cannot use a standard controller. Here is the syntax to associate a custom controller to a Visualforce page,

Controller Extensions

A controller extension overrides behavior in a standard or custom controller. Any Apex class with a constructor that takes a single argument of type “ApexPages” is referred to as a controller extension. We can implement the functionality of another controller to an apex tag while adding custom logic. Here is an example class for controller extension.


public class myControllerExtension {

//custom code

}

We can extend this controller extension on a Visualforce page like below.
Both the controller extension and custom controller use the action, getter, and setter methods. The custom controllers and controller extension classes ignore user permissions and field-level security as they execute in system mode. So, the custom controllers and controller extensions are mainly used to set organization-wide defaults. Based on the user profile, we can even define whether a user can execute methods in a custom controller or controller extension class. 

Salesforce Training

Weekday / Weekend Batches

Conclusion

Apex is a complete programming language that we can use to implement effective Visualforce pages. We can use Apex properties, which are a combination of a variable with getter and setter methods. We can implement anything on a Visualforce page with the help of controllers in Apex code. Using controllers, we can implement features like dropdown on a Visual page. They allow you to filter the records displayed on the page. While working with controllers, you should have an eye out for validation rules. You should be able to handle the validation rule exceptions. 

Related Articles:



Source link

Leave a Reply

Subscribe to Our Newsletter

Get our latest articles delivered straight to your inbox. No spam, we promise.

Recent Reviews


NetSuite for Dummies – Table of Content

What is NetSuite?

NetSuite provides software and services for companies to manage the business process like financial planning, operations, customer relations, etc. It was established in the year 1998 by Evan Goldberg. NetSuite is mostly suitable for small and medium-sized businesses. It offers consolidated CRM, ERP, e-commerce features, etc. It handles all processes, basic to critical, from a single platform. 

NetSuite is available to set up locally and as well as offered as an online service. We can create any type of complex workflows easily. It can streamline business processes and scale business to new heights. It takes in business unique requirements and creates real-time dashboards with reports, forecasting, etc. It comes with a drag-and-drop feature so that users can customize their homepage according to their needs.

NetSuite can scale effortlessly to meet the growing needs of a company. It offers services for both business-to-consumer and business-to-business companies. With its unique features, it connects full customer-facing capabilities. 

Want to Become a Master in Netsuite? Then visit here to Learn Netsuite Training

Features of NetSuite

The following are the most important features of NetSuite.

Financial management – It makes it easy to access live financial data that links between accounting and compliance management.

Order Management – It improves cash flow, reduces shipping costs, on-time delivery, and can integrate with CRM.

Sales Order and Returns Management – It lets you access the data of scheduling, tracking, approving, and handling returns through visualizations.

Production Management – It enables users to manage global manufacturing operations.

Warehouse and Order Fulfillment – It provides real-time order updates like inbound and outbound logistics and inventory management.

Shared Database – NetSuite consists of different modules that share a common database. 

Top 30 frequently asked Netsuite Interview Questions !

Collaboration – It establishes instant contact via email and also through web service or REST APIs.

Employee Center – The status of employee benefits, organization hierarchy, and vital information can be viewed through a dashboard.

Governance, Risk, and Compliance – It addresses risk issues through automated processes.

Netsuite Training

  • Master Your Craft
  • Lifetime LMS & Faculty Access
  • 24/7 online expert support
  • Real-world & Project Based Learning

Benefits of NetSuite

Here are some of the main benefits of NetSuite.

  • It is a one-stop solution for all business processes. So the users don’t have to switch between systems.
  • It offers dashboards that are easily customizable and show statistics that are relevant to them.
  • Since it’s available in the cloud, small and medium-sized companies don’t have to worry about setting up the infrastructure.
  • It can scale both horizontally and vertically to grow business.
  • It can be accessed 24/7 from anywhere.
  • It drastically reduces implementation risk.
  • It has increased user adoption across the globe.
  • It strengthens the long-term ownership.
  • It produces faster time to value.
  • NetSuite comes with two large upgrades every year.
  • It is a highly secure platform and helps keep your data safe.

Servers/Products of NetSuite

NetSuite offers various products or services to meet the needs of an organization in various verticals. Here is the list of products,

  • Enterprise Resource Planning (ERP) 
  • Customer Relationship Management (CRM) 
  • Human Capital Management (HCM) 
  • SuiteCommerce 
  • Professional Service Automation (PSA)
  • SuiteSuccess
  • Global Business Management
  • SuiteAnalytics

Related Article: Netsuite ERP modules

Enterprise Resource Planning (ERP) 

NetSuite has a capable ERP solution on the cloud that is suitable for fast-growing companies. It gives a clear view and control of their business. It encompasses several areas of any business, which include project management, order management, inventory, employee management, and accounting. The accounting features include banking, journal entries, revenue recognition, taxes, etc. 

It has planning, budgeting, and forecasting solution that makes the planning process easy. Using NetSuite ERP, companies can streamline their processes, making time for the employees to accelerate growth. It provides real-time visibility into production management processes. It enables companies to take faster and smarter decisions.

ERP Tools, netsuite-for-dummies-description-0, ERP Tools, netsuite-for-dummies-description-1

Subscribe to our YouTube channel to get new updates..!

Customer Relationship Management (CRM) 

NetSuite’s CRM provides a company with a 360-degree view of its customers, which elevates productivity. The flow of information is done seamlessly over the entire customer lifecycle. It delivers exceptional customer experience from lead generation to sales order, fulfillment, support, etc. NetSuite CRM also offers order management, commissions, sales forecasting, etc. It streamlines the lead-to-cash process flow.

The most important feature is forecasting. It can forecast sales which help in improving sales performance. It can manage global sales and services organizations. It combines traditional and modern CRM features to drive more value to the companies. 

Human Capital Management (HCM) 

NetSuite HCM, which is also known as SuitPeople, gives complete control of a company’s HR processes. It streamlines employee information, employee onboarding, payroll, compensations, etc., in a single platform. Employees can request time-off and can monitor the upcoming vacation schedules of the employees. An employee can also recognize a peer for good work. 

SuitPeople offers role-based security through which companies can allow only people up the hierarchy tree to access sensitive information. It makes sure that employees are effective, engaged, and motivated all the time. It can also show the data of workforce management processes in reports.

Related Article: Netsuite Administrator Guide

SuiteCommerce 

SuitCommerce is a unified e-commerce solution for back-office systems. It includes B2C commerce, B2C commerce, and order management, all in a single platform. It helps online businesses to grow to new heights. Companies can create unique and personalized mobile, web, and in-store experiences for their brand that surpass customer expectations. 

Using SuitCommerce, companies can provide personalized cross-channel experiences for customers across all touchpoints. This helps in target marketing and customer service. They can provide a single view of inventory over all the channels through centralized order management.  

Professional Service Automation (PSA)

With NetSuite’s Professional Services Automation solution, a company can manage the complete business process from bid to bill. It comes with numerous features, including project management, resource management, project accounting, billing, timesheet management, expense management, and analytics. These help manage projects, resources, and finances of a company.

It provides visibility into the services of a company. It improves resource utilization, streamlines billing, etc., to drive profits. It elevates resource utilization and ensures on-time project delivery. It enables Omni-business model billing for the services delivered. It provides control over revenue recognition.

Related Article: Netsuite Reporting Tools

SuiteSuccess

SuiteSuccess is a unified solution to the customer engagement model and business optimization methods. It is built to resolve critical challenges that have been a roadblock to a company’s growth. It provides a holistic approach through leading practices, KPIs, and agile methodology to adopt a product. It leads to faster time to value, improves efficiency, and brings customer success. 

Build, engage, consume, and optimize are the four key pillars of SuiteSuccess. The industry-leading best practices are already built into the system. It also provides built-in detailed business flows to specific industries. 

Global Business Management

Global Business Management, which is also known as OneWorld, is a business management platform for companies that manage multinational and multi-subsidiary operations. It improves operational efficiency by providing real-time visibility. Organizations can customize the solution to meet their corporate needs. It mainly focusses on addressing the needs of complex multinational and multi-company organizations.

It streamlines the complete services lifecycle to drive repeat business from existing clients with the help of OneWorld Services Resource Planning (SRP). OneWorld can manage multiple currencies, taxation rules, and reporting across different locations and provides financial consolidation.

[ Related Article: netsuite training ]

Netsuite Training

Weekday / Weekend Batches

SuiteAnalytics

SuiteAnalytics helps customers discover hidden information from their data that helps them in making business decisions. Users can create reports that answer complex questions easily. SuiteAnalytics is designed in such a way that an inexperienced user can perform tasks on complex data. Users can browse through their data, apply filters, and create visualizations on top of it. 

It includes artificial intelligence and machine learning-based capabilities that help the customer in understanding what might happen to their business in the future. It automates routine tasks that enable customers to make smarter and faster decisions.

Related Article: Netsuite Bundle

Conclusion

More than 21,000 customers are using NetSuite to manage their business processes. NetSuite can integrate with third-party applications with the help of an iPaaS solution like DBSync. It provides a customizable connector through which we can connect NetSuite with Salesforce, SkuVault, MySQL, Oracle, etc. The NetSuite comes with a subscription model that companies can use and can pay per use only. Companies can get a bundle of all the modules of NetSuite, or they can just pick the ones that they need and license them. With NetSuite, tailor your business processes to meet the requirements.



Source link