
Browse [LATEST] Salesforce Lightning Interview Questions
Last updated on 10th Nov 2021, Blog, Interview Questions
Salesforce is the world’s #1 customer relationship management (CRM) platform. Salesforce is the world’s #1 customer relationship management (CRM) platform. These Salesforce Interview Questions have been created especially to get you introduced to the nature of questions you may notice throughout your interview for the subject of Salesforce. As per my expertise, big interviewers rarely plan to ask an appropriate question while your interview, frequently questions start with some essential concept of the subject, and later they proceed based on further analysis and what you answer. We are proceeding to include the top 100 Salesforce Interview questions simultaneously with their complete answers. We will be incorporating Salesforce scenario-based interview questions, Salesforce interview questions for freshers as well as Salesforce interview questions and answers for sophisticated.
1. What does Salesforce do?
Ans:
Salesforce provides CRM software and cloud-based solutions that help enterprises to connect better with their customers. It supports businesses to manage their customer’s data and track their activities efficiently.
2.What are the Salesforce subsidiaries?
Ans:
- Tableau
- Pardot
- Heroku
- Mulesoft
- Demandware Inc
- SalesforceIQ
The following are the major subsidiaries of Salesforce:
3. What is meant by an Object in Salesforce?
Ans:
Objects in Salesforce are used as database tables that are used to store information of an organization. We have two types of objects in salesforce, they are.
Standard Object: These are the objects provided by the salesforce, which include contacts, accounts, opportunities, leads, cases, campaigns, products, contracts, dashboards, etc.
Custom Object: This includes the modifications made to the Salesforce by users. It stores the essential and unique information of an organization. Custom Object includes page layouts, relationship to other objects, custom user interface tab, custom fields, etc.
4. What is meant by App in Salesforce?
Ans:
- Setup —> build—> Create—> App—> Click on new.
An App in Salesforce.com is a container that holds various things such as a logo, name, and a set of required tabs. It is also called a group of tabs that work together to prove the functionality that you are looking for.
In Salesforce, you can customize apps to match your requirements, or you can build new applications by combining custom and standard tabs.
The process to create an app in Salesforce:
By following this procedure, you can build an application. However, you want.
5. What type of apps we can create in SF?
Ans:
We can create two types of Apps in Salesforce:
Custom app:This type of apps can be used in every business scenario. It is widely used in the market.
Console app: This type of app can be used only in the client service business, where we focus on solving the client’s issues. It is not comparatively, widely used in the market.
6. What is Salesforce Standard Fields?
Ans:
- Owner
- Name
- Last modified by
- Created by.
Below mentioned are the Salesforce Standard Fields:
7. What are Audit Fields?
Ans:
Standard fields are nothing but audit fields.
8. What are the benefits of using Salesforce CRM?
Ans:
- Improved organizational understanding.
- Enhanced communication.
- We can understand the customer better and can facilitate better services.
- Salesforce automates the repeated rule-based tasks.
- Improved analytics and dashboards to analyze the data.
- Reduction in cost and cycle time.
- Improves the efficiency of teams.
We get the following benefits by using Salesforce CRM.
9. How many relationships do we have in Salesforce?
Ans:
- Master-detail relationship
- MLookup relationship
- MExternal Lookup
We have three types of relationships in Salesforce, which are:
9. What is a Time Trigger?
Ans:
The computer system executes one or more tasks according to the set of rules and scheduled tasks.
10. How to create many to many relationships in Salesforce?
Ans:
It helps in creating a many-to-many relationship between two objects in Salesforce. Using many-to-many relationships you can connect each record of an object to be linked with multiple records of other objects and vice versa. The junction object helps us in connecting the two selected objects with each other.

11. What is the Fiscal year in Salesforce?
Ans:
The Fiscal year is known as the starting and ending date of a company financial year. We have two types of financial years in Salesforce which are as follows.
1. Standard fiscal year
2. Custom fiscal year

