• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

Controllers

Controllers in Salesforce

Using S.Control’s for UI (User Interface)

The tool that allows application developers to display custom links (HTML) in a detail page or custom tab, this provides more flexibility for the fields and page layouts. But

  • Executes from within a browser, causing poor performance if displaying or updating values for more than a few records at a time.
  • Do not provide an easy way to give custom UI elements the same look-and-feel as standard SF pages.
  • Require developer to enforce field uniqueness and other metadata dependencies on their own.

Note: S.control’s are suppressed by VF pages (Visual Force).After March 2010 organizations that have never created S.Control’s as well as new organizations, won’t be allowed to create them

Existing S.Control’s will remain and can still be edited.

These are the reasons why VF pages came in to existence; these are next generation solutions for building sophisticated user interfaces on the Force.com platform.

What is Visulal Force?

VF is a frame work that allows developers to build sophisticated, custom user interfaces that can be hosted natively on the Force.com platform. This includes a tag based markup language, similar to HTML.
In VF markup language each VF tag corresponds to a coarse or fine-gained users interface components such as

  • Section of page
  • A related list or a field

The behavior of VF components can be controlled by the same logic that is used in standard SF pages, or developer can associated their own logic with a controller class written in APEX.

Inclined to build a profession as Salesforce APEX Developer? Then here is the blog post on 
Salesforce Training and Certification.

EX:-

Tag in VF are <apex:page>
 <apex:page Block>
 <apex:page Block Buttons>
 <apex: page Block section>
 ` <apex:page Block section Item>
 <apex:page Block Table> ------> Tags related to a page tags

Input field tags:

<apex:inputcheckbox>
<apex:inputField>
<apex:input File>
<apex:inputHidden>
<apex:inputsecret>
<apex:input text >
<apex:input text area>

Select tags:

<apex:selectioncheckbox>
<apex:Selection list>
<apex:selectoption>
<apex:select options>
<apex:select Radio>
<apex:variable>
<apex:vote>

Output field Tags:

<apex:output Field>
 <apex:output label>
 <apex:output link>
 <apex:output pannel>
 <apex:output text>

Like this there are around 90 tags in VF and each tag full fills request such as defining a page, page block field, toolbar these tags can be divided into

  • Input tags
  • Output tags
  • Select tags
  • Form tags
  • Page tags and so on…

Using these tags developers can create a VF page definition. It consists of two
primary elements.

VF Markup —> AVF —> Controller

VF Markup:

Visual force Markup consists of VF tags, HTML, JavaScript and many other web-enabled code embedded within a single <apex: page>tag. This defines the user interface components that should be include on the pages, and the way they should appear.

VF Controllers:

VF controller is a set of instructions that specifies what happens when a user interacts with UI components specified by VF markup, (such as when user clicks on the button on link).controller also provides access to the data that should be displayed on the page, and can modify component behavior.

A developer can use a standard controller consists of the same functionality and logic that is used for a standard salesforce page.

Note: If we use the standard Account controller, clicking a save button in VF page results in same behavior as clicking save button on Account edit page Using page layouts, we cannot have access to the objects in standard field, and display’s an error called as insufficient privileges error message, we can avoid this by checking the user’s accessibility for an object and displaying component approximately.

  • A standard list controller enables us to create VF pages that can display an act on a set of records like list pages, related lists, and mass action pages.
  • Custom controller: it’s a class written in Apex that implements all page’s logic, without leveraging a standard controller, if we define this, we have to define new navigation elements or behaviors, but we must implement any functionality that was already provided in a standard controller.
  • Controller extension: class written in Apex that adds to or overrides behavior in a standard or custom controller.

Extensions allow us to leverage the functionality of another controller while adding your own logic.

Visual Pages Force can be used:

Developer can use VF pages to

  • Override standard buttons, such as NEW button for accounts, save button for contacts…..
  • Define custom tab.
  • Embed components in detail page layout.
  • Create dashboard components on custom help pages.
  • Customize, extend on integrate the sideboards in the services cloud console (custom console components)

For indepth understanding on Salesforce click on

Summary
Review Date
Reviewed Item
Controllers in Salesforce
Author Rating
4

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on Controllers"

    Leave a Message

    Your email address will not be published. Required fields are marked *

    Site Disclaimer, Copyright © 2016 - All Rights Reserved.

    Support


    Please leave a message and we'll get back to you soon.

    I agree to be contacted via e-mail.