Salesforce Interview Questions and Answers

1. What is the list view?
Answer: After clicking on the tab on the top of the page we can see views, by default we can see the value called ‘all’. If we click on ‘Go’ beside that all we can see all the records of that object. If we want we can create new views. While creating the view we can give the filter conditions so that based on the filter condition only we can see the records.

2. What is Inline editing?
Answer: On the detail page without clicking on the edit button we can edit a particular field if it is not read-only.

3. Explain the term “Data Skew” in Salesforce?
Answer: “Data skew” is a condition which you will encounter when working for a big client where there are over 10,000 records. When one single user owns that many records we call that condition ‘ownership data skew’.
When such users perform updates, performance issues will be encountered because of “data skew”. This happens when a single user/ members of a single role own most of the records for a particular object.

4. Explain the skinny table. What are the considerations for Skinny Table?
Answer: In Salesforce, skinny tables are used to access frequently used fields and to avoid joins. This largely improves performance. Skinny tables are highly effective, so much so that even when the source tables are modified, skinny tables will be in sync with source tables.

Considerations for skinny tables:

  • Skinny tables can contain a maximum of 100 columns.
  • Skinny tables cannot contain fields from other objects.
  • For full sandboxes: Skinny tables are copied to your Full sandbox organizations, as of the Summer 15 release.

5. Mention what are the actions available in workflow?
Answer: Actions available in the workflow are:

  • Email Alert
  • Task
  • Field Update
  • Outbound Message

6. What is the Enhanced list view?
Answer: In list views, we can modify multiple records at a time using Enhanced list views.

7. Which fields are automatically Indexed in Salesforce?
Answer: Only the following fields are automatically indexed in Salesforce:

  • Primary keys (Id, Name and Owner fields).
  • Foreign keys (lookup or master-detail relationship fields).
  • Audit dates (such as System Mod Stamp).
  • Custom fields marked as an External ID or a unique field.

8. What is the search layout?
Answer: Whenever we click on a tab or we click on a lookup icon or search for a record we see only one standard field by default, to enable the remaining fields.

  • To show multiple fields for the records which display under a tab, on object detail page > under Search layouts edit tab and add required fields.
  • To show multiple fields for the records which display when we click on lookup of a field, on object detail page > under Search layouts edit Lookup Dialogs and add required fields.
  • To show multiple fields for the records which display when we search for the records, on object detail page > under Search layouts edit Search Results and add required fields.

9. For which criteria in workflow “time dependent workflow action” cannot be created?
Answer: Time dependent workflow action cannot be created for: “created, and every time it’s edited”.

10. What is the mini page layout and how to enable it?
Answer:  For lookup fields on record detail page we see a link, whenever we put the cursor on that link we see a popup window that displays few fields. To control the visibility of the field, on that lookup field parent object page layout we see a mini page layout that we can control.

11. For which data type we can enable external id?
Answer: Text, Number, Auto number, Email.

12. Mention what are the different types of custom settings in Sales force?
Answer: Different types of custom settings in Salesforce includes:

  • Hierarchy type: Hierarchy custom settings are a type of custom setting that uses built-in hierarchical logic for “personalizing” settings for specific profiles or users.
  • List type: List custom settings are another type of custom setting that provides a reusable set of static data that can be accessed across your organization irrespective of user/ profile.

13. What is the lead process?
Answer: To control the picklist values of the status field on the lead object we should create the lead process.

  • Without selecting the lead process we can’t create the record type for the lead object.

14. What is the advantage of using a custom setting?
Answer: The advantage of using custom settings is that it allows developers to create a custom set of access rules for various users and profiles.

15. What is the sales process?
Answer: To control the picklist values of the stage field on the opportunity object we should create a sales process.

  • Without selecting the sales process we can’t create the record type for opportunity object.

16. How many active assignment rules can you have in a lead/ case?
Answer: Only one rule can be active at a time.

17. What is the Support process?
Answer:  To control the picklist values of the status field on the case object we should create a support process.

  • Without selecting the support process we can’t create the record type for case object.

