Sunteți pe pagina 1din 33

salesforce interview question and

answers
Q. What is workflow ?
A. It is automated process that fired an action based on evalution criteria and rule cretria and
Path : Setup Create Workflow & Approval process

Q. What is trigger ?
A. It is a piece of code that executes before and after a record is inserted or updated. we can
use 20 DML operations in one trigger

Q. What is Wrapper class ?


A. It is a class whose instance are collections of other objects. It is used to display different
object on visualforce pages in same table

Q. What is static resources ?


A. Static resources is used to upload images, zip files, jar files, JavaScript, Css and it is
refered to visual force pages.

Q. What is difference between Output Text and Output Field ?


A. Output Text always display field value as text irresponsive of datatypes such as currency,
lookup ..etc and Output Field is display automatically according to fields datatypes, if it
currency looks currency symbol, if it is lookup type then display as link in pages.

Q. What is difference between Input text and Input field ?


A. Always display field value as text box irrespective of datatypes.Display automatically
according to fields data types

Q. What is difference between datatable and Pageblocktable ?


A. Datatable is used to display records withoutout standrad salesforce look and feel and
Pageblocktable is used to display records with standrad salesforce look and feel

Q. Can we change of class/ trigger in production environment ?


A. No , we cant change class and trigger in production.we can change visualforce pages in
production but page does not have custom controller
Q. What is salescloud ?
A. Sales Cloud refers to the sales module in salesforce.com. It includes Leads, Accounts,
Contacts, Contracts, Opportunities, Products, Pricebooks, Quotes, and Campaigns.

Q. What is service cloud ?


A. Service Cloud refers to the service module in salesforce.com. It includes Accounts,
Contacts, Cases, and Solutions.

Q. Can we change custom financial year to standard fiscal year once it is changed by
administrator ?
A. No, We cannot

Q. What is page layout and Compact layout?


A. Page Layout is used for web application and Compact Layout is used for Mobile
applications

Q. How many ways we can share a record ?


A. Role hierachy, OWD (Organization Wide Default), Manual Sharing, Criteria based
sharing rules and apex sharing.

Q. What is IsBlank and IsNull ?


A. IsNull is support only numbers. IsBlank is support both text and number

Q. What is trigger.new and trigger.old ?


A. Trigger.new returns a list of new version of sObjects records. This Sobjects is only
avaliable insert & update and records only modifed in before triggers

Q. What is Trigger.NewMap and Trigger.OldMap ?


A. Trigger.NewMap is map of new ID versions and Trigger.OldMap is map of old ID
versions

Q. Why do we write test class?


A. To test write class functionality is working or not by using test class. Salesforce does not
allow deployment in production if test coverage is less than 75.

Q. What is Future Annotation ?


A. By using Future Annotation, we can find methods are running asynchronously
Q. How to write custom error in trigger ?
A. By using addError()

Q. What are methods in batch apex ?


A. Start , Execute and Finish methods

Q. Can we lock records in apex ?


A. Yes, we can lock records in apex using for update

Q. What is visualforce Component ?


A. Visualforce Component is a piece of code that can be reused and encapsulated in other vf
pages

Q. How to make field as required in visualforce pages ?


A. By Making Field as required on visualforce page marking as required is equal to true

Q. Can user change his own profile and role ?


A. User can change his role but he cannot change his profile

Q. Can we deliver visualforce page in excel format ?


A. Yes we can convert visualforce into excel format by using content type

Q. How many types of email templates in salesforce ?


A. Text,HTML (Using letterhead ),Custom (Using without Letter head) and Visualforce Page

Q. What is Rollup Summary ?


A. Rollup Summary is used to display the count of child records and calculate the
sum,minimum and maximum of child records.

Q. What is Audit trail ?


A. Audit Trail provides the information or track all the recent setup changes that an
administrator done to organization.It stores the last 6 months data.

Q. What is OWD ?
A. It defines the basic level of access to data records for all users in organization. It helps to
restrict access into data.They are Private,Pubilc Read/write,Public
Read/write/Transfer,Controlled by Parent,Public read only
Q. What are folders in salesforce ?
A. Folders are used to store organization email templates, documents, reports and dashboards

Q. Why use triggers in Salesforce?


A. Apex can be invoked by using triggers . Apex triggers enable you to perform custom
actions before or after changes to Salesforce records, such as insertions, updates, or deletions.
A trigger is Apex code that executes before or after the following types of operations: insert.

Q. What programming language is Salesforce written in?


A. Apex is a proprietary programming language provided by the Force.com platform to
developers similar to Java and C#. It is a strongly typed, object-oriented, case-insensitive
programming language, following a dot-notation and curly-brackets syntax.

Q. What is difference between workflow and trigger in Salesforce?


A. Workflow is automated process that fired an action based on Evaluation criteria and rule
criteria. We can access a workflow across the object. Trigger is a piece of code that executes
before or after a record is inserted or updated. We can use 20 DML operations in one trigger.

Q. How many types of triggers are there in Salesforce?


A. There are two types of triggers: Before triggers are used to update or validate record
values before they’re saved to the database.

Q. What is JavaScript remoting in Salesforce?


A. JavaScript remoting is a tool that front-end developers can use to make an AJAX request
from a Visualforce page directly to an Apex controller. JavaScript remoting allows you to run
asynchronous actions by decoupling the page from the controller and to perform tasks on the
page without having to reload the entire page

Q. What is Apex Param?


A. Basically the apex:param tag is used to pass values from the Visualforce Page to the Apex
Controller.

Q. What is the use of wrapper class in Salesforce?


A. A wrapper or container class is a class, data structure, or an abstract data type whose
instances are a collections of other objects.It is a custom object defined by Salesforce
developer where he defines the properties of the wrapper class.

