Salesforce Interview Questions

Top most important Salesforce interview questions and answers by Experts:

Here is a list of Top most important Salesforce interview questions and answers by Experts.If you want to download Salesforce interview questions pdf free ,you can register with RVH techguru. Our experts prepared these Salesforce interview questions to accommodate freshers level to most experienced level technical interviews.

If you want to become an expert in Salesforce ,Register for Salesforce online training here.

 

1) For which criteria in workflow “time dependent workflow action” cannot be created?
Created, and every time it’s edited

2) What is the advantage of using custom settings?
You dont have to query in apex (fire select query) to retrieve the data stored in custom settings.

3) What are the different workflow actions available in workflows?
     1. Field update

     2. Email alert

     3. send Outbound messages

     4. Create new task

4) What is whoid and whatid in activities?
    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)

5) What is the difference between a standard controller and custom controller
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 “extenssions”

6) Can you have more than one extenssions associated with a single page?
     Yes we can have more than extenssions.

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

8) What are governer limits ?
Governer limits are the limits imposed by salesforce so as to avoid monopoly by orgs in using salesforce shared resources.

9)how can we implement pagination in visualforce ?
Use standardset controllers for implementing pagination.

10) What is the difference between force.com and salesforce.com

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

11) What is a externalid in salesforce

It is a field which can be used to store a value that is used as a refernce 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

12) What happens upon lead conversion ?

When lead is converted a contact, account and optionally an opportunity is created.

13) What are different ways of deployment in salesforce ?

 Change sets, eclipse and ANT

14) How can you override a list button with a visuaflorce page?

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

15) Is it possible to bypass Grant Access Using Hierarchies in case of standard objects ?

 No. This is default and cannot be changed.

16) How can you call a controller method from java script ?

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

17) How can you call a visualforce page from a controller method?

 Use pagereference object for calling a visualforce page from controller method

18) How can you sort a select SOQl query ?

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

19) How much code coverage is needed for deployment?

Each trigger should have minimum of 1%. Class can have 0%. But, the total code covergae of 75%.

20) Can ‘set’ store duplicate values in it?

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

21) Can two users have same profiles?

Yes

22) How can you refresh a particular section of a  visualforce page?

This can be done using reRender attribute

23) How can you create a many to many relationship in salesforce

This can be done by creating junction object between the two objects.

24) What happens to detail record when a master record is deleted?

Detail record gets deleted.

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

Child record remains undeleted

26) How to get current logged in users id in apex ?

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

27) How to convert a csv file  browsed in visualforce page into a string.

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

28) How many records can a select query return ?
 As of now it can return upto 50000 records.

29) How many records can a sosl query return ?

As of now it can return upto 2000 records

30)How to fire dynamic query in soql?

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

31) What is a bucket field in reports?

This field is used for custom grouping of values in a field. This can be used in summarising the report.

32) What are dynamic dashboards ?

Dashboards which run for logged in user are dynamic dashboards

33) Can the dynamic dashboards be scheduled?

No they cannot be scheduled.

34) How can you use custom label; in visualforc page?
Use this syntex for accessing custom albel in visualforce page – {!$Label.Samplelabel}

35) What are the types of custom settings in salesforce?
List type and Heirarchy type

36) What are the different types of collections in apex?
Ans: There are three types of collections in apex language

1. Set
2. List
3. Map

37) What are maps in apex?

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

38) What are the different types of object relations in salesforce ?

1. One to many
2. Many to many
3. Master detail

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

40) Can you see a lead which is converted in saleforce UI

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

41) What is the difference between action function and action support ?

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

42) What is action poller in visualforce ?

Action poller sends AJAX request with a specified time interval.

43) What are the different types of reports available in salesforce?

1. tabular report
2. Summary Report
3. Matrix Report
4. Joined Report

44) How many active assignments rule can you have in lead/Case?

You can have only one active assignment rule at a time

45) How do we access static resource in visualforce?

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

46) How to embed a visaulflow in a visualforce page ?

Use this syntex to embed flow in vf page : <flow:interview />

47) How to enable inline editing in visauflorce page ?

You can enable inline editing in visualforce page by using <apex:inlineEditSupport> component.

48) What is trigger.new in trigger ?

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

49) How do we bulkify the trigger ?

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

50) How can we get the old value in trigger ?
Use trigger.old map for getting previous values of fields.

51) Can we modify records directly in trigger.new ?

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

52) What does the error “list has no rows for assignment” mean?

It means the list you are trying to access has no values in it.

53) Why should we not write select query within for loop?

Writing select query within for loop may hit the governer limit of 100 select queries.

54) What should we do to avoid view state error in visualforce page?

