Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

How Can You Access Visualforce Components Values Into A Javascript?

Answer»

Using Component GLOBAL variable, we can ACCESS visualforce COMPONENTS in javascript. Let us suppose, we want to use id of an apex field with id=”afield”.

So, we can use the {!$Component.afield} SYNTAX to use PROPERTIES of the field in javascript.

Let us suppose, we want to store the field’s value in java script, then we can use like below:

<script>

Var a =’ document.getElementById('{!$component.afield}').value’;

</script>

Using Component global variable, we can access visualforce components in javascript. Let us suppose, we want to use id of an apex field with id=”afield”.

So, we can use the {!$Component.afield} syntax to use properties of the field in javascript.

Let us suppose, we want to store the field’s value in java script, then we can use like below:

<script>

Var a =’ document.getElementById('{!$component.afield}').value’;

</script>

2.

What Are The Global Key Words?

Answer»

We have global keywords like component,User,url,current page etc., to access various values from components on page, from user object or from url or from current page FIELDS. To access value from each SOURCE, we have DIFFERENT global keywords. ONE such keyword is explained in above question(!$component)

Various global keywords are:

  • URL
  • USER
  • PROFILE
  • RESOURCE
  • Component
  • Current page
  • Page reference etc.

We have global keywords like component,User,url,current page etc., to access various values from components on page, from user object or from url or from current page fields. To access value from each source, we have different global keywords. One such keyword is explained in above question(!$component)

Various global keywords are:

3.

What Is The Purpose Of Creating Attributes On Components?

Answer»

By ALLOWING the COMPONENT to take parameters via an ATTRIBUTE, you can MAKE the component more FLEXIBLE and reusable

By allowing the component to take parameters via an attribute, you can make the component more flexible and reusable

4.

How Can You Create Partial Page Refreshes?

Answer»

Basically, you need to define the SECTION of the page that is going to REFRESH (typically with a panel of sorts), and then define the EVENT that will CAUSE the refresh. The METHOD changes depending on if the area being refreshed is the same as the one handling the event. It also depends on if you are just processing something on the server, or if you need the UI to change.

Basically, you need to define the section of the page that is going to refresh (typically with a panel of sorts), and then define the event that will cause the refresh. The method changes depending on if the area being refreshed is the same as the one handling the event. It also depends on if you are just processing something on the server, or if you need the UI to change.

5.

What Are The Different Ajax Action Tags? What Does Each Do?

Answer»

actionStatus: used to DISPLAY start and stop statuses of AJAX requests.

actionSupport: used to call a second component when an event happens to the first component.

actionPoller: similar to actionSupport, but the event is based on a timer instead of a user action.

actionFunction: provides support for invoking a controller action from JavaScript code using an AJAX REQUEST by defining a NEW JavaScript function.

actionRegion: used to demarcate which PARTS of the PAGE the server should reprocess.

actionStatus: used to display start and stop statuses of AJAX requests.

actionSupport: used to call a second component when an event happens to the first component.

actionPoller: similar to actionSupport, but the event is based on a timer instead of a user action.

actionFunction: provides support for invoking a controller action from JavaScript code using an AJAX request by defining a new JavaScript function.

actionRegion: used to demarcate which parts of the page the server should reprocess.

6.

What Is The Purpose Of &lt;script&gt; Tags?

Answer»

Script tags allow you to create JavaScript (or other TYPES) FUNCTIONS that can be USED within your PAGES

Script tags allow you to create JavaScript (or other types) functions that can be used within your pages

7.

What Is Ajax Typically Used For In Visualforce?

Answer»

AJAX is primarily used for partial page updates in Visualforce. In s-controls, the AJAX TOOLKIT was the soap (XML over HTTP) client that GAVE you access to the force.com WEB Services API.

AJAX is primarily used for partial page updates in Visualforce. In s-controls, the AJAX toolkit was the soap (XML over HTTP) client that gave you access to the force.com Web Services API.

8.

What Are Some Examples Of Javascript Events?

Answer»

Onmouseover, ONCLICK ETC.

Onmouseover, onclick etc.

9.

Which Tags Should Be Used To Automatically Bring In The Salesforce Label And Default Widget For A Field?

Answer»

pageblock

pageblock

10.

There Are A Series Of Layout Components That All Help Recreate The Traditional Salesforce Page Layout Style Very Easily. What Name Do They Share?

Answer»

pageBlock.

pageBlock.

11.

How Many Controllers Can A Page Have? Where Is The Controller For A Page Assigned?

Answer»

One main controller (of course, it COULD have extensions or custom COMPONENTS could have CONTROLLERS, etc.). The controller is assigned in the <apex:PAGE> TAG.

One main controller (of course, it could have extensions or custom components could have controllers, etc.). The controller is assigned in the <apex:page> tag.

12.

Which Tag Is Used With Both Radio Buttons And Picklists To Create The Selectable Values?

Answer»

&LT;APEX:selectoption&GT; TAG

<Apex:selectoption> tag

13.

What Is The Main Difference Between Using Datatable Vs. Pageblocktable Tags?

Answer»

PageBlock: For DEFAULT salesforce standard format.

DATATABLE:To design customformats

PageBlock: For default salesforce standard format.

dataTable:To design customformats

14.

What Are Three Types Of Bindings Used In Visualforce? What Does Each Refer To?

Answer»
  • DATA BINDINGS refer to the data set in the controller. 
  • Action bindings refer to action methods in the controller. 
  • COMPONENT bindings refer to other VISUALFORCE components

15.

What Are Attributes? What Is The Syntax For Including Them?

Answer»

ATTRIBUTES are modifiers to the MAIN tag that BELONG after the tag name in the START tag. The SYNTAX is attributeName=“attributeValue”