12. What is the main difference between data table vs page block table tags?
Ans:
- It defines inside the page block station or page block
- To design the visual pages uses style sheets
- The required attribute is “value”
- Automatically it will display Column Headers
- No need to mention inside the page block station or page block
- No required value.
- The data will be displayed using custom style sheets.
- we need to specify column headers explicitly.
The differences between the Data table and Page block
Page block:
DataTable:
13. How many ways we can share a record?
Ans:
- Setup → manage users → roles → setup roles → click on ‘add role’ → provide name and save.
- Defines the baseline setting for the organization.
- Defines the level of access to the user can see the other user’s record
- Setup → Security Controls → sharing settings → Click on ‘Edit’
Role Hierarchy :
OWD :
OWD can be Private, Public Read Only, Public Read and Write.
Manual Sharing :
Manual Sharing is sharing a single record to a single user or group of users.
We can see this button detail page of the record and this is visible only when the OWD setting is private.
14. What is the difference between insert() and database .insert()?
Ans:
Using the insert method we can insert the records but if any error occurs in any record system will throw an error insertion fail and none of the records are inserted. If we want to execute partially the success of bulk insert operation we will use database .insert.
15. Can we create a Roll-Up Summary(RUS) field on the master object?
Ans:
Yes. we can create a Roll-Up Summary field on the master object.
16. What is Apex Interface?
Ans:
The interface is a collection of unimplemented methods. This will specify the signature of the method, types of inputs that we pass the method specify what type is given as an output.
Note: Generally the interface methods we give it as global.
17. What are the ways to call the Apex class?
Ans:
- From another class
- From developer console
- From JavaScript links
- From home page components
- By using trigger
- From VisualForce page
Below mentioned are the ways in Salesforce to call Apex class.
18. What is Map Class in Apex Salesforce?
Ans:
- Map Class Contains methods for the Map collection type.
- A Map is a collection of key-value pairs where each unique keymap to a single value.
- Map keys and values can be any data type primitive types, collections, objects, user-defined types, and built-in Apex types.
19. What is Apex Scheduler?
Ans:
It will invoke the Apex classes to run at a specific time.
Anybody who wants to schedule their class they have to implement the schedulable interface.
Schedule Interface: The class that implements this interface can be scheduled to run at different intervals. This interface has several methods that are
- Public void execute(schedulablecontext sc)
- Public class mySchedule implements schedulable
- {
- Public void execute(schedulablecontext sc)
- {
- Account a = new Account(Name = ‘Faraz’)
- Insert a;
- }
- }
20. What are The Types of Apex Triggers in Salesforce?
Ans:
Triggers are divided into 2 types:
Before Triggers: Before Triggers can be used to update or validate values of a record before they are saved to the database.
After Triggers: After Triggers Before Triggers can be used to access field values of the records that are stored in the database and use this value to make changes in other records.
Syntax:- Trigger trigger_name on Object_Name(trigger_events) { Code_block } WHERE trigger_events can be comma
21. What is Apex Managed Sharing?
Ans:
Apex Managed Sharing provides developers with the ability to support an application to share requirements.
This type of sharing is available only with users to modify all data permissions.
Only these users can add/change apex-managed sharing.
Apex Managed Sharing uses a Sharing reason (Apex Sharing Reason)