Q. What is transient keyword in Salesforce?


A. Transient keyword in Apex classes that are serializable, namely in controllers, controller
extensions, or classes that implement the Batchable or Schedulable interface. … Declaring
variables as transient reduces view state size.

Q. What is trigger ?
A. Trigger is piece of code that is executes before and after a record is
Inserted/Updated/Deleted from the force.com database.

Q. What are different types of triggers in sfdc?


A. 1.Before Triggers-These triggers are fired before the data is saved into the
database.2.After Triggers-These triggers are fired after the data is saved into the database.

Q. What are trigger context variables?


A. Trigger.isInsert: Returns true if the trigger was fired due to insert
operation.Trigger.isUpdate: Returns true if the trigger was fired due to update operation.
Trigger.isDelete: Returns true if the trigger was fired due to delete operation.
Trigger.isBefore: Returns true if the trigger was fired before record is saved.
Trigger.isAfter: Returns true if the trigger was fired after record is saved.
Trigger.New: Returns a list of new version of sObject records.
Trigger.Old: Returns a list of old version of sObject records.
Trigger.NewMap: Returns a map of new version of sObject records. (map is stored in the
form of map)
Trigger.OldMap: Returns a map of old version of sObject records. (map is stored in the form
of map)
Trigger.Size: Returns a integer (total number of records invoked due to trigger invocation for
the both old and new)
Trigger.isExecuting: Returns true if the current apex code is a trigger.

Q. What is the difference between Trigger.New and Trigger.NewMap?


A. Trigger.New is Returns a list of new version of sObject records butTrigger.NewMap is
Returns a map of new version of sObject records.

Q. What is the difference between Trigger.New and Trigger.Old?


A. Trigger.New is Returns a list of new version of sObject records andTrigger.Old is Returns
a list of old version of sObject records.

Q. Can we call the callouts from trigger?


A. yes we can. It is same as usual class method calling from trigger. The only difference
being the method should always be asynchronous with @future

Q. What is the recursive trigger?


A. Recursion occurs in trigger if your trigger has a same DML statement and the same dml
condition is used in trigger firing condition on the same object(on which trigger has been
written)

Q. What is the bulkifying triggers?


A. By default every trigger is a bulk trigger which is used to process the multiple records at a
time as a batch. For each batch of 200 records.

Q. What is the use of future methods in triggers?


A. Using @Future annotation we can convert the Trigger into a Asynchrinous Class and we
can use a Callout method.

Q. What is the order of executing the trigger apex?


A. 1. Executes all before triggers.
2. Validation rules.
3. Executes all after triggers.
4. Executes assignment rules.
5. Executes auto-response rules.
6. Executes workflow rules.
7. If there are workflow field updates, updates the record again.
8. If the record was updated with workflow field updates, fires before and after triggers one
more time. Custom validation rules are not run again.
9. Executes escalation rules.
10. If the record contains a roll-up summary field or is part of a cross-object workflow,
performs calculations and updates the roll-up summary field in the parent record. Parent
record goes through save procedure.
11. If the parent record is updated, and a grand-parent record contains a roll-up summary
field or is part of a cross-object workflow, performs calculations and updates the roll-up
summary field in the parent record. Grand-parent record goes through save procedure.
12. Executes Criteria Based Sharing evaluation.
13. Commits all DML operations to the database.
14. Executes post-commit logic. Ex: Sending email.

Q. How do we avoid recursive triggers?


A. Use a static variable in an Apex class to avoid an infinite loop. Static variables are local to
the context of a Web request.

Q. How many triggers we can define on a object?


A. We can write more than one trigger But it is not recommended .Best practice is One
trigger On One object.

Q. What are the soql limitations in apex?


A. Total number of records retrieved by SOQL queries-50,000
Q. What are the transaction limitations in apex?
A. Each execution of a batch Apex job is considered a discrete transaction.
For example, a batch Apex job that contains 1,000 records and is executed without the
optional scope parameter from Database.executeBatch is considered five transactions of 200
records each.
The Apex governor limits are reset for each transaction.
If the first transaction succeeds but the second fails, the database updates made in the first
transaction are not rolled back.

Q. What is the need of batch apex?


A. By using Batch apex classes we can process the records in batches in asynchronously.

Q. What is Database.Batchable interface?


A. The class that implements this interface can be executed as a batch Apex job.

Q. Define the methods in batchable interface?


A. Start:
global Database.Querylocator start (Database.BatchableContext bc){}
Execute:
global void execute(Database.BatchableContext bc,List <p>){}
Finish:
global void finish(Database.BatchableContext bc) {}

Q. What is purpose of start method in batch apex?


A. It collect the records or objects to be passed to the interface method execute.

Q. What is the Database.QueryLocator?


A. If we use a Database.QueryLocator,the governor limit for the total number of records
retrieved by SOQL queries is bypassed. (Default 50,000 It allow up to 50 million records).

Q. What is the iterable<Sobject>?


A. If you use an iterable,the governor limit for the total number of records retrieved by SOQL
queries is still enforced.

Q. What is the use of execute method?


A. Contains or calls the main execution logic for the batch job.

Q. How many times execute method is called?


A. Execute method is called for each batch of records.
Q. What is the scope of execute method?
A. The maximum value for the optional scope parameter is 2,000

Q. Can we call callouts from batch apex?


A. Yes we can call.

Q. Can we call another batch apex from batch apex?


A. Yes you can call a batch apex from another batch apex .Either in start method or in finish
method you can call other batch

Q. How many callouts we can call in batch apex?


A. Batch executions are limited to one callout per execution.

