Wednesday, 22 October 2014

MNC's Level 5 companies career apply freshers 2014 / 2013 / 2012 / any experiance

For tech mahindra : apply for tech mahindra

For accenture : apply for accenture


For L & T : apply for l&t

sfdc salesforce.com sales cloud service cloud remedyforce - top interview questions by salesforce realtime experts

288.What is the difference between the global and public and Private Class Access Modifier keywords ?
Ans:- Classes have different access levels depending on the keywords used in the class definition
 Global :- This class is accessible by all Apex everywhere
o All methods / variables with the webservice keyword must be global
o All methods / variables / inner classes that are global must be within an global class to be accessible
 Public :- This class is visible across your application or namespace
 Private ( for inner classes only ) :- This inner class is only accessible to the outer class.
Top-level ( or outer ) classes must have one of these keywords
 There is no default access level for top level classes
 The default access level for private classes is private

289.What is the difference between the global and public and Private and Protected Variable & Method Access Modifier keywords ?
Ans:- Like classes , methods and variables have different access levels depending on the keywords used in the declaration.
 Private : This is the default and means that the variable / method is accessible only within the class it is defined
 Protected : This method / variable is also available to any inner classes or sub-classes. It can only be used by instance methods and member variables
 Public : This method / variable can be used by any Apex in this application namespace
 Global : This method / variable is accessible by all Apex everywhere
o All methods / variables with the webservice keyword must be global
289.What is the definition of Inheritance?
Ans:- The ability to extend classes is now available in all orgs
 Virtual : This class allows for extensions and overrides
 Abstract : This class contains abstract methods and is designed to be extended
 Override : The method overrides base class methods
A class can implement multiple interfaces , but only extend one class. Classes can cast as super classes and verify an object’s class using this instanceof keyword
290.What are the different data types for Apex Variables ?
Ans:- The different data types for Apex Variables are :-

291.What are the different Primitive data types for Apex Variables ?
Ans:- Apex uses the same Primitive data types as the Web services API , most of which are similar to their Java counterparts. In addition , there are two non-standard types:-
292.What is Collection Casting in Apex ?
Ans:- Collections can also be cast in Apex For Example , a list of child class objects can be assigned to a list of parent class objects
293.What is Enum Data Type in Apex ?
Ans:- Enum ( or enumerated list ) is an abstract data type that stores one value of  
finite set of specified identifiers To define an Enum , use the enum keyword in the variable declaration and then define the list of values By creating this Enum , you have created a new data type called Season which can be used as any other data type Apex provides some built-in Enums for built-in concepts such as API error (
System.StatusCode ).
294.What are the different types of Enum Data Type Methods ?
Ans:- Although Enum Values cannot have user-defined methods added to them , all
Enum values have some implicit methods similar to Java
 Ordinal () returns the position of the item in the list ( from 0 )
 Name () returns the name of the Enum item as string
 Values() is a static method that returns the list of values
295.What is an sObject Data Type ?
Ans:-An sObject represents a row of data in the Salesforce database An sObject must be declared using the API name for the object. They are initialized to null by default An sObject can be instantiated using name / value pairs to add initial values to fields , or can be populated later.
296.What are the different types of sObject Data Type Methods ?
Ans:- The following methods are available on sObjects :-

297.What are the three different types of collections ? How are they different ?
Ans:- There are three different types of collection objects in Apex List : An ordered collection of primitives , sObjects , collections or Apex objects based on indices
Set : An unordered collection of unique primitives
Map : A collection of unique , primitive keys that map to single values which can be primitives , sObjects , collections , or Apex objects
298.What is a List Data Type ?
Ans:- Lists are similar to arrays in that they are an ordered collections of typed
primitives , distinguished by their indices. The first element in a list is always at index 0 Generic list declaration syntax
Examples:-
299.How do you define Static Variables in Apex ?
Ans:- Use the static keyword to define static variables to store data that is shared within the class
 Static Variables are not necessarily constants
 All instances of the same class share a single copy of static variables
 This can be technique used for setting flags to prevent recursive triggers