22. What is the Usage of the apex program within the VisualForce page?
Ans:
When you want to call the apex class on the VisualForce page we have to declare in the following format.
- < Apex : page controller = “class name “ >
Whenever we call a VisualForce page in which the controller attribute is defined it will first create an object for the apex class which is defined in the controller. When an object is created for the apex class first it involves the constructor.
23. What is Sandbox in Salesforce?
Ans:
A Sandbox is defined as a testing environment that is used to test the code or to conduct experiments in an isolated environment without harming the production environment.
24. What is the Syntax of SOQL Statement?
Ans:
- Syntax –
- SELECT field1, field2,…. FROM Object_Type [WHERE condition]
- List accountList = [SELECT ID, Name, FROM Account];
25. Explain briefly about GROUP BY with the syntax?
Ans:
- Syntax: [ GROUP BY field GROUP BY LIST]
With API version 18.0 and later/you can use group by with aggregate functions, such as sum() or max() to summarize the data and enable you to rollup query results rather than having to process the individual records in your code.
26. SOSL Statements In Salesforce Apex?
Ans:
- SOSL statement evaluates the list of sObjects, where each list contains the search results for a particular sobject type, The result lists are always returned in the same order as they were specified in the query.
- If a SOSL query does not return any records for a specified sObject type, the search results include an empty list for that sObject.
- Example: You can return a list of accounts, contacts, opportunities, and leads that begin with the phase map.
- List < list < subject >> search list = [ find ‘map*’ In ALL FIELDS RETURNING Account (ID, Name), contact, opportunity, lead ];
- The syntax of the class on Apex differs from the syntax of the FIND clause in the SOAP API.
- In Apex, the value of the FIND cause is demarcated with single quotes.
- FIND {map*} IN ALL FIELDS RETURNING account [Id,name], contact ,opportunity,lead;
- From search list , you can create arrays for each object returned.
- Account [ ] accounts = (( list < accounts > ) search list [0] );
- Contact [ ] contacts = [( list ) search list [0]) ;
- Opportunity [ ] opportunities = ((list < opportunity> ) search list [2]) ;
- Lead [ ] leads = (( list < lead> ) search list [3]);
Note:
Example:1
FIND ‘map*’ IN ALL FIELDS RETURNING account (Id, Name], Contact, Opportunity, Lead. In the Force.com API, the value of the FIND Clause is demarcated with braces.
27. Explain JavaScript remoting for apex controllers?
Ans:
- The remote method invocation you add to the VisualForce page, written in javascript.
- The remote method definition in your Apex controller class.
- This method definition is written in apex, but there are few differences from normal action methods.
- The response handles callback function you add to or include in your VF page, written in javascript.
Use javascript remoting in VisualForce to call methods in apex controllers from javascript.
Javascript remoting has 3 parts.
28. How to add javascript remoting to a Visualforce page?
Ans:
To use javascript remoting in a Visualforce page, add the request as a javascript invocation with the following form:
Syntax –
- [namespace.] controller.method ( [parameters …] Call back Function, [configuration] );
29. Give some of Configuring javascript remoting requests?
Ans:
Configure a remoting request by proving an object with configuration settings when you declare the remoting request.
JavaScript remoting supports the following configuration parameters.
Name | Datatype | Description |
---|---|---|
Buffer | Boolean | Whether to group requests executed close to each other in time into a single request. The default is true. |
Escap | Boolean | Whether to escape the apex methods response. The default is true. |
Timeout | Integer | The timeout for the Static Resource request in milliSeconds. Default is 30000(30 seconds) |
30. What is a Declarative Approach?
Ans:
Working on a project without code.
31. If one wants to actually compare the variable name in a query what operator should be used?
Ans:
- =: is the operator used to compare.
32. Difference between < apex:inputText / > Vs < apex:inputField / > ?
Ans:
inputField – copy the field from any object and display on a VF page | like copy paste work.
inputText – it will help to create a field from scratch | new creation
33. Difference between SOQL Vs SOSL in salesforce?
Ans:
SOQL- (Salesforce Object Query Language) | SOSL (Salesforce Object Search Language) |
---|---|
Using SOQL we can Search only on one object one time. | Using SOSL we can search on many objects at one time. |
We can query on all fields of any datatype | We can query only on fields whose data type is text, phone, and Email. |
We can use SOQL in the Triggers and the classes. | We cannot use Triggers but can in classes. |
We can perform a DML operation on SQL query results. | We cannot perform DML operations on search results. |
34. What is Future Annotation(@Future)?
Ans:
- Methods with future annotation must be static methods
- Methods with future annotations can only return a void type.
- global class class_name
- {
- @future
- Static void methodname(parameters)
- {
- //body of the method
- }
- }
Use the future annotation to specify that these methods are executed asynchronously.
Syntax:
35. What is the difference between trigger and workflow?
Ans:
Workflow:
- Workflow is an automated process that fired an action based on Evaluation criteria and rule criteria.
- We can access a workflow across the object.
- We cannot perform DML operation on workflow
- We cannot query from database
Trigger:
- A trigger is a piece of code that executes before or after a record is inserted or updated.
- We can access the trigger across the object and related to that objects
- We can use 20 DML operations in one trigger.
- We can use 20 SOQL from the database in one trigger.
36. If we want to share records based on conditions like share records to a group of users. Whose country criteria is India, What are the steps to be followed?
Ans:
- Setup → Security Controls → sharing settings → Click on ‘Edit’
37. Is it possible to edit the VisualForce page in a production environment?
Ans:
Yes, of course! We can create and edit the VisualForce pages in both the production environment and in a sandbox. The only thing you can not do in a production environment with a VisualForce page is adding the unique values for which you need to do this in the sandbox.
38. When two objects are connected with each other using r/s, then on secondary record the relationship will be shown using the field. On the primary record, the relationship will be shown using a related list?
Ans:
- It is used to connect 2 or more objects with each other as per the business requirement.
- It works on standard objects and custom objects.
- It is so simple to type.
- It helps to loosely connect 2 objects.
- It is used whenever we don’t have much strong dependency between 2 objects.
39. There is only 2 MDR allowed per object how many custom levels it can have?
Ans:
It allows three custom levels per object.
(Eg: company → Workers → Sub workers.)
40. What is the Roll-up summary field?
Ans:
We use the Roll-up summary field to calculate the values for the associated records, for example, a related list. We can also use it for creating the values for a master record- according to the values in detail records. But, we must connect the master and the detail with a master-detail relationship.
41. Explain Queues?
Ans:
In Salesforce, Queues help us to distribute, prioritise, and assign the records to the teams for sharing workloads. Queues are applicable to leads, service contracts, custom objects, cases, etc.
42. What are the primary components of the workflow?
Ans:
Following are the primary components of the workflow:
Criteria:
Criteria is the “if” portion of the statement. We have to set criteria for the workflow rule. First, we have to create a workflow rule and later configure the criteria.Action:
Action is the “then” portion of the statement. The action tells us what to do when the criteria are satisfied and occurs after the workflow rule configuration. We can add a time-dependent action or an immediate action for a particular workflow rule.43. What is the Workflow Task and Workflow Alert?
Ans:
Workflow Task
When we have to assign the tasks to a salesforce user, you haunt a workflow task. Workflow task allocates a new task to a role, user, or record owner. It assists us in defining different task parameters like a priority, status, due date, and subject.
Workflow Alert
Workflow Alert is an email that an approval process or a workflow rule creates in the salesforce and transmitted to different recipients.
44. Explain Auto-Response?
Ans:
Auto-Response is about transmitting emails to leads or cases for particular record attributes and promptly responding to customer inquiries or issues by establishing the auto-response rule. At the same time, we can set one rule for a lead and one rule for a case.
45. Explain Custom Labels?
Ans:
In Salesforce, we use custom labels for creating a multilingual application. Using the native language, they give information to users in the form of help texts and error messages. We can define the custom labels as custom text values that we can access from the Apex class or Lightning components and promptly or even the Visualforce page. We can translate these values into the language supported by the salesforce. Through the following path, we can access custom labels:
- Setup->Search Custom Labels in Quick Find Box->Custom Labels
46. Define the Approval process?
Ans:
In Salesforce, the Approval process is a sequence of steps for approving records. An approval process is also helpful for tracking who and when approved or rejected something. It includes different approval models, notifying approvers, and conditional logic for who must support.
47. What is the importance of Salesforce Chatter?
Ans:
Salesforce Chatter is a social networking application that enables us to share information and work cooperatively with each other. It helps us to build greater employee engagement through motivation. Salesforce Chatter also provides a forum throughout the enterprise for sharing fresh ideas and understandings. We can also use the mobile feed for tracking our project.
48. Explain Lightning Message Service(LMS)?
Ans:
Lightning message service is a distinctive salesforce feature that allows interaction between Aura, Lightning Web Components, and Visualforce over the same lightning page. We can use the Lightning message service in Lightning Experience only.
49. What is Pagination, and How can we achieve it?
Ans:
- First: Display the first ten records.
- Previous: Display previous ten records.
- Next: Display the following ten records.
- Last: Display the previous ten records.
For example, if we have to display 100 records over the page.
50. How do we display error messages on the VisualForce Page?
Ans:
To display error messages on the VisualForce Page, we must use:

51. What is the difference between the Custom Objects and Custom Settings?
Ans:
Custom Objects | Custom Settings |
---|---|
Custom Objects store the data in the database. | Custom settings store the data in the Application Cache memory. |
Custom objects have to use SQL queries for fetching the records from the database. | Do not need to use SQL queries for fetching the records. |
In custom objects, all data types exist. | In Custom settings, only confined data types exist when compared to custom objects |
On Custom objects, we can create apex triggers and validation rules. | On List Custom settings, we cannot create apex triggers and validation rules |
We can create a tab for custom objects. | We cannot create a tab for custom settings |
52. Can we customize the Apex in a production organization?
Ans:
We cannot customize Apex in the production organization. We must change and deploy through a sandbox and satisfy test coverage requirements.
53. How can we display the Chatter Feed Record?
Ans:
By using the
54. Explain the Blob variable?
Ans:
- string string1=’test string’;
- Blob blob1 = Blob.valueof(myString);
- String String2 = myBlob.toString();
- System.debug(String2);
Blob variable is the variable that is intended to gather binary data. tostring() converts the blob back into the string.
55. Compare Salesforce Dev 401 with Salesforce Adv Dev 501.
Ans:
Criteria | Salesforce Dev 401 | Salesforce Adv Dev 501 |
---|---|---|
What do we learn? | Building customized applications, analytical functions, etc. | Apex scripts, Developer Console, deploying MVC architecture, etc. |
Who can learn? | Software and IT Professionals | App and CRM Developers, System Admins, etc. |
What is the average annual salary? | US$99,000 | US$141,000 |
56. Define object relationship in Salesforce?
Ans:
In Salesforce, we can link the standard and custom object records in a related list. It is done by the object relationship overview. Various types of relationships can be created to connect specific business cases with specific customers. It is possible to create a custom relationship on an object and define various relationship types.
57. Explain the advantages of Salesforce using the SaaS platform.
Ans:
- Its pay-as-you-go model perfectly suites all customers
- No hassle of infrastructure management
- All applications are accessed via the Internet
- Easy integration between various applications
- The latest features are provided without any delay
- Guaranteed uptime and security
- Scalable performance for various operations
- Ability to access via mobile devices from anywhere
Some of the main benefits of Salesforce SaaS are:
58. What is a Master–Detail relationship?
Ans:
A Master–Detail relationship is basically a parent–child relationship, in which ‘Master’ represents the parent and other details represent the child. If the parent is deleted, then the child also gets deleted. Roll-up summary fields can only be created on Master records, which will calculate the SUM, AVG, and MIN of the child records.
59. What are the Salesforce subsidiaries?
Ans:
- Pardot
- Heroku
- Mulesoft
- Demandware Inc
- SalesforceIQ
The following is the list of some major Salesforce subsidiaries:
60. What is an Audit trail?
Ans:
If an organization has various administrators, the Audit trail lets you track all the recent changes made by other admins. It can store up to 6 months of data.
That’s all for the basic Salesforce interview questions for freshers. Let’s move on to the next section of intermediate Salesforce Lightning interview questions and answers.
61. List various types of reports available in Salesforce?
Ans:
- Tabular report: In this, the grand total is displayed in a table format.
- Matrix report: This is an in-depth report wherein there are both row-based and column-based grouping.
- Summary report: A summary report is a report in which the grouping is on a column basis.
- Joined report: Joining two or more reports into one creates a joined report.
Below are the types of reports available in Salesforce:
62. How many reports can be added to the Salesforce dashboard?
Ans:
A Salesforce dashboard can be seen as a visual and pictorial representation of a dashboard with the facility to add up to 20 reports.

