Wednesday, 22 October 2014

sfdc salesforce.com soql sosl force.com top interview questions

122.When do you use Enhanced Page Layout Editor ?
Ans:-Blank spaces are created using Enhanced Page Layout Editor will be respected
by the original page layout editor
 You cannot edit them around in the original editor

127.What are Roll-up Summary Fields ?
Ans:-Roll-up Summary Fields are read-only formula fields that can display the sum ,min , or max value or record count of a field in a related list.
 For all custom master-detail relationships
 For limited standard relationships ( Account-Opportunity and Opportunity-Product )
There is an option to include all records in the roll-up or just records that meet certain criteria
128.What are Validation Rules ?
Ans:-Validation Rules verify that the data a user enters in a record meets the standards you specify before the user can save the record A Validation Rule can contain formula or expression that evaluates the data in one or more fields and returns a Value of true or false Validation Rules also include an error message to display to the user when the rule returns a value of True due to an invalid value Error message can be displayed directly below field or at the top of the page
  Multiple error messages may be displayed at one time RecordTypeName and ID can be formula merge fields Standard and custom User merge fields for the current user are also available , allowing user and profile specific validation rules function allows validation to be conditional based on whether a specific field value has changed allows access to previous value of field allows different validation rules for create vs update actions.
129.Name some Validation Rules Best Practices ?
Ans:-Express error messages in terms that help the user enter a valid value
Example :-Keep error messages relatively short to avoid excessive wrapping
A Few Permissions to Note Levels of Record Access
135.Describe Workflow Rule configuration ?
Ans:-Entry criteria : Which records
 Object Type
 Evaluation criteria
 Rule criteria
Timing : When to execute actions
 Immediately
 Time dependent
Actions : What to do
 Assign Task
 Update Field
 Send Email Alert
 Post Outbound SOAP Message
136.What are Cross-Object Formula Fields ?
Ans:-  Cross-object formula fields enable you to incorporate merge fields from multiple objects for calculations and disply.
 Create formulas that reference fields on parent or grandparent object ( upto 5 levels )
 Are limited to five unique relationships per object across all formulas and rules for that object
 Display fields from related objects on detail pages , list views , reports etc
 Use a simple wizard to browse across objects and insert fields in formulas
137.What are the different licence types ?
Ans:- Each user must have a user licence
Different types of user licences allow different levels of access Feature licences determine whether users have access to additional features like Mobile or content
138.What is a Profile ?
Ans:-Defines a user’s permissions to perform different functions
Determines how a user sees records to which he / she has access Every user has a profile ( ONLY 1 Profile )
We can group the things that profiles control into 3 categories
 Permissions , Access to Data , and User Interface

139.What do Profiles control ?
Ans:- Tab settings determine which tabs a user sees when he / she logs in Permissions determine what users can do to records to which they have access Login Hours and Login IP Ranges Sets the hours when users with a particular profile can see the system Sets the IP Addresses from which users with a particular profile can log in.
140.What are Object Permissions ?
Ans:- Permissions determine what users can do records to which they have access Lacking the ―Read permission for an object means that users will not be able to access it at all
 No access in the application or API
 No access on reports
 No access through search
141.How many standard profiles are there ? Can developers create custom profiles?
Ans:-There are 6 standard profiles
 Permissions on standard profiles cannot be customized
Developers can create custom profiles
 When creating a new custom profile , developers need to select a profile from which to copy over permissions and settings
Each Profile is associated with a licence type Typically , organizations will have one profile for each actor
142.What is Field Level Security ?
Ans:-  Restricts user’s access to view and edit fields
 Overrides any less-restrictive field access settings in page layouts and search layouts
 Controls which fields users can access in related lists, list views, reports,  Force.com Connect Offline , email and mail merge templates, custom links , and when synchronizing data or importing personal data
143.What is Record Access ?
Ans:-The sharing model determines access to specific records
 Who has access ?
 What level of access ?
 Why they have access ?
Access to records is dependent on Object CRUD
Lets compare……Profiles & the Sharing Model Ways to Obtain Access to a Record
144.What is Record Ownership ?
Ans:- Most Records have an associated owner
 Exception : Child records in a master-detail relationship inherit access rights from parent record
Types of owners
 Users
 Queues
Record owners have full access
145.Name some Organization Wide Defaults Considerations ?
Ans:- Child records in master-detail relationships inherit their organization wide defaults from their parents
 Child records in lookup relationships have independent organization wide defaults from their parents
 Changing organization wide defaults can produce unintended consequences ; consider your business requirements carefully before setting your Organization Wide Defaults
 Changing Organization Wide Defaults can potentially delete manual sharing if that sharing is no longer needed