301.What are SOQL Queries ?
Ans:- The Salesforce Object Query Language ( SOQL ) is similar to the SELECT command in SQL and allows you to specify the source object and allows you to specify the source object and a list of fields with an optional WHERE clause.
 These query strings are typically used with the query() call to the Web Services API
 SOQL statements evaluate to a List of sObjects , a single sObject or an integer ( for count queries )
 You can use the ALL ROWS keywords to query all records in an organization , including deleted records and archived activities
 The FOR UPDATE keywords can be used to lock records for updating
 Records can then only be updated through the current trigger context
302.What are SOSL Queries ?
Ans:- The Salesforce Object Search Language ( SOSL ) allows you to search  ultiple
fields for multiple objects with a single query
 These search strings are typically used with the search() call to the Web Services API
 SOSL Statements evaluate to a List of List of sObjects where each list contains the search results for a particular sObject type , returned in the same order as listed in the Query
303.What is bind ?
Ans:- SOQL & SOSL statements in Apex can reference variables and expressions when preceded by a colon
 This is referred to as a bind
Examples:-
304.What are System Static methods in Apex ?
Ans:-Apex includes both built-in system static methods and instance methods for
expressions of particular data types. System static methods are similar to Java and are always of the form : Class. method(args)
System Static Methods do not have implicit parameter , and are invoked with no object context.
306.What are Apex Objects ?
Ans:- A class is a template or blueprint from which Apex objects are created Any standard or custom Apex object ( not sObject , but object instantiated from an Apex class ) can use :-
 clone : returns a new object with the same value references ( shallow copy )
 toString : returns a string representation of the values ( similar to debug )

307.What is the purpose of Limit Methods ?
Ans:-Due to multi-tenant environment , the Apex runtime engine strictly enforces a
number of limits.
Apex contains built-in methods to help manage these limits There are two versions of each method.
The first returns the amount of resource that has been used in the current context
The second ( containing the word Limit ) returns the total amount of the resource available for that context
 309.What is the purpose of Data Manipulation Language ( DML ) Statements ?
Ans:- DML Statements allow users to retrieve , insert , delete , and update data in the Salesforce database , similar to the parallel API Verbs
 Insert , update , upsert , delete , merge
 Undelete which can utilize the ALL ROWS parameter similar to the API QueryAll call
 Convertlead is functionality equivalent to the API Convertlead() DML Statements can take two forms
 Special , standalone statements :- delete , record
 Functional calls in method form from the database class
 Database.delete(record);
They can take a single sObject or an sObject list
 The upsert statement also takes an optional external id
310.What is the purpose of Database.DML options ?
Ans:- The Database.DML Options provides the ability to add extra information during a transaction
 Specify truncation behaviour
 Specify locale options
 Trigger assignment rules
o Only used for account , case , or lead
 Trigger email notifications based on certain events
o Creation of new case of task
o Creation of a case comment
o Conversion of a case email to a contact
o New user email notification
o Password reset

311.What is the maximum number of rows that can be brought back by a SOQL Query ?
Ans:- SOQL Query Results in a trigger cannot exceed 1000 records per record submitted
312.Name some DML Statement Guidelines ?
Ans:-  You can pass a maximum of 200 sObject records into a single method
 Each DML Statement can only operate on one type of sObject at a time
 You must supply a non-null value to all required fields when inserting or updating
 Inserting a record automatically sets the ID for the record
 The ID for the current sObject record cannot be modified , but related IDs can
 Upsert calls consist of two separate operations of insert and update
 Deleting supports cascading deletions
 Merging works for a maximum of three records at a time
o Only Leads , Contacts , and Accounts can be merged

313.Name some unsupported sObjects for DML Statements ?
Ans:- DML Statements are not supported within Apex on the following sObjects:-

314.How are Transactions controlled in Apex ?
Ans:-  All Transactions are controlled by the trigger , Web service or anonymous block that executes the Apex Script
 If the Apex Script completes successfully , all changes are committed to the database. If the Apex Script does not complete successfully , all database changes are rolled back
316.What are some of the Characteristics of user-defined methods in Apex ?
Ans:- Note that user-defined methods :-
 Can be used anywhere that system methods are used
 Pass arguments by reference
 Can be recursive
 Can refer to themselves or to methods defined later in the same class or