18. Mention what is the difference between Is Null and Is Blank? 
Answer:

  • Is Null: It supports for a number field
  • Is Blank: It supports for Text field.

19. What is web-to-lead?
Answer:  On the lead object, we can generate the HTML code by selecting lead fields and by mentioning the return URL from a web-to-lead option. The generated HTML code can be hosted on any of the websites. Upon entering the information in those fields and clicking on the submit button that information will be saved into the lead object of the Salesforce.

20. What are custom labels in the Salesforce? What is the character limit of custom labels?
Answer:  Custom labels are custom text values that can be accessed from Apex classes or Visual force pages. The values here can be translated into any language supported by Salesforce.

Their benefit is that they enable developers to create a multilingual application that automatically presents information in a user’s native language.

You can create up to 5,000 custom labels for your organization, and they can be up to 1,000 characters in length.

21. What is the Queue?
Answer: In the queue, we can add a group of users and we can assign the objects to the Queue. After creating the queue one of the lists view automatically created on the objects which are selected for the queue. We can assign this queue as the owner of the records. Later users who are part of that queue can claim the ownership by navigating to the list view corresponding to the queue. In that list view, users who are part of the queue can select the record and click on the accept button so that record ownership will be transferred from queue to accepted person.

22. What is the difference between a Role and Profile in the Sales force?
Answer: As mentioned in one of the previous Salesforce interview questions, a profile will ultimately control access to which records a user has in a Salesforce org. No user can work on the Salesforce org without being assigned a profile. The Profile is therefore mandatory for every user.

The role, however, is not mandatory for every user. The primary function of the Role/ Role hierarchy is that it allows higher-level users in the hierarchy to get access to records owned by lower-level users in the hierarchy. An example of that is Sales Managers getting access to records owned by Sales Reps while their peers do not get access to it. 

23. What is a public group?
Answer: We can add a set of random users in the public group. We can’t assign the public group as an owner of the record. In manual sharing, sharing rules and in list views, we can use public groups.

24. How many callouts to external service can be made in a single Apex transaction?
Answer: Governor limits will restrict a single Apex transaction to make a maximum of 100 callouts to an HTTP request or an API call.

25. What are the Assignment rules?
Answer: On lead and case objects we can create the Assignment rules. Whenever any record is submitted for lead/case if specified condition in the Assignment rule satisfied based on that we can decide the owner of the case/lead. Note: While submitting case/lead we should check for ‘Assign using active assignment rule’ checkbox which will display under the Optional section.

26. What is the difference between a standard controller and a custom controller?
Answer: The standard controller in Apex inherits all the standard object properties and standard button functionality directly. It contains the same functionality and logic that are used for standard Salesforce pages.

A custom controller is an Apex class that implements all of the logic for a page without leveraging a standard controller. Custom Controllers are associated with Visual force pages through the controller attribute.

27. What are the Auto-Response Rules? 
Answer: On lead and case objects we can create the Auto-Response Rules. Whenever any record is submitted for lead/case if specified condition in the Auto-Response Rules satisfied based on that we can decide the email format which should send as auto-response.

28. How many records can a select query return? How many records can a SOSL query return?
Answer: The Governor Limits enforces the following:-

A maximum number of records that can be retrieved by SOQL command: 50,000.

A maximum number of records that can be retrieved by SOSL command: 2,000. Salesforce Admin Training

29. What are the Escalation rules?
Answer: On the case object, we can create an Escalation rule. Based on the priority we can send escalation mails.

30. What are the three types of bindings used in Visual force? What does each refer to?
Answer: There are three types of bindings used in Salesforce:-

  • Data bindings, which refer to the data set in the controller
  • Action bindings, which refer to action methods in the controller
  • Component bindings, which refer to other Visual force components.

Data bindings and Action bindings are the most common and they will be used in every Visual force page.

31. Is it possible to create the Master-Detail Relationship field for the child object which is having existing records?
Answer: No, we cannot create directly. To create first we should create a Lookup relationship then populate the field value for all the records and then convert the lookup a relationship to master-detail relationship.