o For Example , changing from Private to Public Read / Write

146.What are Roles and Role Hierarchy ?
Ans:- A Role
 Controls the level of visibility that users have to an organization’s data
 A user may be associated to one role
The Role Hierarchy
 Controls data visibility
 Controls Record roll up for reporting
 Users ―usually inherit the special privileges of data owned by or shared with users below them in the hierarchy
 Not necessarily the company’s organization chart
147.What are Public Groups ?
Ans:- Public Groups are a way of grouping together users for access
 Can be used in a sharing rule
 Can be used to give access to folders
Every organization has a default public group; Entire Organization
148.What are the differences between Sharing Rules and Manual Sharing ?
Ans:- Sharing Rules
 Automatic exceptions to organization wide defaults for particular groups of users
 Used to open up access to records
 Never permitted to be more strict than organization wide defaults settings
Manual sharing
 Used to open up access to records on a one-off basis when it is too difficult to come up with a consistent set of users who need access
 Granted by owners , anyone above owners in the role hierarchy and System Administrators

149.What are Apex Sharing Reasons ?
Ans:- Clicking the Sharing button on a record displays the various reasons that a user might have access to a record. Examples of sharing reasons include:-
 Administrator
 Owner
 Custom Object Sharing Rule
Establishing Apex sharing reasons allows developers to define the reason that a user or group of users might have access to a record
150.What is Dynamic Approval Routing ?
Ans:-  Dynamic approval routing approval request to users listed in lookup fields on the record requiring approval
 Dynamic approval routing allows records to be routed based on complex approval matrices
151.What is required for Dynamic Approval Routing ?
Ans:- Dynamic Approval Routing requires 4 steps:-
 Adding approver fields to the object that will go through the approval process
 Setting up the approval matrix as a custom object in Salesforce
 Creating an approval process that routes based on Related user and specifying which approver field to use for each step in the process
 To automate : add an Apex trigger to grab the appropriate approver from the approval matrix and list in approver fields on the record to be approved

152.What is Outbound Messaging ?
Ans:- Outbound messages send the information you specify to an endpoint you designate Workflow rules and approval processes can send outbound messages to an endpoint as a means of getting information to an external service The message is a secure configurable API message ( in XML Format )

153.What is Setup Audit Trail ?
Ans:-  The Setup Audit Trail shows changes made to an organization’s setup
 Up to 20 changes are displayed within the application , but developers can export to csv file to see additional changes
 Changes are tracked for 180 days
154.What is Field History Tracking ?
Ans:- Field History Tracking allows developers to choose upto 20 field per objects
for which they would like to track changes For most field types , the old and new values are tracked , as well as the date and time of the change and the user who made the change For long text area fields and multi-select picklists are tracked as edited , however, the old and new values are not noted Logging comparison
159.Name some typical requirements ?
Ans:-  Preserving data quality
Example : As new positions are entered.Universal containers would like to ensure that the appropriate fields are filled out Automating processes
Example : Positions must be approved before recruiters start recruiting for them Keeping processes from getting “stuck”
Example : A Position open for more than 30 days without candidates triggers an email to the recruiter to jump start recruitment proceduresKeeping Systems in
 Sync
Example : Outbound messages help keep Salesforce in sync with other systems Auditing
Example : Track any changes to the ranking of a candidate
160.Name some features of the Force.com Platform ?
Ans:-There are a number of features that address and automate management of these business requirements including :
 Formula fields
 Validation Rules
 Approval Processes
 Time-Dependent workflow
 Outbound messaging
 Field History Tracking
 Setup Audit Trail
Useful Operators and Functions
Function considerations
161.What are Debug Logs ?
Ans:- The debug log records errors and system processes that occur in your organization. Debug logs contain information about :-
 Database changes
 Automated workflow processes , such as :
o Workflow Rules
o Assignment Rules
o Escalation Rules
o Approval Process
o Auto-response rules
o Validation Rules
o Request-response XML
o Apex Script errors
o Resources used by an Apex script

162.How do you Troubleshooting with Debug Log ?
Use the Debug Log any time you’re troubleshooting automated actions. For
Example:-
 A workflow field update doesn’t seem to be updating. It may be the case that the field update is working , but an Apex trigger is overwriting the update
 A record submitted for approval is not routed to the user that you expected. If there are multiple approval processes on a single object , it may be the case that your record meets the criteria for both , and the order should be changed
163.What are Record Types ?
Ans:- Record Types are used to tailor user interaction experience to specific business needs.
 Note:- Record types only affect the way that data is displayed in the UI.It is not a form of sub-classing