anonymous block
 Can be polymorphic
317.What are Triggers in Apex ?
Ans:- A trigger is an Apex script that executes when a data manipulation language (
DML ) event occurs on a specific sObject.
DML events include : insert , update , delete , undelete
Triggers can be created on any custom or top-level standard objects

318.What is the difference between Before and After Triggers ?
Ans:-
Triggers execute either before or after the event
 Before triggers can update or validate values before they are saved to
the database
 After triggers can access field values that are set automatically ( such as
Id or last Updated fields ) or to affect changes in other records ( such as
auditing or queued events ).

319.What is the order of execution of triggers in Apex ?
Ans:-
1.The original record is loaded from the database ( or initialized for insert )
2.The new record field values are loaded and overwrite the old values
3.System Validation occurs ( verifying required fields , running Validation
rules )
4.All before triggers execute
5.The record is saved to the database , but not yet committed
6.All after triggers execute
7.Assignment rules execute
8.Auto-response rules execute
9.Workflow rules execute
10.If there are workflow field updates , the record is updated again
11.If the record was updated with workflow field updates , before and after
triggers fire once more
12.Escalation rules execute
13.All DML operations are committed to the database
14.Post-commit logic executes , such as sending email

320.Name some trigger considerations ?
Ans:-
All triggers are considered to be bulk triggers and should be able to process
multiple records at a time
 Remember that triggers execute via API access as well , which can
submit multiple records for each DML verb
All triggers run as System by default
 This means that triggers may have access to objects and fields that the
current user does not
 You can override this using the with sharing keywords
Trigger code cannot contain the static keyword
Triggers can only contain keywords applicable to an inner class

321.What are the 3 different ways Apex can be deployed ?
Ans:-
Apex can be deployed in 3 different ways:-
 Using the Force.com IDE , for developers
 Using the Force.com Migration Tool ( Ant ) , for technical IT
administrators
 Using 3rd-party tools such as Dreamfactory Snapshot ( which implement
deployment utilities using the Metadata API ) for non-technical IT

322.Describe the steps of deploying Apex using Force.com IDE ?
Ans:-
1.Right-click your src folder in your project and Select Force.com | Deploy to
Server
2.Enter
Username / Password
Security Token ( if necessary )
Environment
3.Select whether to create project and destination archives and if so where to
store them
4.Select the items that you wish to migrate
5.Validate the deployment to catch any testing coverage issues
6.Examine the deployment plan to verify what will be added or overwritten
7.Execute the Deployment

323.What is the purpose of Force.com Migration Tool ?
Ans:-
Use the Force.com Migration Tool to deploy and retrieve tasks to create ,
update , and retrieve metadata

324.What is the command for running Force.com Migration Tool ?
Ans:-
From the directory where build.xml exists , in a command shell , run Ant
followed by the target
 Example with the ―test target ; ant test

325.What are the 4 different Dynamic Apex Components ?
Ans:-
Dynamic Apex consists of several components

326.What is Dynamic SOQL ?
Ans:-
Dynamic SOQL refers to the creation of a SOQL string at runtime within an
Apex Script
Makes an Application more flexible by allowing SOQL Creation on the fly:-

327.What is Dynamic DML ?
Ans:-
Dynamic DML is the process of creating sObjects dynamically , and inserting
them into the database using DML

328.What are Wizards ?
Ans:-
Wizards are multi-step sequences designed to simplify lengthy or complicated
tasks
Each step in the wizard is generally its own Visualforce page
However , there is generally just one controller for the entire wizard to maintain
the state
 Usually , the state is cleared when navigating to a new page
 The wizard must track all user input values until the final step in order to
allow users to page back and forth through the wizard

329.What is the purpose of Transient Variables ?
Ans:-
Declaring variables as transient reduces view state size
 The transient keyword can only be used in Visualforce controllers and
controller extensions
Use the transient keyword to declare instance variables that cannot be saved ,
and should not be transmitted as part of the view state for a Visualforce page