Q. Batch is synchronous or Asynchronous operations?


A. Asynchronous operations.

Q. What is the default size of the batch ?


A. The default batch size is 200 records

Q. What is the Database.BatchableContext?


A. BatchableContext Interface is Represents the parameter type of a batch job method and
contains the batch job ID. This interface is implemented internally by Apex.

Q. How to track the details of the current running Batch using BatchableContext?
A. You can check the AsyncApexJob.Status using the JobId from the
Database.BatchableContext.

Q. How many batch jobs can be added to queue?


A. Queued counts toward the limit of 5.

Q. What is Database.State full interface?


A. To maintain variable value inside the Batch class, Database.Stateful is used.

Q. What is Database.AllowCallouts?
A. To use a callout in batch Apex, you must specify Database.AllowsCallouts in the class
definition. For example:
global class SearchAndReplace implements Database.Batchable<sObject>,
Database.AllowsCallouts{
//Business logic you want by implementing Batchable interface methods
}
Callouts include HTTP requests as well as methods defined with the webService keyword.

Q. What is AsyncApexJob object?


A. AsyncApexJob is Represents an individual Apex sharing recalculation job.Use this object
to query Apex batch jobs in your organization.

Q. When a BatchApexworker record is created?


A. For each 10,000 AsyncApexJob records, Apex creates one additional AsyncApexJob
record of type BatchApexWorker for internal use.
Salesforce Visualforce interview
question and answers
Q. What is Actionsupport in Salesforce?
A. component that adds AJAX support to another component, allowing the component to be
refreshed asynchronously by the server when a particular event occurs, such as a button click
or mouseover

Q. What is Action Region in Salesforce?


A. actionRegion provides an area of a Visualforce page that decides and separates which
components should be processed by the force.com server when an AJAX request is
generated. … We will still use reRender attribute on action component to decide area which
should be rerendered AJAX request completes

Q. What is view state in Salesforce?


A. Viewstate data in encrypted and cannot be viewed tools like firebug. To maintain state in a
Visualforce page, the Force.com platform includes the state of components, field values, and
controller state in a hidden form element. This encrypted string is referred to as the view state
and has a limit of 135KB

Q. What is remote action in Salesforce?


A. Remote action function in salesforce allows user to access any method from any class
through javasrcipt methods, and get the result as a javascript object for further manipulation.
Points to remember while implementing remote action function: Remote action method
should have @RemoteAction annotation

Q. What is Salesforce Actionpoller?


A. Action poller acts as a timer in visualforce page. It is used to send an AJAX request to the
server depending on the time interval (time interval has to be specified or else it defaults to
60 seconds). In the action attribute a controller method gets called

Q. How many records we can print in a Pageblock?


A. There are times where there are more than 1000 records in the collection to be rendered.
When this occurs, the Visualforce collection limit of 1000 is hit and the page doesn’t load

Q. What is future method Salesforce?


A. The Future Annotation is used to execute a method asynchronously in Salesforce. For
example, we can use the future method to make a Web Service callout from an Apex Trigger.
Methods with the future annotation must be static and can only return void data type.
Q. What is Pagereference in Salesforce?
A. The PageReference is one of the most commonly used classes in Visualforce
programming. In general, an instance of the PageReference class can be used to refer to
another web page

Q. For which criteria in workflow “time dependent workflow action” cannot be created?
A. created, and every time its edited

Q. What is the advantage of using custom settings?


A. You dont have to query in apex (fire select query) to retrieve the data stored in custom
settings.

Q. What is the difference between a standard controller and custom controller


A. Standard controller inherits all the standard object properties, standard button
functionalities can be directly used. Custom controller defines custom functionalities, a
standard controller can be extended to develop custom functionalities using keyword
“extensions

Q. Can you have more than one extensions associated with a single page?
A. Yes we can have more than extensions.

Q. If page is having multiple extensions and if two extensions have methods of same name.
Then which method out of these two will be called upon calling from vf page ?
A. The one which is present in the controller defined on the left side will be called.

Q. What are governor limits ?


A. Governor limits are the limits imposed by salesforce so as to avoid monopoly by orgs in
using salesforce shared resources.

Q. How can we implement pagination in visualforce ?


A. use standardset controllers for implementing pagination.

Q. How can you override a list button with a visuaflorce page?


A. Visualforce page should be a list controller that is it should have “recordsetVar” attribute
defined in page tag.

Q. What are different ways of deployment in salesforce ?


A. Change sets, eclipse and ANT
Q. Is it possible to bypass Grant Access Using Hierarchies in case of standard objects ?
A. No. This is default and cannot be changed.

Q. How can you call a controller method from java script ?


A. Use action function component to call controller method from java script.

Q. How can you call a visualforce page from a controller method?


A. Use pagereference object for calling a visualforce page from controller method.

Q. How can you sort a select SOQl query ?


A. Use order by clause in select query for sorting a list of records.

Q. Can ‘set’ store duplicate values in it?


A. No. Set only stores unique values. List can have duplicate values in it.

Q. Can two users have same profiles?


A. Yes

Q. How can you refresh a particular section of a visualforce page?


A. This can be done using reRender attribute

Q. How to get current logged in users id in apex ?


A. Use Userinfo.getuserid() to get the current logged in user’s id in apex.

Q. How to convert a csv file browsed in visualforce page into a string?


A. Use csvfilecontents.tostring(). method to convert blob to string

Q. How to fire dynamic query in soql?


A. Using database.query Example: List accList = Database.query(‘select name from
account’);

Q. What is a bucket field in reports?


A. This field is used for custom grouping of values in a field. This can be used in
summarizing the report.
Q. What are dynamic dashboards ?
A. Dashboards which run for logged in user are dynamic dashboards