They can determine page layouts , in conjunction with profiles Or limit picklist options
164.What are Validation Rules ?
Ans:- Consist of a formula which tests a condition that returns TRUE or FALSE Triggered on record save When the formula evaluates to TRUE
 Save is Prevented
 A Customized error message is displayed to the user
167.How do you enforce Data Consistency ?
Ans:- Validation Rules in combination with the vlookup function can be used to
enforce the consistency of data in Salesforce.For Example :-
 Ensure that the zip code and state entered on a record match
 Ensure that the city and state entered on a record match

168.How do you Prevent Data Loss ?
Ans:- Validation rules can be used to prevent users from adding or deleting records
In this case , validation rules are used in conjunction with a Roll-up summary Field ( RSF )
 First , build a RSF on the parent object , that sums the number of child records
 Then , create a validation rule on the parent object that conditionally prevents changes to the number listed in the RSF
 If a user tried to add or delete a record , the validation rule will fire and prevent users from adding or deleting
173.What are Approval Processes ?
Ans:- Approval Processes are single or multi-step process which require end user
authorization for record promotion How do I Define an Approval Process
174.What are Time Dependent Workflow Considerations ?
Ans:-Time Dependent Workflow cannot be used when a rule is set to be evaluated
Every time a record is created or updated When a new workflow rule is created , it does not affect existing records Developers can monitor and remove pending actions by viewing the timedependent workflow queue If a record that has an action pending against in the time-based workflow queue is modified so that the record no longer meets the criteria , or the timing changes , the action will be updated in the queue Workflow actions can be:
 Immediate : actions fire as soon as a record meets the criteria
 Time-dependent : actions fire based on elapsed time ( evaluated off of any date field in Salesforce ) Time-dependent actions have a time trigger With time-dependent actions , the action is queued to fire as soon as the workflow criteria is met; however , the action will not occur until it meets the time trigger
178.Name some Time-dependent workflow use cases ?
Ans:-  If an status of an offer is sent for more than 2 days , assign a task to the owner of the offer reminding them to follow up
 If the number of interviews associated with a position is zero for more than 30 days after the position is created , send an email to the hiring manager
 If a critical position remains in an open status for more than 14 days, assign a task to the owner
179.What is Upsert ?
Ans:- Upsert is an API function that combines insert and update into a single call Upsert uses an indexed custom field or external ID to determine whether to create a new object or update an existing object
 If an external ID is not matched , then a new object is created
 If an external ID is matched once , then the existing object is updated
 If an external ID is matched multiple times , then an error is reported Use Upsert when importing data to prevent creation of duplicates
180.What are External IDs ?
Ans:- External ID is a flag that can be added to a custom field to indicate that it
should be indexed and treated as an ID Custom index on any custom field of type Text , Number or Email Available on all objects that support custom fields User-defined cross-reference field.
Why is it important ?
Increases report and API SOQL performance Used with upsert to easily integrate apps with other systems An object can have 3 External ID fields.

184.What are Record IDs ?
Ans:-  Unique identifier of a record
 Analogous to a primary or foreign key field in a database table
 Salesforce generates an ID value when a new record is created i.e a00D000005iTiZ

185.Where to get Salesforce IDs ?
Ans:- IDs may be obtained in 3 ways :-
1.URL
2.Report
3.Web services API eg the Data Loader

186.What is the format for Record IDs ?
Ans:- Salesforce.com Object IDs come in 2 forms
 15 digit case-sensitive form
 18 digit case-sensitive form
Reports and Object IDs
 Reports ( and Office Edition ) return 15-digit IDs
 Report framework does not expose IDs for all objects
API and Object IDs
 API always returns 18-digit IDs
 API will accept either the 15-digit or 18 digit format

187.What are Object Relationships ?
Ans:- Relationships exist between objects , for example
 All Positions have an owner
 Candidates are related to Position through a Job Application
 Reviews are associated to a Job Application
Relationships are expressed through:
 Related Lists and Lookups in the application
 IDs ( foreign keys ) in the database

188.What are Modifiable System Fields ?What does It do ?
How do you get it ?
Ans:- What does it do ?
 Allows you to set Created Date , Created By , Last Update Date , Last Update By
 Useful for migrating data from external systems and preserving history
 Generally , these fields are Read-Only
How do you Get It ?
 Contact Salesforce.com
 Customer Support will enable
192.What are Import Wizards ? When do you use them ?
Ans:- Import Wizards
 Easy to use tool to load Accounts , Contacts , Leads , Solutions or Custom objects
 Load 50,000 records or less
 Prevent duplicates
