Friday, 22 November 2013

sfdc interview questions3

 What are the benefits of Visualforce?

 Visual force understands Sales force metadata and provides access to the respective user interface elements
       For example , it automatically recreate the standard Sales force look and feel
  It is hosted by Sales force and tightly coupled with the Force. com platform  , Because of this , Visual force pages display the same performance as standard Sales force look and feel
 Visual force pages are automatically upgraded to the next Sales force release
 Visual force separates the view of information from the navigation control 
    It conforms to the Model-View-Controller development pattern

 What are Visualforce Pages?
          A Canvas similar to standard web development model
  •        Composed of HTML , Page tabs and merge fields
  •        Ability to reference any CSS , Flex , Flash , AJAX or other Web       technology
          Supports standard query strings for parameters , referenced via  /apex/pageName URL Syntax
  •        Composed on the server , not the client

   What are Visualforce Controllers?
          Controllers contain the logic and data references a page uses 
          As they are created in Apex , they have full access to Apex      functionality ( API , Web Services etc 
          Pages interact with controllers through components that call data or actions
  •        Can be used to maintain state across page interactions ( in wizards , for example )


  What are Visualforce Standard Controllers?

Standard Controller
        Are Available for all API entities / objects , such as Account , Contact Opportunity etc as well as custom object
        Provide access to standard Sales force data and behaviour
        Standard object record data
        Standard actions like save , edit , delete
        Are referenced by using :

<apex:pagestandardController = ”Contact” >

 What are Expressions and Data Binding?

Visualforce uses the expression syntax ( also found in merge fields , formulas , and s-controls ) to bind components to Sales force data and actions in the page’s controller
                 All content in { ! ….  } will be evaluated as an expression.
                 {!$User.FirstName} shows the current user’s first name in a page
                 Data context is provided to controllers by the ID parameter , just as in standard pages

  Are Visualforce pages and components versioned?

                 Visualforce pages and components are versioned
                 Previous versions of Visualforce elements remain available after new implementations are introduced , ensuring that your code works with each release
                 The Version settings tab displays the version of each page or component

  Describe Visualforce Namespaces?

Standard tags begin with the word apex

Custom tags begin with the letter c

Application developers can register custom namespaces to be displayed with custom tags instead of the letter c

  What are the different ways of Incorporating Visualforce Pages?

Visualforce pages can be incorporated into your Sales force UI by :-

                 Creating Links to reference the unique page URL
                 Overriding standard buttons to route to the new page
                 Creating custom tabs for the new page
                 Creating custom tabs and links to route to the new page
                 Embedding pages into page layouts ( similar to inline s-controls )
                 Adding Pages to a dashboard
                 Using pages as custom help for a custom object

 What are Force. com Sites?

                 Public , unauthenticated Web sites
                 Accessed from branded domain names
                 Built with Visualforce pages
                 From data and content in a Sales force application

 What are Tag Basics?

Visualforce includes a tag library similar to HTML and XML mark-up language

You can include text directly into the Visualforce page

You can use HTML tags within a Visualforcepage , including

HTML comment tags

Formatting tags

You can use JavaScript within a Visualforce page as well , but you will often find it easier to use equivalent Visualforce tags
                 Note:- You cannot use JavaScript line commenting except within <script> tags

Visualforce components ( tags ) all begin with the apex : prefix

All pages must be enclosed by a set of <apex:page> tags

Tags may contain attributes that have values ( in quotes ) to help further define them
                 Attribute values are typed to be strings , collections , ids etc


  Must Visualforce be Well-formed?

Like XML ,Visualforce must be well-formed.  At a high level this means

                 Every Visualforce start tag <tagName> must have a matching end tag < / tagName> or be a self contained tag <tagName / >
                 Tags are hierarchical and must be closed in the reverse order they were opened

  What are Tag Bindings? How many types of Tag Bindings are there?

Bindings are ways to relate Visualforce components with either the page controller or other page components

There are primarily three types of bindings for Visualforce components

                 Data bindings : using the expression syntax to pull in data from the data set made available by the page controller
                 Action bindings : using the expression syntax to call action methods for functions coded in the page controller
                 Component bindings : using component attribute values to reference other component IDs
                 These other components must have set a value for the id attribute

   Describe Action Binding?

Data Binding works because the page can access the data made available through the controller

In a similar manner , actions that are available through the controller can be called using the same expression syntax. These can be :-

                 Standard actions , such as save and edit
                 Custom actions that provide custom functionality

  Describe Component Binding via component IDs?

All Visualforce tags have an optional id attribute that can be used to refer to the
tag component

                 This id is used as the document model access ( DOM ) ID when the page is rendered
                 The tag can be referenced by the id by other tags , JavaScript , or other Web-enabled languages

Sales force recommends using unique ids within each page
                 If not unique , you may need to specify the hierarchy of ids to locate the correct component
                 The hierarchy prevents the possibility of duplicate IDs on HTML elements generated by components
                 However , raw HTML could produce dupes

  What is the purpose of <apex:pageBlock> tag?

This tag creates an area of a page that is similar to a detail page but with no default content

Attributes include :-

                 Mode(String): either detail or edit mode.  Edit mode does not show field lines.  (detail)
                 Title(String): title displayed on the page block.
                 tabStyle(String): Sales force object used to copy the color and style for this page block. 

The pageBlock tags can include facet tags , which are child tags that are often used to add or override headers and footers to areas or tables

 What are Tab Styles?

You can specify the tab style at the <apex:page>or <apex:pageBlock>levels of Visualforce pages

                 Remember that tab styles refer to the icon and color used on the tab

In standard controllers , the page automatically takes on the style of the associate object

In Custom controllers , if you choose not to specify a tab style the page automatically takes on the style of the Home Tab

  What is the purpose of <apex:sectionHeader> tag?

This tag creates the standard colored header bar displayed under the tabs in the Sales force UI

Attributes include
                 Title(Stirng): the text displayed at the top of the bar.
                 Subtitle(string): the text displayed under the title.
                 Help(String): the URL for the page’s help file.  The link appears on the right.

   What is the purpose of <apex:pageBlockButtons> tag?

This tag creates a set of buttons that are styled like standard Sales force buttons
          The individual buttons are created using the commandButton tag

Attributes include

                 Location(String): either top, bottom, or both. (both)

   What is the purpose of <apex:pageBlockSectionItem> tag?

This tag must be used within a PageBlockSection component to create a pair of cells as an item in a column , instead of using inputField or other tags that automatically create name / value data pairs

Each column has two cells ; one for the label and one for the value

These can be added with outputLabel tags and inputText or other UI widget components

  What are the tags that can be used for Page Inclusions?

There are three tags that allow you to insert other web content within an iframe

Iframe : insert web content using a URL

s-control : insert an s-control ( similar to an inline s-control )

include : insert another Visualforce page
        
 What are Template tags?

These are a series of tags that are used to create Visualforce template pages that can help define reusable components for baseline pages


 What is the purpose of <apex:relatedList/> tag?

This single tag creates just the related list for records related to the parent
record

Attributes include:-
                 List ( String ) : the name of the child relationship from which to return the records
                 Subject ( String ) : the id of the record that should provide the data for the related list
                 pageSize( Integer ) : the number of records to display by default(5)


No comments:

Post a Comment