Attributes are modifiers to the main tag that belong after the tag name in the start tag. The syntax is attributeName=“attributeValue”

16.

Is It Always Necessary To Know Apex To Create Visualforce Pages? When Does It Become Necessary?

Answer»

No, it is not always necessary. You can use standard controllers and VF component tags to accomplish QUITE a bit. Apex becomes necessary when you need either a custom set of data or custom ACTIONS to be available from the PAGE.

No, it is not always necessary. You can use standard controllers and VF component tags to accomplish quite a bit. Apex becomes necessary when you need either a custom set of data or custom actions to be available from the page.

17.

What Are The Ways That Visualpages Can Be Incorporated Into The Rest Of Your User Interface?

Answer»

Basically, VIA links, BUTTONS, TABS, and inline frames.

Basically, via links, buttons, tabs, and inline frames.

18.

What Do {!expressions} Refer To When Used In Visualforce Components?

Answer»

Expressions refer to either data or ACTIONS that are made available to the PAGE from the CONTROLLER

Expressions refer to either data or actions that are made available to the page from the controller

19.

What Kind Of Content Can Be Included In A Visualforce Page?

Answer»

Any CONTENT that can be rendered in a BROWSER (HTML, JAVASCRIPT, ETC.).

Any content that can be rendered in a browser (HTML, JavaScript, etc.).

20.

When Is A Component Controller Required For Custom Components?

Answer»

A COMPONENT CONTROLLER is required when business logic is required to decide how to RENDER the component.

A component controller is required when business logic is required to decide how to render the component.

21.

What Are The Effects Of Using The Transient Key Word?

Answer»

The TRANSIENT key WORD prevents the data from being saved into the VIEW STATE. This should be used for very temporary VARIABLES.

The transient key word prevents the data from being saved into the view state. This should be used for very temporary variables.

22.

How Are Wizard Controllers Different From Other Controllers?

Answer»

The two main ISSUES is that they MUST handle multiple PAGES and they must maintain the STATE across those pages.

The two main issues is that they must handle multiple pages and they must maintain the state across those pages.

23.

What Are Some Apex Classes That Are Commonly Used Within Controllers?

Answer»

StandardController, SelectOption, PageReference, MESSAGE, ETC.

StandardController, SelectOption, PageReference, Message, etc.

24.

In What Order Do Methods Fire Within A Controller?

Answer»

The only rule is that SETTERS fire before action METHODS. ASIDE from that, there is no GUARANTEED order.

The only rule is that setters fire before action methods. Aside from that, there is no guaranteed order.

25.

Why Are Properties Helpful In Controllers?

Answer»

PROPERTIES can automatically CREATE STANDARD getters and setters while STILL allowing for their customizations. They save you from both writing the tedious code and reading the clutter when reviewing code.

Properties can automatically create standard getters and setters while still allowing for their customizations. They save you from both writing the tedious code and reading the clutter when reviewing code.

26.

What Identifies A Controller As Being An Extension?

Answer»

The CONTROLLER MUST declare a constructor which takes another controller EXPLICITLY

For EXAMPLE:

public myControllerExtension(ApexPages.StandardController stdController)

{

this.acct = (Account)stdController.getRecord(); 

}

The controller must declare a constructor which takes another controller explicitly. 

For example:

public myControllerExtension(ApexPages.StandardController stdController)

{

this.acct = (Account)stdController.getRecord(); 

}

27.

Compare And Contrast Custom Controllers And Controller Extensions. How Are They The Same? How Are They Different?

Answer»

Both ALLOW for custom code to be used, allowing for custom data sets and custom actions. EXTENSIONS leverage the existing data and actions within a standard or custom controller. Custom controllers must CONTAIN all data and actions that need to be executed by the page. Extensions that extend standard controller allow for the PAGES which use those extensions to be used in custom buttons, standard button overrides, and over declarative features.

Both allow for custom code to be used, allowing for custom data sets and custom actions. Extensions leverage the existing data and actions within a standard or custom controller. Custom controllers must contain all data and actions that need to be executed by the page. Extensions that extend standard controller allow for the pages which use those extensions to be used in custom buttons, standard button overrides, and over declarative features.

28.

When Do You Need To Go Beyond A Standard Controller And Code Custom Apex?

Answer»

If you NEED data beyond the limits of what is available in the standard controller or ACTIONS that GO beyond the PROVIDED standard actions.

If you need data beyond the limits of what is available in the standard controller or actions that go beyond the provided standard actions.

29.

What Is Included With Each Standard Controller?

Answer»

Data: the FIELDS for the ASSOCIATED object record that are API accessible, including the related records (5 up/1 down). 

ACTIONS: save, delete, VIEW, EDIT, cancel.

Data: the fields for the associated object record that are API accessible, including the related records (5 up/1 down). 

Actions: save, delete, view, edit, cancel.

30.

Which Objects Have Associated Standard Controllers?

Answer»

All STANDARD and custom OBJECTS that can be ACCESSED via the API have associated CONTROLLERS

All standard and custom objects that can be accessed via the API have associated controllers

31.

What Is The Purpose Of Controllers?

Answer»

Controllers PROVIDE the DATA and ACTIONS that are available to a VISUALFORCE PAGE.

Controllers provide the data and actions that are available to a Visualforce page.

32.

What Are Expressions Used In Pages To Bind In Controllers?

Answer»

USING methods we can BIND.

GETTER:Will return value from controller to vf page

SETTER:Will pass value from vf page to controller

Action:Will REDIRECT to another page.

Using methods we can bind.

Getter:Will return value from controller to vf page

Setter:Will pass value from vf page to controller

Action:Will redirect to another page.