o Account Name and Site ; Account IDs
o Contact Email Address ; Contact Name; Contact ID
o Lead Email Address ; Lead IDs

192.What are Import API-Based Tools ? When do you use them ?
Ans:-  Load any object supported by the API
 Load more than 50,000 records
 Schedule regular data loads such as nightly feeds
 Export data for backup
 Mass delete supported objects

193.What is Apex Data Loader ? When do you use it ?
Ans:- The Apex Data Loader :
 Is a fully supported salesforce.com product
 Supports import from CSV or export to CSV
 Supports loading from or exporting to a database via JDBC
 Supports custom relationships for upsert
 Can be run from command line
194.How do you decide which Tool to use for Data Import ?
Ans:- Wizard Vs API is the essential question
 Depends on operations you want to perform
 Depends on the objects involved
 Depends on your scheduling needs
 Depends on your de-duping needs
 Depends on the number of records involved
 Depends on the data sources / destinations involved

198.What is Visualforce ?
Ans:- It allows developers to completely replace the standard page layouts within the Salesforce UI with completely custom pages
 It used Apex to incorporate advanced business logic functionality
MVC Example : Opportunity Controller Actions
Visualforce : Model / View / Controller Pattern
Visualforce Component Close-up
Standard Vs Custom
Create Any Application and Interface for Any Device
Two Types of Force.com User Interface Technologies
199.What is Visualforce Component Rendering ?
Ans:-Each Visualforce component tag generates mark-up or other Web-enabled code behind the scenes to create the page The simplest example of this is the image component To View the resulting code from any Visualforce page , right-click the page and Select View Source
200.What are the benefits of Visualforce ?
Ans:-Visualforce understands Salesforce metadata and provides access to the respective user interface elements
 For example , it automatically recreate the standard Salesforce look and feel It is hosted by Salesforce and tightly coupled with the Force.com platform
 Because of this , Visualforce pages display the same performance as standard Salesforce look and feel Visualforce pages are automatically upgraded to the next Salesforce release Visualforce separates the view of information from the navigation control and the data model
 It conforms to the Model-View-Controller development pattern Visualforce and S-Controls
201.What are Visualforce Pages ?
Ans:- 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
202.What are Visualforce Controllers ?
Ans:- 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)

203.What are Visualforce Standard Controllers ?
Ans:- Standard Controllers
 Are Available for all API entities / objects , such as Account , Contact , Opportunity etc as well as custom objects
 Provide access to standard Salesforce data and behaviour
o Standard object record data
o Standard actions like save , edit , delete
 Are referenced by using :
204.What are Expressions and Data Binding ?
Ans:- Visualforce uses the expression syntax ( also found in merge fields, formulas, and s-controls ) to bind components to Salesforce data and actions in the page’s controller
 All content in { ! …. } will be evaluated as an expression.
 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
205. Are Visualforce pages and components versioned ?
Ans:-  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
206.Describe Visualforce Namespaces ?
Ans:- 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
207.What are the different ways of Incorporating Visualforce Pages ?
Ans:-Visualforce pages can be incorporated into your Salesforce 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

208.What are Force.com Sites ?
Ans:- Public , unauthenticated Web sites
 Accessed from branded domain names
 Built with Visualforce pages
 From data and content in a Salesforce application
Tag Basics Example
215.What are Tag Basics ?
Ans:-Visualforce includes a tag library similar to HTML and XML mark-up languages You can include text directly into the Visualforce page. You can use HTML tags within a Visualforce page , 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
216.Must Visualforce be Well-formed ?
Ans:- 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
217.What are Tag Bindings ? How many types of Tag Bindings are there ?
Ans:- 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
o These other components must have set a value for the id attribute
Tag Data Binding
Tag Data Binding Examples
218.Describe Action Binding ?
Ans:-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
219.Describe Component Binding via component IDs ?
Ans:- 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
Salesforce 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
o However , raw HTML could produce dupes
Component Binding via component IDs
220.What is the purpose of <apex:pageBlock> tag ?
Ans:- This tag creates an area of a page that is similar to a detail page but with no
default content Attributes include :-
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

221.What are Tab Styles ?
Ans:- 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
222.What is the purpose of <apex:sectionHeader> tag ?
Ans:-This tag creates the standard colored header bar displayed under the tabs in the
Salesforce UI
Attributes include
223.What is the purpose of <apex:pageBlockButtons> tag ?
Ans:-This tag creates a set of buttons that are styled like standard Salesforce buttons
 The individual buttons are created using the commandButton tag Attributes include

