Latest Top 20 Salesforce CRM Interview Questions With Answers
1. Can Two Users Have The Same Profile? Can Two Profiles Be Assigned To The Same User?
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 need 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.
2. What Are Governor Limits In Salesforce?
In Salesforce, it is the Governor Limits which controls how much data or how many records you can store in the shared databases. Why? Because Salesforce is based on the concept of multi-tenant architecture. In simpler words, Salesforce uses a single database to store the data of multiple clients/ customers.
To make sure no single client monopolizes the shared resources, Salesforce introduced the concept of Governor Limits which is strictly enforced by the Apex run-time engine.
Governor Limits are a Salesforce developer’s biggest challenge. That is because if the Apex code ever exceeds the limit, the expected governor issues a run-time exception that cannot be handled. Hence as a Salesforce developer, you have to be very careful while developing your application.
Different Governor Limits in Salesforce are:
Per-Transaction Apex Limits
Force.com Platform Apex Limits
Static Apex Limits
Size-Specific Apex Limits
Miscellaneous Apex Limits
Push Notification Limits
3. What Are Dynamic Dashboards? Can Dynamic Dashboards Be Scheduled?
Before we understand dynamic dashboards, let us first understand static dashboards. Static dashboards are the basic dashboard types that will be visible to any user who has made a report out of his data. An example of this is what a Sales manager/ Marketing manager would be able to see on his Salesforce org. In other words, a normal dashboard shows data only from a single user’s perspective. Now comes the concept of dynamic dashboards.
Dynamic dashboards are used to display information which is tailored to a specific user. Let us consider the same example as above. In case the Sales manager wants to view the report generated specific to only one of his team members, then he can use dynamic dashboards.
You can use dynamic dashboards when you want to show user-specific data of a particular user, such as their personal quotas and sales, or number of case closures, or leads converted etc.
You can also use a normal/ static dashboard when you want to show regional or organization-wide data to a set of users, such as a particular region’s sales number, or a particular support team’s performance on case closures.
As far as the second part of the question is concerned, no we cannot schedule a dynamic dashboard. That is because whenever we open the dashboard, it will show the data generated in real-time.
4. What Is A Sandbox Org? What Are The Different Types Of Sandboxes In Salesforce?
A sandbox is a copy of the production environment/ org, used for testing and development purposes. It’s useful because it allows development on Apex programming without disturbing the production environment.
5. What Happens To Detail Record When A Master Record Is Deleted? What Happens To Child Record When A Parent Record Is Deleted?
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.
6. When Can You Use It?
You can use it when you want to test a newly developed Force.com application or Visualforce page. You can develop and test it in the Sandbox org instead of doing it directly in production.
This way, you can develop the application without any hassle and then migrate the metadata and data (if applicable) to the production environment. Doing this in a non-production environment allows developers to freely test and experiment applications end to end.
Types of Sandboxes are:
7. What Is A Bucket Field In Reports?
A bucket field lets you group related records together by ranges and segments, without the use of complex formulas and custom fields. Bucketing can thus be used to group, filter, or arrange report data. When you create a bucket field, you need to define multiple categories (buckets) that are used to group report values.
The advantage is that earlier, we had to create custom fields to group or segment certain data.
8. Explain The Term “data Skew” In Salesforce?
“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.
9. Can You Edit An Apex Trigger/ Apex Class In Production Environment? Can You Edit A Visual Force Page In Production Environment?
No, it is not possible to edit apex classes and triggers directly in 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, Visual force pages can be created and edited in both sandbox and in production.
Only if the page has to do something unique (different values), it would have to be developed via Sandbox.
10. Which Fields Are Automatically Indexed In Salesforce?
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 SystemModStamp).
Custom fields marked as an External ID or a unique field.
11. What Are The Different Data Types That A Standard Field Record Name Can Have?
A standard field record name can have data type of either auto number or text field with a limit of 80 chars.
For generating auto numbers, the format needs to be specified while defining the field and after that for every record that is added, the number will get auto generated.
12. For Which Criteria In Workflow “time Dependent Workflow Action” Cannot Be Created?
Time dependent workflow action cannot be create for: “created, and every time it’s edited”
13. What Is Who Id And What Id In Activities?
Who ID refers to people. Typically: contacts or leads.
What ID refers to objects.
14. What Are The Types Of Custom Settings In Salesforce? What Is The Advantage Of Using Custom Settings?
There are two types of custom settings in Salesforce: List Custom Settings and Hierarchy Custom Settings.
List Custom Settings are a type of custom settings that provides a reusable set of static data that can be accessed across your organization irrespective of user/ profile.
Hierarchy Custom Settings are another type of custom settings that uses built-in hierarchical logic for “personalizing” settings for specific profiles or users.
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 Difference Between A Role And Profile In Salesforce?
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.
Role however is not mandatory for every user. The primary function of the Role/ Role hierarchy is that it allows higher level users in hierarchy 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.
16. What Is An External Id In Salesforce? Which All Field Data Types Can Be Used As External Ids?
An external ID is a custom field which 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 need 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: Text, Number, E-Mail and Auto-Number.
17. Why Do We Need To Write Test Classes? How To Identify If A Class Is A Test Class?
Software developers from around the world will unanimously agree that writing code in test classes makes debugging more efficient. That is because test classes help in creating robust and error-free code be it Apex or any other programming language. Since Unit tests are powerful in their own right, Salesforce requires you to write test classes in Apex code.
Because test classes and test methods verify whether a particular piece of code is working properly or not. If that piece of code fails, then developers/ testers can accurately locate the test class having the faulty bug.
Test classes can be determined easily because every test class will be annotated with isTest keyword. In fact, if we do not annotate a test class with isTest, then it cannot be defined as a test class. Similarly, any method within a class which has the keyword test method is a test method.
18. What Is The Difference Between A Standard Controller And A Custom Controller?
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.
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.
19. What Is The Use Of “@future” Annotation?
Future annotations are used to identify and execute methods asynchronously. If the method is annotated with “@future”, then it will be executed only when Salesforce has the available resources.
For example, you can use it while making an asynchronous web service callout to an external service. Whereas without using the annotation, the web service callout is made from the same thread that is executing the Apex code, and no additional processing will occur until that callout is complete (synchronous processing).
20. What Is Trigger.new?
Trigger.New is a command which returns the list of records that have been added recently to the subjects. To be more precise, those records will be returned which are yet to be saved to the database. Note that this subject list is only available in insert and update triggers, and the records can only be modified in before triggers.
But just for your information, Trigger. old returns a list of the old versions of the subject records. Note that this subject list is only available in update and delete triggers.