32. What are the different types of collections in Apex? What are maps in Apex?
Answer: Collections are the type of variables that can be used to store multiple numbers of records.

It is useful because Governor Limits restrict the number of records you can retrieve per transaction. Hence, collections can be used to store multiple records in a single variable defined as type collection and by retrieving data in the form of collections, Governor Limits will be in check. Collections are similar to how arrays work.

There are 3 collection types in Salesforce:

  • Lists
  • Maps
  • Sets

33. Is it possible to convert Master-Detail Relationship to Look Up Relationship?
Answer: If the parent object doesn’t have Roll up Summary fields for the child object then we can convert.

34. What is the difference between the public and global classes in Apex?
Answer: Global class is accessible across the Salesforce instance irrespective of namespaces.

Public classes are accessible only in the corresponding namespaces.

35. Is it possible to delete junction – Object in case of Master – Detail Relationship?
Answer: If the parent objects don’t have Roll up Summary fields for the child object then we can delete.

To delete a child object it should not be referred to in Apex Classes and Apex Triggers.

Later if we undelete the object, Master-detail fields on the junction objects will be converted to look up Fields.

Note:

  • If we delete only the Master-Detail Relationship field from the child object and undelete it from the Recycle Bin then it will be converted to look up a relationship.
  • Parent Object we cannot delete because it will be referred to in the child object.

36. Can two users have the same profile? Can two profiles be assigned to the same user?
Answer: Profiles determine the level of access a user can have in a Salesforce org.

As far as the first part of the question is concerned, Yes. One profile can be assigned to any number of users. Take the example of a Sales or Service team in a company. The entire team will be assigned the same profile. The admin can create one profile: Sales Profile, which will have access to the Leads, Opportunities, Campaigns, Contacts and other objects deemed necessary by the company.

In this way, many users can be assigned the same profile. In case the team lead or manager needs access to additional records/ objects then it can be done by assigning permission sets only for those users.

Answering the second part of the question, each user can only be assigned 1 profile.

37. What will happen if we undelete the deleted Junction Object?
Answer: Master – Detail Relationship data types will be converted to look up relationship data types.

38. Can you edit an apex trigger/apex class in a production environment? Can you edit a Visualforce page in a production environment?
Answer: No, it is not possible to edit apex classes and triggers directly in the production environment.

It needs to be done first in Developer edition or testing org or in Sandbox org. Then, to deploy it in production, a user with Author Apex permission must deploy the triggers and classes using deployment tools.

However, Visualforce pages can be created and edited in both sandboxes and in production.

Only if the page has to do something unique, it would have to be developed via Sandbox.

39. What is Junction Object?
Answer:
A child object which is having master-detail relationships with two different parent object is called a junction object.

Example:

Object1: Department

Object2: Project

Child Object: Employee

  • Field1: Department (Master Detail with Department)
  • Field2: Project(Master Detail with Project)

Note: From the above example we can say Employee Object as Junction Object

40. What are the different types of object relations in salesforce? How can you create them?
Answer: No list of Salesforce interview questions is complete without involving relationships between objects in Salesforce. Relationships in Salesforce can be used to establish links between two or more objects.

The different types of object relationships in Salesforce are:

Master-Detail Relationship (1:n):- It is a parent-child relationship in which the master object controls the behavior of the dependent child object. It is a 1:n relationship, in which there can be only one parent, but many children.

The main concept you need to know is that being the controlling object, the master field cannot be empty. If a record/ field in the master object is deleted, the corresponding fields in the dependent object are also deleted. This is called a cascade delete. Dependent fields will inherit the owner, sharing and security settings from its master.

You can define master-detail relationships between two custom objects, or between a custom object and standard object as long as the standard object is the master in the relationship.

Lookup Relationship (1:n):-

Lookup relationships are used when you want to create a link between two objects, but without the dependency on the parent object. Similar to a Master-Detail relationship, you can think of this as a form of parent-child relationship where there is only one parent, but many children i.e. 1:n relationship.