224.What is the purpose of <apex:pageBlockSectionItem> tag ?
Ans:- 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
225.What are the tags that can be used for Page Inclusions ?
Ans:- 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
226.What are Template tags ?
Ans:-These are a series of tags that are used to create Visualforce template pages that can help define reusable components for baseline pages These include:-
227.What is the purpose of <apex:relatedList/> tag ?
Ans:- 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)
228.What is the purpose of <apex:listViews/> tag ?
Ans:-This single tag creates the list view picklist for an object , usually displayed on
the main tab for an object
Attributes include:-
 Type ( String ) : the object for which list views are displayed

229.What is the purpose of <apex:enhancedList/> tag ?
Ans:-The enhancedList is similar to ListViews , but provides more flexibility by providing additional components , such as:-
 Customizable ( by the current user )
 Height
 rowsPerPage
 Width

230.What is the purpose of <apex:dataList> tag ?
Ans:-This tag creates a list ( a one-column table ) by iterating over a set of data As there is only one column , the body of the tag specifies how a single item should appear in the list Attributes include :-
231.What is the purpose of <apex:dataList> tag ?
Ans:- This tag creates an HTML table by iterating over a set of data Use the column tag to specify the table’s columns
Attributes include :-
232.What is the purpose of <apex:column/> tag ?
Ans:-This tag creates the column for a table. It can be used within either a <apex:pageBlockTable> or <apex:dataTable> set
of tags Attributes include:-
233.What is the purpose of <apex:repeat> tag ?
Ans:- This tag simply iterates over the data of a collection for a structure that you specify It is typically used if one of the other iteration components does not meet the requirements Attributes include :-
234.What is the purpose of <apex:outputLabel> tag ?
Ans:- This tag creates a label for input or output widgets that do not automatically come with a label This usually because the data is not coming from Salesforce or a non-default UI Widget is being used for a Salesforce field ( i.e not outputField )
Attributes include :-
235.What is the purpose of <apex:outputLink> tag ?
Ans:-This tag creates a link to a URL Like its HTML equivalent anchor tag , the body of an outputLink is the text or image that displays is the text or image that displays as the link Attributes include :-
236.What is the purpose of <apex:outputPanel> tag ?
Ans:-This tag defines a set of content that is grouped together , often for the purpose of doing partial-page refreshes using AJAX Attributes include :-
237.What is the purpose of <apex:outputText> tag ?
Ans:- This tag simply displays text which can be formatted using a stylesheet
 Text can be used with nested param tags to dynamically insert data Attributes include :-
238.What is the purpose of <apex:outputLink> tag ?
Ans:- This tag creates a link to a URL Like its HTML equivalent anchor tag , the body of an outputLink is the text or image that displays as the link Attributes include :-
239.What is the purpose of <apex:inputWidget> tag ?
Ans:- In general , these tags include attributes that give you ways to :-
 Vary the size of the data and the widgets
 Make the inputs required
 Control the tabbing sequence and keyboard shortcuts
 Bind the data to custom controllers
 Handle standard JavaScript Events
240.What is the purpose of <apex:inputFile> tag ?
Ans:- This tag allows users to upload files and turn them into:-
 Attachments on records
 Documents
 Apex Blobs
Attributes include :-
241.What is the purpose of <apex:commandButton > and
<apex:commandLink> tags ?
Ans:- These tags create buttons and links that allow the users to navigate and take actions
 These tags must be used within a form tag
Attributes include:-
242.What are Static Resources ?
Ans:- Static Resources are a new kind of Salesforce storage , designed for use with Visualforce Static Resources are items required by your Visualforce pages , such as archives , images , stylesheets , JavaScript etc
 These resources can be referenced using the $Resource global variable
 They can be a collection of related files into a directory hierarchy ( .zip, .jar )
 This is the recommended method over uploading these files to the Document tab , as these resources can be cached for better performance Upload files via Setup | Develop | Static Resources
 There is a 5 MB limit per file and a 250 MB overall limit for static resources
243.What is the purpose of <apex:flash> tag ?
Ans:-In Visualforce , flash tags are used instead to call .swf files
244.What are Salesforce stylesheets tags ?
Ans:-Use the <apex:stylesheet> tag to add additional styles to a page
 All tags that produce HTML have pass-through style and styleClass attributes to allow you to use your style with any visual component.