63. What is tab in Salesforce?
Custom tabs let you display custom object data or other web content in Salesforce. When you add a custom tab to an app in Salesforce Classic, it appears as a tab. When you add a custom tab to an app in Lightning Experience, it appears as an item in the app’s navigation bar and in the App Launcher.
64. What is a static resource in Salesforce?
Ans:
A static resource lets us upload content that is in the form of .jar and .zip formats, style sheets, JavaScript, and so on. It is recommended to deploy a static resource rather than uploading files to the Documents tab since it is possible to pack a set of files into a directory hierarchy and upload it. These files can easily be referred to on a Visualforce page.
65. What are the different methods of Batch Apex class?
Ans:
Start method:
- global (Database.QueryLocator | Iterable
Execute method:
- global void execute(Database.BatchableContext BC, list
){}
Finish method:
- global void finish(Database.BatchableContext BC){}
66. Where we can use Lightning Components?
Ans:
- To drag-and-drop Components in the Lightning App Builder and Community Builder.
- To add more Lightning Components to Lightning Pages.
- To add Lightning Components to Lightning Experience Record Pages.
- To override Standard Actions.
We can use Lightning components for various purposes, lets see some of them:
67. What are maps in Apex?
Ans:
Maps are used to store data in the form of key–value pairs, where each unique key maps to a single value.
Syntax:
- Map
68. What is an Apex transaction?
Ans:
An Apex transaction represents a set of operations that are executed as a single unit. These operations include DML operations that are responsible for querying records. All the DML operations in a transaction either get completed successfully or get rolled back completely if an error occurs even in saving a single record.
69. What is the difference between public classes and global classes in Salesforce Apex?
Ans:
A global class is accessible across the Salesforce instance, irrespective of namespaces. Whereas, public classes are accessible only in the corresponding namespaces.
70. What are getter and setter methods?
Ans:
The 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.
71. What are the different types of Reports available in Salesforce?
Ans:
Based on the structural differences, Salesforce has four different types of reports:
Tabular Report | A tabular report displays data in the form of an Excel-like table that provides a list of items with the grand total. |
---|---|
Joined Report | A joined report is a combined report having multiple blocks that show data from different reports, either of the same or of different report types. |
Matrix Report | A matrix report works for 2-dimensions and allows to group records row-wise and column-wise. |
Summary Report | In a summary report, the view is in a table form only, but it has more functionalities like grouping rows (only), viewing subtotals, and creating charts. |
72. What is a junction object?
Ans:
Junction objects help associate two objects. They are custom objects in Salesforce that allow building a Master-Detail relationship established between two different data objects. It uses a many-to-many relationship to link many junction objects to several records.
Example: If a candidate applies for a job, then the job profile can be connected to many applicants, and the candidate can be linked to several other jobs as well. Here, the junction object will be the ‘job profile.’
73. What is the difference between a role and a profile in Salesforce?
Ans:
Role:
A role helps manage and regulate the Salesforce access that affects reports. Also, it allows controlling user visibility over data within an organization. Users who can access the data and perform operations on it are given a specific role. Candidates with a specific role can share the reports with other team members.
Profile:
A profile is an essential component of any organization. Moreover, it is compulsory for all users to verify their identity for legal authorization. It helps secure an organization’s data from illegal visitors. It is not permissible to operate Salesforce without having a profile. It also controls the types of records that a user can see.
74. What are the reasons that can cause data loss in Salesforce?
Ans:
- Altering the date and time
- Converting parameters such as number and currency from other data types
- Importing data that, at times, goes wrong
- Moving the text, URL, or email from the text area
- Altering the auto-number and the checkbox
- Modifying the multi-select picklist to other types
There are various reasons due to which Salesforce data can be lost, and they are as follows:
75. Can you edit an apex trigger/ apex class in the production environment? Can you edit a Visualforce page in the production environment?
Ans:
No, we cannot modify apex classes and triggers directly in the production environment. It should be done first in Developer edition or testing org or in Sandbox org. Then, an user with Author Apex permission can deploy it in production, which overwrites the last version.
Visualforce pages can easily be generated and modified in Sandbox and in production too, if it does not consist of a Custom Controller.
76. Distinguish between ISBLANK () AND ISNULL ()?
Ans:
- ISBLANK ()- relevant for data type like- number.
- ISNULL ()- relevant for data type like- number and text both.
77. Define Record Type?
Ans:
Distinct pick list values and fields can be shown by assigning the page layouts for different profiles.
78. What do you understand by workflow in Salesforce?
Ans:
Workflow in Salesforce allows you to automate standard internal procedures and processes for saving time across your organization. It helps to evaluate records as they are created or updated and determines if an automated action needs to occur. Automation functions in Salesforce include the functions such as sending follow-up emails, tracking the customer map journey, performing other marketing activities to boost the sales of the company, etc.
A workflow rule is a major container for a set of workflow instructions. These instructions are usually summed up in an if/then statement. Workflow rules are divided into two main components. They are:
Criteria: The “if” part of the “if/then” statement i.e., what must be true of the record for the workflow rule to execute the related actions.
Actions:
The “then” part of the “if/then” statement i.e., what to do when the record meets the criteria. Consider an example for a workflow, “if it is raining, then bring an umbrella”. In this example, the criteria are “it is raining” and the action is “bring an umbrella”. If the criteria aren’t met, then the action isn’t executed. The workflow rule’s actions are executed only when a record meets all the criteria of a workflow rule.
79. What is trigger in Salesforce?
Ans:
- trigger TriggerName on ObjectName (trigger_events)
- trigger TriggerName on ObjectName (trigger_events)
- {
- code_block
- }
The trigger is defined as an Apex code that executes to perform custom actions, before or after modifications like insert, update, delete, etc. that has done to records in Salesforce.
Triggers can be defined for top-level standard objects, like contact or account, custom objects, and few standard child objects. They are active by default when created. When the specified database events occur, Salesforce automatically fires active triggers.
The syntax for creating a trigger is given below:
To execute a trigger before or after insert, update, delete and undelete operations, specify multiple trigger events like before insert, before delete, after insert, after update etc. in a comma-separated list.

80. What is the difference between static and dynamic dashboards in Salesforce?
Ans:
Static dashboards | Dynamic dashboards |
---|---|
These are the default dashboards that are visible to any user | Dynamic dashboards show data tailored for a specific user |
It is used to show organizational-wide data to a set of users | It is used to show a single user’s specific data, such as the number of sales closed, leads converted, etc. |
It can be scheduled to automatically refresh its data | We can’t schedule dynamic dashboard because when the dashboard is opened by us, it will display the real-time generated data |
81. What is junction object in Salesforce?
Ans:
Junction objects are useful in building many-to-many relationships between objects in Salesforce.
Consider an example of recruiting application, where a position for a job is linked to many candidates or a candidate can apply for many other jobs. Here, a third-party object “job application” is referred to as a junction object in order to connect the data model. In the above-given example, “job application” is the junction object.

82. What are Permission sets?
Ans:
A Permission Set is a collection of settings or permissions that is used to give access to numerous tools and functions for the user. You can use permission sets for different types of users to extend functional access without changing their profiles. Instead of creating a separate profile each time, you could easily create a Permission Set.
83. What are the different types of reports available in Salesforce?
Ans:

84. What is dashboard in Salesforce?
Ans:
A dashboard in Salesforce is a pictorial representation of the report. It displays data from source reports as visual components. These components provide a snapshot of key metrics and performance indicators of the organization at a single glance. A single dashboard is capable of displaying 20 reports at a time.
85. Explain skinny table. What are the considerations for skinny table?
Ans:
- It can contain an utmost of 100 columns.
- It cannot hold fields from other objects.
- For full sandboxes, these skinny tables are copied to your full sandbox organizations. For other types of sandboxes, skinny tables are not copied into your sandbox organizations. To have production skinny tables to be activated, contact Salesforce customer support.
- The below figure displays an Account view, a corresponding database table along with a skinny table that can speed up account queries.
Skinny tables in Salesforce are useful in accessing the fields which are frequently used and to avoid joins. This can improve the performance of certain read-only operations such as reports, list views, etc. Skinny tables are highly effective because skinny tables will be in sync with source tables even when the source tables are modified.
You need to contact Salesforce customer support if you want to use skinny tables. You cannot create, access, or modify skinny tables yourself. For example, you need to contact Salesforce to update your skinny table definition if you want to add new fields.
Considerations for skinny tables are:

86. What do you mean by a sandbox in Salesforce?
Ans:
A sandbox is a copy of the production environment/ organization and it is used for the purpose of testing and development. It’s very useful because sandboxes are completely isolated from your Salesforce production organization, so it allows you to test out new ideas on the duplicate database without disturbing the original production environment.
You can use the sandbox whenever you want to test a newly formed Force.com application or Visualforce page. Instead of testing it directly in production, you can develop and test it in the sandbox organization. Using this, you can develop the application without any difficulty and then migrate the metadata and data to the production environment. Doing this in a non-production environment permits developers to freely test and experiment with the newly created applications.

87. Explain the various types of object relationships in Salesforce.
Ans:
An object relationship in Salesforce can be defined as a two-way link or association between two or more objects. Relationships are created by generating custom relationship fields on an object. Due to this, whenever a user views the records, they are also able to see and access related data. The various types of object relationships in Salesforce are:

88. What is Future annotation(@future)?
Ans:
- Future annotations are used to specify methods that are executed asynchronously.
- Methods having future annotation must be static methods and can only return a void type. The arguments specified must be primitive data types or arrays of primitive data types or collections of primitive data types. These methods cannot take sObjects or objects as parameters.
- When you specify a method with @future annotation, it will be executed only when Salesforce has available resources.
- For example, you can use future annotation while making an asynchronous web service callout to an external service. Whereas without the usage of future annotation, web service callout will be created from the same thread which is executing the Apex code, and no additional processing will take place until that callout is complete (synchronous processing).
- global class class_name
- {
- @future
- Static void methodname(parameters)
- //body of the method
- {
- }
- }
89. What are the different types of email templates available in Salesforce?
Ans:
- All the users in the organization are allowed to create or change these templates.
- Only administrators and users with the “Edit HTML Templates” permissions are able to create these templates based on a letterhead. The look and feel of your HTML email templates are defined by the letterheads. It can inherit the logo, text, and color settings from a letterhead.
- It is an extension of HTML with a letterhead. Administrators and users having “Edit HTML Templates” permissions can create custom HTML templates without using the letterhead. You must have knowledge about HTML or get the HTML code to insert it into your email template.
- Administrators and developers are allowed to create these templates by using Visualforce. Visualforce templates provide advanced functionalities like merging with a recipient’s data, where the content of a template can have data from multiple records.
The list of different types of email templates that can be created in Salesforce is given below:
Text:
HTML with letterhead:
Custom HTML:
Visualforce:
90. What are Governor Limits in Salesforce?
Ans:
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. The below image will help you relate to this concept.

91. What are the different types of email templates that can be created in Salesforce?
Ans:
The different types of Email templates are listed in the below table:-
Text | All users can create or change this template |
---|---|
HTML with letterhead | Only Administrators and users having “Edit HTML Templates” permissions can create this template based on a letterhead. |
Custom HTML | Administrators and users having “Edit HTML Templates” permissions can create this template without the need of a letterhead |
Visualforce | Only administrators and developers can create this template. Advanced functionalities like merging data from multiple records is available only in this template |
92. What is a bucket field in reports?
Ans:
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.
93. What happens to detail record when a master record is deleted? What happens to child record when a parent record is deleted?
Ans:
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.
94. How many active assignment rules can you have in a lead/ case?
Ans:
Only one rule can be active at a time.
95. How many records can a select query return? How many records can a SOSL query return?
Ans:
- The Governor Limits enforces the following:-
- Maximum number of records that can be retrieved by SOQL command: 50,000.
- Maximum number of records that can be retrieved by SOSL command: 2,000.
96. What is an attribute tag? What is the syntax for including them?
Ans:
An attribute tag is a definition of an attribute of a custom component and it can only be a child of a component tag.
Note that you cannot define attributes with names like id or rendered. These attributes are automatically created for all custom component definitions. The below piece of code shows the syntax for including them:

97. What are the three types of bindings used in Visualforce? What does each refer to?
Ans:
- 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 Visualforce components.
There are three types of bindings used in Salesforce:-
98. What all data types can a set store?
Ans:
Sets can have any of the following data types:
- Primitive types
- Collections
- sObjects
- User-defined types
- Built-in Apex types
99. What is an sObject type?
Ans:
An sObject is any object that can be stored in the Force.com platform database. Apex allows the use of generic sObject abstract type to represent any object.
For example, Vehicle is a generic type and Car, Motor Bike all are concrete types of Vehicle.
In SFDC, sObject is generic and Account, Opportunity, CustomObject__c are its concrete type.
100. What is the difference between public and global class in Apex?
Ans:
Global class is accessible across the Salesforce instance irrespective of namespaces.
Whereas, public classes are accessible only in the corresponding namespaces.