The difference here is that despite being a controlling field, deleting a record will not result in automatic deletion of the lookup field in the child object. Thus the records in the child object will not be affected and there is no cascade delete here. Neither will the child fields inherit the owner, sharing or security settings of its parent.

Junction Relationship (Many-To-Many):-

This kind of relationship can exist when there is a need to create two master-detail relationships. Two master-detail relationships can be created by linking 3 custom objects. Here, two objects will be master objects and the third object will be dependent on both the objects. In simpler words, it will be a child object for both the master objects.

41. What happens to a detailed record when a master record is deleted? What happens to child records when a parent record is deleted? 
Answer: In a Master-Detail relationship, when a master record is deleted, the detail record is deleted automatically (Cascade delete).

In a Lookup relationship, even if the parent record is deleted, the child record will not be deleted.

42. How to handle comma within a field while uploading using Data Loader?
Answer: In a Data Loader.CSV, if there is a comma in field content, you will have to enclose the contents within double quotation marks: ”

43. What are the examples of non-deterministic Force.com formula fields?
Answer: Before I mention some of the examples, let me give you an introduction to deterministic and non-deterministic formula fields. Formula fields whose value will be static are referred to as deterministic fields. Whereas, formula fields whose value will be changed dynamically or whose values will have to be calculated on the fly, they are referred to as non-deterministic formula fields. A classic example of that is a formula returning the current date and time.

Some examples of non-deterministic fields in Force.com are:

  • Lookup fields
  • Formula fields whose reference spans over other entities
  • Fields having dynamic date functions like:- TODAY() or NOW() Salesforce Training Online

44. What are the different ways of deployment in Salesforce?
Answer:

  1. You can deploy code in Salesforce using:
  2. Change Sets
  3. Eclipse with Force.com IDE
  4. Force.com Migration Tool – ANT/Java-based
  5. Salesforce Package.

45. What is an external ID in Salesforce? Which all field data types can be used as external IDs?
Answer: An external ID is a custom field that can be used as a unique identifier in a record. External IDs are mainly used while importing records/ data. When importing records, one among the many fields in those records needs to be marked as an external ID (unique identifier).

An important point to note is that only custom fields can be used as External IDs. The fields that can be marked as external IDs are TextNumberE-Mail and Auto-Number.

If we delete parent object record all the child object records relationship’s field value will be get deleted. (Entire record won’t be get deleted)

46. What is Trigger.new?
Answer: Triger.new is a command which returns the list of records that have been added recently to the subject. To be more precise, those records will be returned which are yet to be saved to the database. Note that this sObject list is only available in insert and update triggers, and the records can only be modified before triggers.

But just for your information, Trigger. old returns a list of the old versions of the sObject records. Note that this sObject list is only available in update and delete triggers.

47. What all data types can a set store?
Answer:
Sets can have any of the following data types: Primitive types

  • Collections
  • Objects
  • User-defined types
  • Built-in Apex types

48. What are getter methods and setter methods?
Answer:

Get (getter) method is used to pass values from the controller to the VF page.

Whereas, the set (setter) method is used to set the value back to the controller variable.

49. What is an Apex transaction?
Answer: An Apex transaction represents a set of operations that are executed as a single unit. The operations here include the DML operations which are responsible for querying records. All the DML operations in a transaction either complete successfully or if an error occurs even in saving a single record, then the entire transaction is rolled back.

50. What will happen to child records if we delete a parent record in case of Lookup Relationship?
Answer: If we delete parent object record all the child object records relationship’s field value will be get deleted. (Entire record won’t be get deleted)

Example:

Child Object: Employee (Employee object have a Department field which is related to Department Object)

Parent Object: Department

Suppose N number of employee records related to the IT department, if we delete the IT department all the child(Employee) records Department field value related to the IT department will be get deleted.

Note:

Salesforce store deleted records only for 15 days in Recycle bin later it will remove the records permanently.

If we undelete the IT department record from the Recycle bin then all the related child records department field value will be restored.

Leave a Comment

Scroll to Top