330.What are the 2 different ways of deploying Controllers in Apex ?
Ans:-
Controllers are simply Apex classes , so all of the usual coding , testing , and
deployment rules and guidelines apply
Controllers can be deployed in 2 ways:-
 Force.com Migration Tool via ANT
 Force.com IDE via Eclipse

331.What are Crypto Classes ? How many types of Crypto Classes are there ?
Ans:-
Crypto methods enables access to external services that require encryption

332.What is the purpose of REST Service Callouts ?
Ans:-
REST Stands for Representational State Transfer
REST simply receives XML over HTTP from a URL
REST builds on the existing structure of the web by using HTTP and XML
without the need to delve into the intricacies of SOAP
Uses HTTP ―verbs such as POST , GET , PUT and DELETE to call services
located at a specific URL
You must make the service endpoints accessible via Setup | Security Controls
| Remote Site Settings

344.What are the different ways to instantiate pages ?
Ans:-
There are 4 different ways to instantiate pages , depending on the type of page:-

345.When is Creating Controller Extensions recommended ?
Ans:-
If you want to keep most of the functionality of a standard or custom controller
, it is probably wiser to create an extension rather than a new custom controller
Controller Extensions can extend either standard or custom controllers

346.What are the different types of Exceptions in Apex ?
Ans:-
Similar to Java , Apex uses exceptions to note errors and other events that
disrupt script execution with the following keywords:-

348.What does System Log Contains ?
Ans:-
The system log contains information derived from the following:-
 Database changes
 Automated workflow processes , such as:-
o Workflow rules
o Assignment rules
o Escalation rules
o Auto-response rules
o Approval processes
 Validation rules
 Request-response XML
 Apex Script Errors
 Resources used by an Apex script

349.What are Apex Unit Tests ?
Ans:-
Unit tests are Apex class methods that verify whether a particular piece of
code is working properly
Unit tests :-
 Take no arguments
 Commit no data to the database
 Are flagged with the testMethod keyword
Unit Test Syntax:-

350.Name some Unit Tests Best Practices ?
Ans:-
Good unit tests should:-
 Cover as many lines of code as possible , including all branches of
conditional logic
o Apex automatically tracks the lines of code that are executed
by the tests and at least 75% of your Apex Scripts must be
covered by unit tests , and all triggers should have some test
coverage
 Complete successfully without throwing unexpected exceptions
 Make liberal use of the System.assert() methods to verify expected
results
 Test triggers by calling DML statements on their objects using the
Database methods

351.What are the different ways of running Unit Tests ?
Ans:-
Unit tests can be run via in the Salesforce UI
 Under Setup | Develop | Apex Classes | Run All Tests
Unit tests can also be run in the Force.com IDE
 Invoked in the Force.com IDE by right mouse clicking on an Apex
based folder or class and selecting Force.com | Run Tests
 Results in the Apex Code Test Runner view

352.What are the basic steps for creating an email service ?
Ans:-
Create the shell of an Apex class that implements the
Messaging.InboundEmailHandler interface provided on the Email Service
setup page
Generate an Apex email service domain under Setup | Develop | Email
Services filling out the requisite setting

353.How many inbound emails can all email services combined consume in a
day ?
Ans:-
The total number of messages that all email services combined can process
daily is calculated by multiplying the number of user licenses by 1,000

354.Can an inbound email service process binary attachments as well as plain
text attachments ?
Ans:-
Yes Inbound email supports both text as well as binary attachments

356.Can we send Mass Email outbound via Apex that uses an existing email
template to a group of Contacts ? Users ?
Ans:-
Yes.

357.Do emails sent via Apex to internal Salesforce users count against our org
email limits for the day ?
Ans:-
There is no limit to the number of internal emails per day

358.Can we use a Visualforce page like an email template to provide the body
of our outbound emails ?

359.What is the maximum of total emails can be send to external email
addresses per day ?
Ans:-
Maximum of 1000 total emails can be send to external email addresses per day
Number of external Email Addresses on any one mass email varies by Edition
Force.com IDE Debugging

360.What are the different types of bindings for Visualforce components ?
Ans:-
There are primarily 3 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 components IDs