Note : Visualforce is not designed to be a way to fully re-brand a standard Salesforce application
245.What is the purpose of <apex:facet> tag ?
Ans:-A facet is a child of another Visualforce component that overrides an area of
the rendered parent with the contents of the facet Facet tags can be used with a variety of other component tags to provide or override headers , footers , and captions to other items.
246.What is the purpose of <apex:param> tag ?
Ans:-This is used as a child tag that provides a name/value pair parameter for its
parent component. It can be used with :
 outputLink
 outputText
 actionFunction
Attributes include
247.How many controllers can a page have ? Where is the controller for a page assigned ?
There are a series of layout components that all help recreate the traditional Salesforce page layout style very easily. What name do they share ?
248.What are the names of the coarse metadata tags ?
Which tags should be used to automatically bring in the Salesforce label and default widget for a field ?
250.What are some examples of JavaScript Events ?
Ans:-It is possible to create reusable JavaScript functions within HTML <script> tags
 This creates functions that can be called from within the Visualforce page Creating functions can be helpful if the same JavaScript code is needed multiple times on a page.
These functions can then be used on the embedded JavaScript event attributes in many Visualforce tags
 Example : onclick =”changeFont ;”
It can also be useful to isolate the JavaScript at the top of the page for maintenance purposes

251.How can you create partial page refreshes ? How does the method change depending on the context ?
Ans:- The simplest way to implement a partial page update is to use the reRender attribute on a button or link First , isolate the portion of the page that should be rerendered when the button or link is clicked by surrounding it with the <apex:outputPanel> tags
 Be sure to give the outputPanel an id Then , create the command button or link that will trigger the partial refresh
 Add the reRender attribute to the button or link tag and assign it the value of the id of the outputPanel created earlier
252.What are AJAX Behaviours? How they are different from partial page updates ?
Ans:- AJAX behaviours ( like partial page updates ) are asynchronous events that occur in the background while a user continues to work on the page In the chance that these updates take longer than near-instantenous.Visualforce supports displaying status updates using the actionStatus tag.
 You can display text at the beginning or end of the asynchronous event using the startText and stopText tags
 You can specify what is to be displayed after the refresh by using the <apex:facet name=”stop” > tags
257.What are Visualforce Controllers ?
Ans:-A Visualforce controller is an Apex that specifies the data available and the behaviour when a user interacts with components on a page
258.What are Visualforce Standard Controllers ?
Ans:- Standard controllers provide the same common data and functionality and logic used for standard Salesforce pages
 All standard and custom objects that can be queried using the API have a standard controller
Standard controllers are associated on Visualforce pages using :-
259.What are Visualforce Standard List Controllers ?
Ans:-For almost every standard controller there exists a standard list controller that
allows you to create pages that display and act on a set of records , such as list pages , related lists , and mass action pages To select the standard list controller instead of the regular standard controller ,
use the recordSetVar attribute on the page tag
 This also creates a variable that represents the record set for the page Pages that use standard list controllers can be used in much the same way as pages with regular controllers
 For example , you can override standard or create custom buttons, links , and tabs Standard list controllers provide additional pagination actions that regular controllers do not , such as first , last , next and previous Standard List controllers Example
260.What are Visualforce Custom Controllers ?
Ans:- A custom controller is an Apex class that implement all of the logic for a page without leveraging a standard controller
 Custom controllers typically define three different types of methods.
o Getter methods to retrieve data from the controller
o Setter methods to pass data from the page to the controller
o Action methods to perform logic
 Navigation action methods to take the user somewhere else Custom controllers must explicitly define all action methods , including those found in standard controllers.
261.What is the purpose of Custom Controllers : Getter Methods ?
Ans:-  Getter methods provide ways to return object data in a Visualforce page
 Getter methods take the form : getDataName() which uses the name of the data retrieved.
 In a Visualforce page , the data can be accessed using the { | DataName } merge field syntax
What is the purpose of Custom Controllers : Setter Methods ?
Ans:- Setter methods are used to pass user-specified values from a page to a controller
 Example – passing in search text entered by a user Setter methods take the form setDataName()
Any setter methods are automatically executed before any action methods Data that is bound to a Salesforce object is automatically updated without the need for setter methods
262.What is Apex ?
Ans:-  Apex is a procedural scripting language written in discrete pieces and executed by the Force.com platform
 It runs natively on the Salesforce servers , making it more powerful and faster than non-server code , such as JavaScript / AJAX
 It uses syntax that looks mostly like Java and acts like database stored procedures
 Apex allows developers to attach business logic to the record save process
 It has built-in support unit test creation and execution
263.Describe Visualforce Apex Execution ?
Ans:- Apex executes when Data Manipulation Language ( DML ) events occur on the force.com platform.
Unlike Visualforce , Apex is generally not tied directly to a button or specific portion of the UI
 Instead Apex triggers are attached to events such as insert , update ,