Q. Can the dynamic dashboards be scheduled?


A. No they cannot be scheduled.

Q. How can you use custom label; in visualforce page?


A. Use this syntax for accessing custom label in visualforce page – {!$Label.Samplelabel}

Q. What are the types of custom settings in salesforce?


A. List type and Hierarchy type

Q. What are the different types of collections in apex?


A. There are three types of collections in apex language. They are Set, List and Map

Q. What are maps in apex?


A. Map has keys and values. A key points to a single value. Map can be used to store
relationship between two entities. Keys in map are unique. Values can be duplicated.

Q. What are the different types of object relations in salesforce ?


A. They are One to many, Many to many and Master detail

Q. Can you have roll up summary fields in case of parent child relationship?
A. No. These are present only in case of master details relationship.

Q. What is the difference between action function and action support ?


A. Action functions can call controller method from java script, action support adds support
to other components.

Q. What is action poller in visualforce ?


A. Action poller sends AJAX request with a specified time interval.

Q. What are the different types of reports available in salesforce?


A. They are tabular report, Summary Report, Matrix Report and Joined Report
Q. How many active assignments rule can you have in lead/Case?
A. You can have only one active assignment rule at a time.

Q. How do we access static resource in visualforce?


A. Use this syntax for accessing static resource {!$Resource.Testresourcename}

Q. How to enable inline editing in visualforce page ?


A. You can enable inline editing in visualforce page by using component.

Q. What is trigger.new in trigger ?


A. trigger.new is a list of records that are in the context of trigger or becuase of these
records(modification,Creation, deletion) the trigger has been called

Q. How do we bulkify the trigger ?