361.What is a Visualforce controller ?
Ans:-
A Visualforce controller is an Apex class that specifies the data available and
the behaviour when a user interacts with components on a page

362.What are the different types of methods that Visualforce controllers define
?
Ans:-
Controllers typically define different types of methods:-
 Data methods to display data
o Getter methods to retrieve data from the controller
o Setter methods to pass data from the page to the controller
 Action methods to perform logic:-
o Specialized action methods for specific behaviours
o Navigation action methods to take the user somewhere else

363.What are the 3 main types of Visualforce Controllers ? What are they ?
Ans:-
There are 3 main types of Visualforce Controllers :-
 Standard Controllers :- are provided for all standard and custom
objects that are available via the API
o They provide the same basic data and actions that are available
through the API
o There are also standard list controllers to help manage lists of
records
 Custom Controllers :- are coded in Apex completely from scratch
o All data and actions must be provided by the developer
 Controller Extensions :- allow developers to take advantage of the
existing functionality of a controller while extending or overriding the
data or actions it provides
o Data and actions are inherited from the parent controller

364.How can Email logs be requested ?
Ans:-
Email logs can be requested through Setup | Monitoring | Email Log Files
365.What are Visualforce Custom Controllers ?
Ans:-
Visualforce Custom Controllers:-
 Are coded to create custom behaviours or non-standard data sets
 Can be used to create wizards or leverage callouts

366.What are Visualforce Controller Extensions ?
Ans:-
Visualforce Controller Extensions :-
 Add custom behaviour or additional data to standard controllers

Putting it All Together

367.When do you need to go beyond a standard controller and code custom
Apex ?
Ans:-
Standard controllers can often provide all of the functionality and data that you
need for your Visualforce page
However , you may need to start coding your own controller code if you want
to :-
 Override existing functionality
 Make new actions available to the page
 Customize the navigation
 Use HTTP callouts or Web services
 Have greater control for how information is accessed on the page
Standard List Controllers Example

368.If we want to make a callout from a Trigger , how do we do that ?
Ans:-
Use the @future annotation to make Web services callout from a trigger
HTTP Callout Example
369.How can Anonymous blocks can be compiled and executed ?
Ans:-
Anonymous blocks can be compiled and executed through the use of the
executeAnonymous() Web services API Call
From the Salesforce UI the System Log link brings up an execute anonymous
console
From the Force.com IDE the execute anonymous view allows you to enter
Apex and execute it anonymously

370.Name some Asynchronous Limitations ?
Ans:-
No more than 10 method calls per Apex invocation are allowed
No more than 200 future method calls per Salesforce license per 24 hours are
allowed
The parameters specified must be primitive datatypes or collections of
primitive datatypes
Methods with the future annotation cannot take sObjects or objects as
arguments
The @future annotation cannot be used in getter / setter methods or
constructors of Visualforce controllers

371.What are Pattern and Matcher Classes ?
Ans:-
In addition to SOSL searches , Apex supports the use of regular expressions
through its Pattern and Matcher Classes
 These are based on their Java counterparts
 All regular expressions are types as strings

372.What are the features of the 3rd Pary Deployment Tool Snapshot ?
Ans:-
AppExchange partner DreamFactory provides a tool called snapshot
Snapshot enables users to take a ―snapshot of the current state of the
customizations in a Salesforce ORG or Sandbox
Provides a highly visual way to compare and track schema changes over time
Schema ―push feature , which automates change management between
salesforce deployments
Automatically roll customizations from development into the Production
environment

373.Describe a typical Deployment Scenario ?
Ans:-
Develop the org
Incorporate all changes and perform an integration test
Stage the changes into a full , fresh sandbox
Perform full regression and acceptance test
Change control grants approval
Deploy changes to Production and Training environments

385.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
The version settings tab displays the version of each page or component

393.What is the difference between Class and Object in Apex ?
Ans:-
A class is a template or blueprint from which objects are created.
An object is an instance of a class.

394.Where all can you define custom methods ?
Ans:-
You can define custom methods in anonymous blocks , triggers , or in stored
classes

400.What are Build Properties ?
Ans:-
Properties used by Force.com Migration Tool are stored in a build.properties

file

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