and delete that execute on a particular object
o Apex code can be processed immediately before or after these actions , whenever or however they occur An exception to this statement are Visualforce controllers
264.What are the commonalities and differences between Apex Vs Java ?
Ans:- Apex has many commonalties with Java , such as:-
 Variable , expression , and looping syntax
 Block and conditional statement syntax
 Object , array , and comment notation
 Pass by reference
 Compiled , strongly-typed , and transactional
However , Apex also has a few big differences
 It runs in a multi-tenant environment and is very controlled in its convocations and limits
 To avoid confusion with case-insensitive SOQL queries , Apex is also case-insensitive
Apex Sample Syntax
265.Describe Apex Capabilities ?
Ans:- Apex provides built-in support for:-
 DML calls to insert , update , and delete records
 Inline SOQL or SOSL statements for retrieving records
 Looping control structures that help with bulk processing
 A record locking syntax that prevents record update conflicts
 Custom public API calls
 Send and receive emails
 Web Services or XML request / response integrations
 Warnings and errors to prevent objects referenced by Apex from being modified
 A full testing and deployment framework
266.Describe Apex Limitations ?
Ans:- Unlike Java or C# , Apex is not a general purpose programming language Currently Apex cannot be used to :-
 Render elements in the user interface ( except error messages )
 Change standard functionality
 Create temporary files
 Spawn threads
 Use network resources
 Access Java Libraries
Controller Architecture
Traditional Code Vs Apex

267.What are the different types of environments where Apex can be written and executed in ?
Ans:- As long as the user has the ―Author Apex permission , Apex can be written in:-
 Developer Edition Orgs
 Unlimited Edition or Enterprise Edition Sandbox Orgs
 Trial UE or EE Orgs
It is typical for each developer to have their own org for development
Apex can be executed in:-
 Developer Edition
 Unlimited Edition
 Enterprise Edition
Multi-tenant Data and Code
Apex Development
268.What is the definition of Object-Oriented Programming ?
Ans:-The Object-Oriented Programming consists of modeling the real world into programmer defined classes from which classes can be instantiated A class is therefore is a template or blueprint from which objects can be created Classes consist of methods and properties
 The properties of a class model the state of a class instance
 The methods describe the interactions of a class instance

269.What is the definition of a class ?
 Ans:-A class can be up to 100,000 characters in length Classes are stored with the version of the API used to compile them
 Classes have an isValid flag of the API used to compile them It is recommended to use Java naming convention for classes of uppercase first letter Classes can be enabled or disabled for profiles
 Although all code is executed as System , you can enable Apex classes for particular profiles
270.What are the steps for Creating Classes ?
Ans:-Classes can be created through the UI or through Force.com IDE Project Through the UI , navigate to Setup | Develop | Apex classes
 From there , select New or Generate from WSDL
 Enter the code into the UI or upload a WSDL
Through the Force.com IDE , right-click the src folder and select Force.com |
New Apex Class
 When the code is saved , if it is valid it will be updated automatically into Salesforce
271.What does Class Syntax consists of ?
Ans:-Class Syntax consists of :-
 An access modifier
 Optional definition modifiers ( virtual , abstract etc )
 The Keyword class
 The unique name
 Optional extensions or implementations
272.What are Static Methods & Variables ?
Ans:-Static Methods are generally utility methods that do not depend on an instance
 System methods are static Class methods and variables can be declared as static
 Without this keyword , the default is to create instance methods and
variables
Static methods are accessed through the class itself , and not through an object
of the class. Example:-
Use Static Variables to store data that is shared within the class
 All instances of the same class share a single copy of static variables
 This can be a technique used for setting flags to prevent recursive
triggers
273.What are Class Constructors ?
Ans:-A constructor is a special methods used to create ( or instantiate ) an object out of a class definition Constructors have a default, no-argument , public constructor if no explicit constructor is defined-
 If you create a constructor that takes arguments and still want a noargument constructor, you must explicitly define one Constructors can be overloaded,  eaning you can have multiple constructors with different , unique argument lists or signatures Constructors are called before all other methods in the class
274.What is the process of instantiating Objects from classes ?
Ans:- In order to work with most methods and variables , you must first instantiate an object from a class using one of the constructors
 The constructor method is the same as the class
Instantiation syntax:-
Once you have instantiated an object , you can refer to methods and variables using dot notation
275.When do you use Final Variables keyword ?
Ans:- The final keyword can only be used with Variables.
 Classes and methods are final by default Final variables can only be assigned a value once
 This can either be at declaration or initialization When defining constants , both the static and final keywords should be used