A. Bulkfification requires iterating over all the records in trigger context\nfor example :
for(account ac: trigger.new)\n{\n// your logic here\n}

Q. How can we get the old value in trigger ?


A. use trigger.old map for getting previous values of fields.

Q. Can we modify records directly in trigger.new ?


A. trigger.new is a read only list, but field values can be changed in case of before trigger.

Q. What does the error “list has no rows for assignment” mean?
A. it means the list you are trying to access has no values in it.

Q. What should we do to avoid view state error in visualforce page?


A. Clear unused collections, define variable as transient.

Q. What is a sandbox org?


A. It is the exact copy of your production org.

Q. What is sosl?
A. select query that can return records of multiple objects as list of lists.
Q. What is the full form of AJAX?
A. it stands for asynchronous java and XML

Q. How can you show a custom error message in trigger?


A. This can be done using addError() method in trigger

Q. What is the use of future annotation?


A. Future method starts execution when Salesforce has resources available.That is for
asynchronous execution.

Q. How to identify if a class is a test class?


A. test class always begins with @isTest

Q. How to convert a blob variable into a string?


A. Use toString to convert blob into string

Q. What are the different methods of batch apex class?


A. Start method, execute method and finish method

Q. What is’ with sharing’ in apex class code?


A. When you use ‘with sharing’, user’s permissions and field-level security are respected. In
case of ‘without sharing’ code runs in system mode.

Q. Can you use dml statement in visualforce compoenent controller ?


A. To use dml in visualforce component you have to declare allowdml=true in visualforce
component otherwise you will get an exception “DML is currently not allowed

Q. Can you write sosl in trigger?


A. Earlier this was not allowed but now sosl are allowed in triggers.

Q. Which are the different access modifiers in apex?


A. Private, Public, Protected and Global are the four access modifiers allowed in apex.

Q. Can you change the master of a detail record in salesforce ?


A. Yes provided you have ticked marked “Allow reparenting” in field setting otherwise the
field is read only and master cannot be changed.
Q. How can you lock records in apex?
A. Use For update in query to lock the record.For example: [select id,name from contact limit
20 For update];

Q. What is visualforce component ?


A. It is a piece of code that can be reused. It can be encapsulated in other visualforce pages.

Q. How can you display the status of an AJAX update request in a visualforce page ?
A. To display AJAX request status we can use component.

Q. How can you access custom label in apex?


A. : Yes, string custLabelstr = System.Label.LabelNamehere

Q. How can you get all the keys of a map variable ?


A. Use method keyset() for this Set idSet = mapname.keyset();

Q. How can you compare values of a picklist field in validation rule?


A. For comparing picklist value use ispickval ISPICKVAL(picklist_field, text_to_compare)

Q. What are the different types of sandboxes in salesforce ?


A. Developer, Developer Pro, Partial Data and Full are the types of sandboxes in salesforce.

Q. How can you make fields required on a visualforce page?


A. mark required = true

Q. How can you implement custom functionality for a standardcontroller visualforce page?
A. This can be done by associating a controller class with that standard controller using
“Extensions

Q. How can you get the current record id in a visualforce page ?


A. use ApexPages.CurrentPage().getparameters().get(‘id’) to get the current record id in
visaulforce page.

Q. Can a user change his own profile in salesforce ?


A. No, a user cannot change change his own profile.
Q. Can a user change his own role?
A. Yes this can be done !!

Q. Reset security token option is unavailable in set up. What could be the reason?
A. If in the profile setting “login ip ranges” have been set up then the option of “reset security
token” is unavailable.

Q. What are the different data types that a standard field record name can have?
A. Record name field can have either of the two data types : Auto Number or Text data type

Q. Can you edit a apex trigger/apex class in production environment ?


A. No apex trigger /class cannot be edited in production.

Q. Can you edit a visualforce page in production environment ?


A. Yes this can be done but cannot be associated with any controller

Q. How can you deliver a visualforce page in excel form ?


A. use contentType=”application/vnd.ms-excel#Contacts.xls” in page component of
visualforce page

Q. What is trigger.new?
A. It is a list of records in current context in a trigger.

Q. How can you create a input field for date on a visualforce page ?
A. To create a input date field on vf page you will have to bind it with a existing date field on
any object.

Q. How can you convert a text to upper string ?


A. stringname.toUppercase();

Q. How can you convert a integer into a string ?


A. string.valueof(integerName);

Q. What are the different types of email templates that can be created in salesforce?
A. Test, HTML (using Letterhead), Custom (without using Letterhead) and Visualforce.
Q. How can you display different picklist values for picklist fields in different page layouts?
A. This can be done using record types.

Q. Can you do a dml in constructor?


A. No this cannot be done.

Q. What are the data types that can be returned by a formula field?
A. They are Checkbox, currency, Date, Date/Time, Number, Percent and Text

Q. Can you create a new profile from scratch ?


A. No, you have to clone from a existing profile and modify the settings as required.

Q. What are custom labels in salesforce?


A. Custom labels are custom text values that can be accessed from apex codes and
visualforce pages.

Q. Can you use sharing rules to restrict data access?


A. No, sharing rule can only give wider access to data it cannot restrict data access.

Q. Can you edit roll up summary field values in a record?


A. No, roll up summary fields are read only and cannot be edited.

Q. How can you create relationship between two objects in salesforce?


A. Relationship can be set up by crating either look up relationship field or master detail
relationship fields on objects.

Q. Can you create a roll up summary field on parent object?


A. Roll up summary fields can only be created if the relationship between objects is master
detail type.

Q. How can you place an entire visualforce page in a different visualforce page?
A. This can be done using include attribute.

Q. How can you hard delete records in apex?


A. use emptyrecyclebin method as below .\nex- delete
myAccList;\nDataBase.emptyRecycleBin(myAccList);
Q. What all data types can a set store?
A. A set can store all primitive data types and sObjects but not collections.

Q. What is the use of offset keyword in a soql query?


A. Using offset keyword return the records starting from desired location in the list. For
example if we specify offset then all the records starting from location onwards would be
returned.

Q. How can you display an image as an field in a detail page of record?


A. This can be done using IMAGE function. A url of the image stored in document should be
given in image function

Q. When a lead is converted into account/contact will the trigger on account/contact fire?
A. In set up we can enable or disable whether triggers should run on conversion.

Q. What happens to contacts when an account is deleted?


A. When an account is deleted all the contacts under it gets deleted.

Q. What is an sObject type?


A. sObject refers to any object that can be stored i force.com platform database. ex. sObject s
= new contact()

Q. How many elements can be stored with in a collection(list,set,map)?


A. There is no limit on the number of elements that can be stored in a collection. However,
we need to consider the heap size limit.

Q. Expand SOQL and SOSL.


A. SOQL- salesforce object query language, SOSL – salesforce object search language.

Q. What is the difference between soql and sosl?


A. SOQL can query records from a single object at a time, while sosl can query records from
multiple objects. SOQL returns a list while SOSL returns list of lists.

Q. How can you query all records using an soql statement?


A. This can be done using ALL ROWS keyword. This queries all records including deleted
records i recyclebin.
Q. What is the use of @future annotation?
A. Using @future annotation with a method executes it whenever salesforce has resources
available.

Q. What is the significance of static keyword?


A. Methods, variables when defined as static are initialised only once when class is
loaded.Static variables are not transmitted as part of view state for a visualforce page.

Q. Can custom setting be accessed in a test class?


A. Custom setting data is not available default in a test class. We have to set seeAllData
parameter true while defining a test class as below. @isTest(seeAlldata=true)

Q. What is the difference between role and profile?


A. Role defines record level access while profile defines object level access.

Q. On which objects can you create Queues?


A. Queues can be created on two standard objects (Lead and case) and also on all custom
objects.

Q. What are the different ways to invoke apex code?


A. Apex code can be invoked using DML operation(trigger), Apex class can be scheduled
using schedulable interface(ex. batch apex), apex code can be run through developer console,
an apex class can be associated with a visualforce page.

Q. Can you create sharing rules for detail objects?


A. No. Detail objects cannot have sharing rules as the detail objects do not have owner field
with them.

Q. How can view state error be avoided?


A. Use transient keyword with variables wherever possible, clear unused collections. Use
form tag in a visualforce page.

Q. Consider that a record meets a workflow criteria for time based workflow action, the
action goes in queue. Later, before the time based action is triggered, the same record gets
modified and the criteria previously met is changed and now it does not meet the workflow
criteria, what happens to the time based action placed in queue?
A. The time based workflow action is removed from the queue and will not get fired.
Q. What is the use of writing sharing rules?
A. Sharing rules extend the record/data access level which is set using OWD, role
hierarchy.Sharing rule cannot restrict the data visibility but can only widen it.

Q. Which all field data types can be used as external ids?


A. An external id can be of type text, number or email type

Q. What is a mini page layout?


A. Mini page layout defines fields and related list to be displayed in hover detail and console
tab. Whenever you hover mouse over any recently viewed record the fields are displayed,
related list isnot displayed(fields can be set in mini page layout).Console tab fields and
related list on the right hand side are also controlled by mini page layout.

Q. What is the use of console view/console tab?


A. Console gives list views and related list records for multiple objects on a single screen
without any customization (visualforce page or controller)

Q. What is @future annotation in apex?


A. It is used to indicate that code should be executed asynchronously when salesforce has
available resources.

Q. What are the different considerations that must be followed when using @future
annotation in apex method?
A. Method must be static, It must return void and method can have argument of type
primitives, collection of primitives or arrays of primitives

Q. What is the difference between List type custom setting and Hierarchy type custom
setting?
A. List type stores static data that can be used in apex code as it is examples could be country
codes,currencies etc.Hierarchy type stores data that may change depending on user,profile or
org wide default

Q. Where can custom setting data be accessed?


A. Custom setting data can be accessed in formula fields,validation rules,workflow
rules,apex,API

Q. What different return types can be returned by SOQL?


A. A SOQL can return List of objects, a single object or an integer
Q. What are the different exceptions in apex?
A. Apex exceptions can be built in or we can also create our own custom
exceptions.Exception class is the super class of all the built in exceptions.So as to create a
custom exception the class name should end with string ‘exception’ and it should extend any
of the built in exception class or other custom exception class

Q. What are governers limit in salesforce?


A. Governers limit are run time limits that are enforced by salesforce. Governers limits are
reset per transaction.

Q. What is an apex transaction?


A. An apex transaction represents set of operations that are executed as a single synchronous
unit.

Q. What does heap in apex mean?


A. Every apex transaction has its heap. Heap is nothing but the garbage collected at the end
of every apex transaction.

Q. How can you expose an apex class as a REST web service in salesforce?
A. An apex class can be exposed as REST web service by using keyword ‘@RestResource’

Q. What are custom controllers?


A. Custom controller is an apex class that implements all of the logic for a vf page without
leveraging standard controller

Q. Can a custom controller class accept arguments?


A. No. A custom controller cannot accept any arguments and must use a no argument
constructor for outer class.

Q. What different type of method can be defined for VF controllers?


A. getter methods, setter methods and action methods

Q. What are getter methods, setter methods?


A. Getter methods retrieve data from controller while setter methods pass data from page to
controller.

Q. What is Organisation Wide Default in salesforce?


A. Organization wide default is used to set default access level for various standard objects
and all custom objects. Default access can be set as Public read only, Public read write,
Public read write and transfer for different objects.

Q. Can you set default access in Organization wide default for detail objects (detail object in
case of master detail relationship)?
A. No, Detail object will always have default access as ‘Controlled by Parent’ and it cannot
be changed.

Q. Can you create sharing rules for detail objects?


A. No, this cannot be done.

Q. Can standard object appear as detail object?


A. No, you cannot have standard object as detail object in case of master detail relationship.

Q. What are the differences between list and set?


A. Set stores only unique elements while list can store duplicates elements.elements stored in
list are ordered while those stored in set are unordered.

Q. Admin What is outbound message in Salesforce?


A. Outbound messaging is part of the workflow rule functionality in Salesforce. Workflow
rules watch for specific kinds of field changes and trigger automatic Salesforce actions, such
as sending email alerts, creating task records, or sending an outbound message

Q. What are Salesforce custom settings?


A. List Custom Settings: A type of custom setting that provides a reusable set of static data
that can be accessed across your organization. Hierarchy Custom Settings: A type of custom
setting that uses a built-in hierarchical logic that lets you personalize settings for specific
profiles or users

Q. Why we use record types in Salesforce?


A. record types is to create a different page layout for different records within the same
object. Each record type has their own values available for a picklist on the object, this is
really where the different business process comes into play and is really useful

Q. What are custom labels in Salesforce?


A. We can use System.Label.labelName to access custom label in apex code. Custom labels
are custom text values that can be accessed from Apex classes or Visualforce pages. The
values can be translated into any language Salesforce supports.
Q. What is Flow interview in Salesforce?
A. A flow interview is a running instance of a flow. A flow is an application built by your
administrator that asks you for inputs and does something in Salesforce based on those
inputs.

Q. what is difference between Master Detail relationship Vs Look up relationship ?


A. Master Detail relationship is the Parent child relationship. In which Master represents
Parent and detail represents Child. If Parent is deleted then Child also gets deleted. Rollup
summary fields can only be created on Master records which will calculate the SUM, AVG,
MIN of the Child records.\nLook up relationship is something like as-a (Containership)
relationship. Where one record has reference to other records. When one record is deleted
then there is no impact on other records.

Q. What is Accounts ?
A. Accounts are companies which your doing business

Q. What is difference between Personal Accounts and business Accounts ?


A. Personal Accounts are solo person or an indivudal customer doing business and Business
Account is company or an organization

Q. What are the different workflow actions available in workflows?


A. They are Field update, Email alert, Send Outbound messages, Create new task

Q. What is whoid and whatid in activities?


A. Whoid is the id of either contact or Lead. Whatid is the id of the related to record in
activity record(standard or custom object)

Q. What is the difference between force.com and salesforce.com?


A. force.com is paas(platform as a service) and salesforce.com is Saas(software as a service)

Q. What is a externalid in salesforce?


A. It is a field which can be used to store a value that is used as a reference for that record in
other system.For example if you have a record in system ‘xyz’ where it is referenced by some
value then that value can be used as external id in salesforce for that record.External id can be
used for upsert operation in data loader.

Q. What happens upon lead conversion ?


A. When lead is converted a contact, account and optionally an opportunity is created.
Q. How can you create a many to many relationship in salesforce?
A. This can be done by creating junction object between the two objects.

Q. What happens to detail record when a master record is deleted?


A. detail record gets deleted.

Q. What happens to child record when a parent record is deleted(look up relationship)?


A. Child record remains undeleted

Q. Can you see a lead which is converted in saleforce UI?


A. The detail record is not seen. But a page, wherein it shows the links for formed account,
contact and opportunity.

Q. What various default accesses are available in OWD?


A. Private, Public Read only, Public read write, Public read write transfer, controlled by
parent, Public full access

Q. Can a user not have a role?


A. Yes, this is possible, Role is not mandatory for user.

Q. Can a user not have a profile?


A. No, a user should always have a profile. Profile is mandatory unlike role.

Q. What is Profile?
A. Profile contains set of permissions and access settings that controls what user can do with
in the organization.

Q. What are permission sets?


A. A set of permissions is given to the users without changing the profile.

Q. What is OWD?
A. OWD’S are base line record level security for objects in the organization.It is used to
restrict access to data.

Q. What is Roles?
A. A role controls the level of visibility that users have to an organization’s data.
Q. What is User?
A. The people who have authenticated username and password to login to the salesforce
successfully.

Q. What is Sharing Rules?


A. These are used to override the OWD permissions. Sharing rules are two types, They are
Based on record owner and Based on createria.

Q. What is the role hierarchy?


A. Role Hierarchy states that higher hierarchy person can see lower hierarchy person records.

Q. Can you override profile permissions with permission sets(i have defined some
permissions in profile,i am trying to use permission sets for the same object,can i override
permissions for a particular object in the permission sets over to the profile?
A. No. Permission Sets are used only to extend the Profile permissions. It never overrides.

Q. I want to have read/write permission for User and read only for User , how can you
achieve?
A. Create a Permission Set with read/write and assign it to User .

Q. I have an OWD which is read only, how all can access my data and I want to give read
write access for a particular record to them, how can i do that?
A. All users can just Read the record.Create a Sharing Rule to give Read/Write access with
“Based on criteria” Sharing Rules.

Q. What is the difference between role hierarchy and sharing rules? will both do the same
permissions?
A. Role Hierarchy states that higher hierarchy person can see lower hierarchy person
records.Sharing Rule is used to extend Role Hierarchy.

Q. Is it possible to delete the user in salesforce?


A. No, once we create an user in salesforce we cannot delete the user record. We can only
deactivate the user record.

Q. How to provide security for Meta-Data files (Schema)?


A. Using Profiles and Permission Sets.

Q. How to give permissions to two fields for different users who belongs to different
profiles?
A. Permission set

Q. What is Grant Access Using Hierarchies?


A. In OWD we have Private but your higher position persons should see that time we go for
Grant Access Using Hierarchies.

Q. How we can change the Grant access using role hierarchy for standard objects?
A. Not possible.

Q. What is manual sharing?


A. Manual sharing is to share a record to a particular user manually.Go to detail page of
record and click on manual sharing button and assign that record to other user with Read or
Read/Write access.Manual Sharing button enables only when OWD is private to that object.

Q. What are the recordtypes?


A. Using recordtypes we can assign different pagelayouts to different users based on their
profiles and To enable different sets of standard/custom picklist values to different users.

Q. Why we are using dataloader?


A. through import wizard we can import upto 50,000 records if we want to insert more than
50,000 records then we use dataloader.through dataloader we can import upto 1 million
records.using import wizard we do only insert,upsert but using dataloader we do
insert,update,upsert,export,export all,delete.
Salesforce Integration Interview
Questions
1. what is integration ?
A. Integration is a process of connecting two applications

2. what is webservices ?
A. Webservices is a functionality or code which helps to us to do integration.

3. what is Protocal ?
A. Protocal is contains set of instructions or rules.

4. How many types of API’s avaliable in salesforce ?


A. SOAP API, REST API, Bulk API and Streaming API.

5. What is Call In and Call Out?

A. Call In is used to exposing our webservices to another users


Call Out is used to invoking or consuming our webservices to others.

6. What is WSDL ?
A. WSDL stands for Webservices Description Langugage.
It contains types, messages,port types and Binding.

7. How SOAP can be accessed ?


A. SOAP can be communicate through WSDL file, without WSDL file we can’t do
integration.
Message format in SOAP is XML

8. How to do callout integration ?


A. Generate WSDL code from class
Path: setup-develop -apex class

9. Limitataions of WSDL file ?


A. File must be in .WSDL extenstion.
Multiple port types and binding will not allowed
Import and Inheritance operations are not supported.

10. What is remote site settings ?


A. Remote site settings is used to authorize the endpoint and allow us to whom integrate(end
user)
11. How manys ways to XML parsing ?
A. They are two ways of XML parsing
1. XML streams
2. XML DOM

12. How to read root element in XML DOM ?


A. getroot element

13.How to read child element in XML DOM ?


A. getchild element

14.How to read all child elements in XML DOM ?


A. getchild elements

15. How to read text between tags ?


A. gettext

16. How SOAP and REST will Communicate ?


A. SOAP will communicate through WSDL file
REST will communicate through HTTP file

17. what are methods in REST


A. HTTPGET, HTTPPUT, HTTPPOST and HTTPDELETE

18. How REST can be accessed or which message format REST supports ?
A. REST supports both XML and JSON

19. What is JSON ?


JSON stands for JavaScript Object Notation. JSON is light weighted than XML
Salesforce lightning interview
question and answers
Q. What is Lightning component framework ?
A. Lightning component framework is UI framework which helps to design dynamic web
apps to mobile and desktop with high responsive

Q. What is use of Lightning component framework ?


A. Lightning component framework helps to design out of box components with rich
ecosystem and high performance. It is also Event-Driven architecture

Q. What are component in Salesforce Lightning ?


A. Components is a piece of code(Building blocks of page) which helps to reusable to
anywhere we want.

Q. Which Framework Lightning Supports ?


A. Lightning Supports (Aura) component-based framework.

Q. How many types of events available ?


A. Component Event Scope of this event is within itself or the parent component of this
event, all the components declared within the parent component would get notified of this
event( managed by the component itself).

Application Event is handled by all components that are subscribed to the event. These events
are essentially a traditional publish-subscribe model.

Q. What is Aura ?
A. Aura is UI framework to built dynamic web apps for mobile and desktop devices into
lightning.

Q. What is SLDS stands for ?


A. Salesforce Lightning Design System.

Q. What is Lightning Bundle?


A. Lightning Bundle contains
Component,Controller,Helper,style,documentation,rerender,design,SVG with it.
Q. To design Lightning components, Do we need to create a custom domain ?
A. Yes, we need to custom domain to built lightning component. By using custom domain
helps use to make our organization more secure while authentication.

Q. Is it mandotary to create custom namespaces to develop lightning components ?


A. No, Its Optional, But if need we can create with Namespace also.

Q. What is Salesforce lightning experience?


A. Lightning Experience is a modern user interface that helps your sales reps sell faster and
your service reps support customers more productively. Lightning Experience includes many
new features and entirely redesigned pages, but not every Salesforce feature is supported in
Lightning Experience.

Q. What is difference between Visualforce Components and lightning components?


A. Visualforce components are page-centric and most of the work is done on the server.
Lightning is designed from the component up, rather than having the concept of a page as its
fundamental unit. Lightning Components are client-side centric, which makes them more
dynamic and mobile friendly.

Q. What is lightning connect?


A. Lightning Connect lets you seamlessly access data from external sources, side-by-side
with your Salesforce data. You can pull data from legacy systems such as SAP, Microsoft
and Oracle in real time, without making a copy of the data in Salesforce.

Q. How do I turn on lightning in Salesforce?


A. From Setup in Salesforce Classic, click Get Started in the Migration Assistant tile at the
top of the menu. On the Turn It On tab in the Migration Assistant, click the button to switch it
to Enabled. That’s it!

Q. What is OData in Salesforce?


A. Lightning Connect enables your users to view and search records that are stored outside
Salesforce, such as data in an enterprise resource planning (ERP) system. To connect to an
external data source, Lightning Connect uses the Open Data Protocol (OData)

Q. What is renderer in lightning component?


A. When a component is rendered or rerendered, the aura:valueRender event, also known as
the render event, is fired. Handle this event to perform post-processing on the DOM or react
to component rendering or rerendering. The event is preferred and easier to use than the
alternative of creating a custom renderer.
Q. What is the use of lightning in Salesforce?
A. Lightning makes it easier to build responsive applications for any device. Lightning
includes these technologies: Lightning components give you a client-server framework that
accelerates development, as well as app performance, and is ideal for use with the Salesforce
mobile app and Salesforce Lightning Experience.

Q. What are the type of events into Salesforce Lightning component?


A. Application Event Scope of this event is throughout the lightning App and any component
which has registered for this event would get a notification.
Component Event Scope of this event is within itself or the parent component of this event,
all the components declared within the parent component would get notified of this event.
System Event- these are the events fired by Salesforces system during the lifecycle of the
lightning app.

Q. What are the basic differences between Application Event and Component Event?
A. Component events are used to do communication between child and parent. They use
bubbling and capture same as used in DOM events. A change in a child component can be
communicated to the parent component via component event.

Application events are used to communicate any change in the component to a broader
audience. Any component who has registered for this event will get a notified.

Q. Which interface we are supposed to implement so that a lightning component can be used
as quick action?
A. We need to implement the following force: lightningQuickAction so that we can use the
component as a Quick Action

Q. Which interface we are supposed to implement so that a lightning component can be used
as a Tab?
A. We need to implement the following force:appHostable so that we can use the component
as a Tab

Q. How can we use a lightning component in a VisualForce Page?


A. A Lightning component can be embed in any webpage using a very powerful and flexible
feature, Lighting out. When used with Visualforce some complexity becomes simpler.
Lightning component can be added to Visualforce page in three steps:
1. We have to first Add the Lightning Components for Visualforce JavaScript library to your
targetted Visualforce page using the tag.
2. Next we have to create and refer a Lightning app which is used to the component
dependencies.
3. Lastly we need to write a JavaScript function which will finally create the the component
on the page using $Lightning.createComponent()
Q. How can we call child component controller method from the parent component controller
method?
A. To call a child components controller method, we need to first create a aura:method which
is publically accessible, aura:method is used to communicate down the containment hierarchy
i.e. parent to child.

Q. How can we use Lightning Components with the Salesforce1 Mobile App ?
A. We need to first make a lightning tab which points to the lightning component we created
and then we have to include that tab in the salesforce1 Mobile Navigation select list and the
newly created tab to it.

Q. Can we make one component inherit styles/CSS from a parent component, or must we
always define it in the component ?
A. Child component inherits the CSS from its arent we do not need to specify it for each
component

Q. What is the use of the aura:method tag in Lightning ?


A. aura:method is used to communicate down the containment hierarchy i.e. parent to child

Q. Can we Include One Lightning component to another ?


A. Yes we can include one Lightning component in another Lightning component

Q. Is there any limit on how many component to have in one Application?


A. There is no limit on number of components defined within an application by salesforce

Q. Is Lightning Components replacing Visualforce?


A. No Lightning component is not replacing Visualforce, Visualforce is still supported by
Salesforce.

Q. What is Aura? Why do we use the aura: namespace in the code?


A. Aura is a UI framework for developing dynamic web apps for mobile and desktop devices.
Aura provides a scalable long-lived lifecycle to support building apps engineered for
growth.Aura supports partitioned multi-tier component development that bridges the client
and server. It uses JavaScript on the client side and Java on the server side.

Q. Do we need a namespace to develop Lightning Components?


A. You can have namespace in your org but it is not necessary to have a namespace to
develop lightning component.

S-ar putea să vă placă și