Clear unused collections, define variable as transient.

55) What is a sandbox org?

It is the exact copy of your production org.

56) What is sosl?

Select query that can return records of multiple objects as list of lists

57) How many records a select query soql can return?

As of now the limit is 50000

58) What is the full form of AJAX?

It stands for assynchronous java and XML

59) Why do we need to write test classes?

Salesforce does not allow deployment in production if the test coverage is less than 75%

60) How can you show a custom error message in trigger?
This can be done using addError() method in trigger

61) What is the use of future annotation?

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

62) How to identify if a class is a test class?

Test class always begins with @isTest

63) How to convert a blob variable into a string?

Use to String to convert blob into string.

64) What are the different methods of batch apex class?
Start method, execute method and finish method

65) What is’ with sharing’ in apex class code?
When you use ‘with sharing’, user’s permissions and field-level security are respected. In case of ‘without sharing’ code runs in system mode.

66) How many records can a sosl return ?

It can return 2000 records as of now as per governers limit

67) Can you use dml statement in visualforce compoenent controller ?

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”

68) Can you write sosl in trigger>?

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

69) Which are the different access modifiers in apex?

1. Private

2. Public

3. Protected

4.Global are the four access modifiers allowed in apex

70) Can you change the master of a detail record in salesforce ?

Yes provided you have ticked marked “Allow reparenting” in field setting otherwise the field is read only and master cannot be changed.

71) How can you lock records in apex?

Use For update in query to lock the record. For example: [select id,name from contact limit 10 For update];

72) IS there any limit on the number of items that can be stored in apex collections?

There is ni such limit but we need to consider heap size limit 6mb (6 MB as of now)

73) How can you monitor future actions of time based workflow?

setup –> administration set up –> monitoring –> time based workflow

74) What is visaulforce component ?

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

75) Ho can you display the status of an AJAX update request in a visualforce page ?

To display AJAX request status we can use <apex:actionstatus> component.

76) How can you access custom label in apex:

Example –> string custLabelstr = System.Label.LabelNamehere

77) How can you get all the keys of a map variable ?
 USe method keyset() for this

78) What are the different types of sandboxes in salesforce ?
Developer, Developer Pro, Partial Data and Full are the 4 types of sandboxes in salesforce.

79) With what frequency can you refresh a full copy sandbox?

Full copy sandbox can be refreshed every 29 days from production.

80) How can you make fields required on a visualforce page?

mark required = true as done in the example below:
<apex:inputfield value=”{!account.Description}” required=”true”/>

81) What is minimum coverage for every trigger for deployment?

Every trigger should have a minimum coverage of 1%. Total coverage should be 75%

82) What is minimum coverage for every class for deployment?

There is no such requirement. A class can have 0% but the total coverage should be >75%

83) How can you implement custom functionality for a standardcontroller visualforce page?

This can be done by associating a controller class with that standard controller using “Extenssions”

84) How can you get the current record id in a visualforce page ?

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

85) Can a user change his own profile in salesforce ?

No, a user cannot change change his own profile !!

86) Can a user change his own role?

Yes this can be done !!

87) Reset security token option is unavailabel in set up. What could be the reason?

If in the profile setting “login ip ranges” have been set up then the option of “reset security token” is uanvailbale.

88) How can you skip record type selection page(and take up default record type) while creating new record of a aprticular object ?

Just tickmark against the object by navigating to following :
set up –> my personal information — > Record type selection –> check against the required object

89) What are the different data types that a standard field record name can have?

Record name field can have either of the two data types : Auto Number or Text data type

Example = Set<id> idSet = mapname.keyset();

90) How can you compare values of a picklist field in validation rule?

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

91) Can you edit a apex trigger/apex class in production environment ?

No apex trigger /class cannot be edited in production.

92) Can you edit a visuaflorce apge in production environment ?

Yes this can be done.

93)How can you deliver a visualforce page in excel form ?
Use contentType=”application/vnd.ms-excel#Contacts.xls” in page component of visualforce page

94) What is trigger.new?

It is a list of records in current context in a trigger.

95) What does it mean when you get the error “too many soql queries 101 salesforce”

 It means you are hitting the limit of 100 soql queries as per governers limit

96) How can you create a input field for date on a visualforce page ?

 To create a input date field on vf page you will have to bind it with a existing date field on any object.

97) How can you convert a text to upper string ?

stringname.toUppercase();

98) How can you convert a integer into a string ?

string.valueof(integerName);

99) What are the different types of email templates that can be created in salesforce?

Test, HTML (using Letterhead), Custom (without using Letterhead) and Visualforce.

100) How can you display different picklist values for picklist fields in different page layouts?

This can be done using record types.