276.When do you use without sharing keyword ?
Ans:-Use without sharing to ensure that the string rules for the current user are not
Enforced If neither the with sharing nor without sharing keywords are used then the
current sharing rules remain in effect If the class is being called from a class that has sharing enforced , then sharing is enforced for the called class
277.When do you use with sharing keyword ?
Ans:- By default , all Apex executes under the System user , ignoring all CRUD ,
field-level and row-level security. However , it is possible to execute Apex with just the rows available to the operating user through the sharing model-
 This is done using the keywords with sharing on a class or method
o Methods and inner classes inherit the usage of the outer class
o However , further method calls made from within a with sharing method will run as system
 Note that all CRUD and field-level security restrictions will still be ignored
278.What are Interfaces ?
Ans:- Interfaces are classes that only include the method signature and the methods
are not implemented
 Another class must be created that supplies the implementation Apex supports both top-level and inner interfaces
279.What is the purpose of Casting ?
Ans:- Apex enables casting
 A data type of one class can be assigned to a data type of another class , but only if one class is a child of the other class Casting converts an object from one data type to another. Casting between the generic sObject type and the specific sObject type is also allowed

280.Name some Object-Oriented Commonalities ?
Ans:- Code is written in discrete units called classes
 Classes have variables to describe the properties of the class
 Classes have methods which describe the behaviours or actions available to the class.
Classes are then instantiated into objects to take on a specific form
 Instantiation happens through special methods called constructors
The code often utilizes dot notation to refer to objects and their variables or  ethods
281.Why are Governor limits important ? What are they based on ?
Ans:- Apex runs in an multi-tenant environment and therefore the runtime engine
need to ensure that scripts do not monopolize resources Governors are responsible for enforcing these limits and tracking the resource statistics as set by Salesforce
Unlike the API , these limits are transaction-based , not time-based
 The limits are per invocation , not per 24-hour period.
If a script exceeds a limit , a runtime exception is thrown that cannot be handled. This error will be seen by the end user. There is currently no way to enlarge limits or turn of the governors for any org
282.Whjat does the Force.com IDE include ?
Ans:- The Force.com IDE ( Integrated Development Environment ) allows developers to create Apex code , Visualforce pages and controllers , and other programmatic force.com features as well as metadata for many declarative features in a client application.
The Force.com IDE is a plug-in that works within the Eclipse IDE
 Eclipse is a free IDE for Java Developers that has a rich varirty of native and third-party plugins
 It is available from http://www.eclipse.org/downloads and must be installed prior to installing the Force.com IDE

283.What are Implicit Invocations ?
Ans:- Implicit invocations can be more complex to code for as you donot have as much control over who or what is causing the invocation nor when it happens In Apex , implicit invocations occur when triggers are called by the force.com platform during the save process.
 You can determine if the trigger should fire immediately before or immediately after the save
 Since triggers are executed both when data is saved through the UI (such as page layouts or data import wizards ) or the API , you cannot be sure how many records are being saved at once
284.What are Explicit Invocations ?
Ans:-,Apex can be invoked through the Web services API for classes that are exposed as Web services with the web services keyword.
 This means that it is also available via the AJAX Toolkit , just like other parts of the Web services API
 The Web services API can be invoked via any language that supports SOAP messaging. Apex can be invoked when emails are received from a Salesforce email domain to process the incoming email and possibly send an auto-response Apex written as Visualforce controllers provide data and actions to Visualforce pages when the pages they control are rendered.
285.When do you need to use Apex ?
Ans:- Apex should be used as a solution when:-
 You need to apply complex business logic to rows of data being saved by any means
 You need to create additional Web services API functionality for exposing logic either within Salesforce or to external applications
 You need to call out to external Web services and process the results
 You need to handle incoming or outgoing emails in ways more complex than the declarative functionality

286.When not to use Apex ?
Ans:- Use the declarative Setup menu if the functionality is available there
 That way the functionality will upgrade , possibly to include new features in the future
Use an Visualforce if you want to :-
 Add a visual element to the user interface
 Add business logic that only applies when accessing data through the user interface.
Use the Web services API if you want to :-
 Add functionality to an external app to provide integrations via the standard API Calls
287.What are the 2 different ways of using this keyword ?
Ans:- There are 2 different ways of using the this keyword
 Use it in dot notation to represent the current instance of its class to access instance variables and methods
Use it in one constructor to call another constructor to do constructor chaining

 It must be the first statement in the constructor

No comments:

Post a Comment