SalesForce-Interview-Questions-and-Answers

SalesForce Interview Questions and Answers

Last updated on 25th Sep 2020, Blog, Interview Question

About author

Nirmal (Salesforce Project Manager )

He is a Proficient Technical Expert for Respective Industry Domain & Serving 9+ Years. Also, Dedicated to Imparts the Informative Knowledge's to Freshers. He Share's this Blogs for us.

(5.0) | 16541 Ratings 924

Salesforce is the fastest-growing software in the CRM space. As stated by Forbes in 2018, Salesforce dominated the worldwide CRM market with a market share of 19.5 %. This is huge when compared with its nearest rival SAP, which has a mere 8.3 % share

No doubt, the demand for Salesforce will increase exponentially only. The salaries of an expert certified Salesforce professional is rising by leaps and bounds.

1. What is the difference between a role and a profile?

Ans:

Profiles are both features that can be added to a user record in Salesforce. Roles are optionally added while Profiles are a basic requirement of setting up a user.

Profiles help to control object privileges such as CRED (Create, Read, Edit, Delete). They also contain system permissions that a user can carry out such as exporting data.

Roles on the other hand help with sharing records across an organisation. They work in a hierarchical fashion, giving users access to records that are owned by people lower down in the hierarchy.

2. Can you name three types of object relationships available in Salesforce?

Ans:

There are three main relationship types in Salesforce…

  • A lookup relationship can be used to link two objects together. It is the most basic type of relationship that creates a child-parent relationship between two objects.
  • A master-detail relationship can also be used to link two objects together. A master-detail relationship creates a tight relationship between the parent and the child. The child record inherits security of the parent, and if the parent is deleted, all associated child records will also be deleted. Master-detail relationships created some extra functionality such as roll-up summary fields that allow you to calculate data on the parent from the children.
  • A many-to-many relationship (Also referred to as a junction object), allows you to create a relationship between two objects that need to model a many-to-many relationship. These are created with an object that has two master-detail relationships to two parent objects.

3. What is SOQL used for?

Ans:

SOQL stands for Salesforce Object Query Language. It is very similar to the widely used language SQL (Structured Query Language), to query databases. SOQL is specifically designed for Salesforce data and is used to query the Salesforce platform to retrieve data. SOQL is used within Apex & Visualforce to return sets of data.

4. What’s the difference between Salesforce.com & Force.com?

Ans:

Salesforce.com is SaaS(Software-as-a-Service) product while Force.com is a PaaS product (Platform-as-a-Service). Salesforce.com has a selection of prepackaged solutions such as the Sales & Service Cloud that are designed for a specific purpose. While Force.com allows you to build your own applications. Salesforce.com is built on the Force.com platform.

5. What options are available to you for deploying from a Sandbox to Production?

Ans:


There are various ways to deploy from Sandbox to Production. The main way is to use a Salesforce feature called Change Sets. These allow you to package up components and then deploying them to another Salesforce Org. There are various other methods including ANT MIgration Tool, Force.com IDE and Unmanaged packages.

6. How are bucket fields used in Salesforce?

Ans:

Bucket fields can be used in Salesforce reports to group together field values. These fields are not created on the Salesforce platform and only exist in in the report itself.

7. What is Apex?

Ans:


Apex is a strongly typed, object-oriented programming language that allows developers to extend the Salesforce platform by writing their own business logic into the platform. Apex looks similar to Java and can be launched through a variety of user-initiated events such as record updates, button clicks, triggers on objects, or external web service requests.

8.Can you customize Apex & Visualforce directly in a production org?

Ans:


Apex cannot be customized in a production Org, it must be changed and deployed through a sandbox and meet test coverage. Visualforce, on the other hand, maybe customized directly in production (Although this is not best practice).

9. What are the two options for when Apex Triggers can run?

Ans:

Apex Triggers can either run before a record has been saved of after. A “before” operation is usually used to verify information that is going to be inserted, and an “after” trigger is used to access data that has previously been entered by a user or system.

10. When should Apex be used over Workflow rules or Process Builder?

Ans:

There are various reasons why you should use Apex over declarative automation options:

  • Workflow rules and Process Builder operations sometimes have feature limitations that can be overcome with Apex. For example, pulling information from an external system
  • When dealing with certain or large sets of data, Apex can be more efficient than declarative options due to less limitations.
Subscribe For Free Demo

Error: Contact form not found.

11. What are Governor Limits? Can you name 3 examples?

Ans:

Salesforce runs on a multitenant environment which means resources (Storage, CPU, Memory) are shared with other companies on the Salesforce platform. This means limits must be in place to ensure that all companies using the Salesforce architecture abide by certain rules and don’t let their code or processes monopolize shared resources. A few examples of Governor Limits are:

  • Total number of records retrieved by a SOQL query – 50,000
  • Total number of SOQL queries issued – 100 (Synchronous) 200 (Asynchronous)
  • Total number of DML statements issued – 150
  • Total number of callouts (HTTP requests or Web services calls) in a transaction – 100
  • Maximum CPU time on the Salesforce servers – 10,000ms (Synchronous) 60,000ms (Asynchronous)

12. What is Apex test coverage? What’s the minimum test coverage required to deploy?

Ans:

To ensure that your code meets certain standards, Apex Code coverage shows you how many executable lines of code in your classes and triggers have been exercised by test methods. Code coverage percentage is a calculation of the number of covered lines divided by the sum of the number of covered lines and uncovered lines. The minimum test coverage required to deploy to production is 75%

13. What are some Apex best practices?

Ans:

  • Bulkify your code
  • Avoid SOQL Queries or DML statements inside FOR Loops
  • Avoid Hardcoding IDs
  • Use of the Limits Apex Methods to Avoid Hitting Governor Limits
  • Querying Large Data Sets

14. What is an Apex Email Service?

Ans:

You can use email services to process the contents, headers, and attachments of inbound emails. For example, you can create an email service that automatically creates contact records based on contact information in messages. 

15. What are the different type of Collections you can have in Apex?

Ans:

There are three main types of Lists – A list is an ordered collection of elements that are distinguished by their indices. List elements can be of any data type—primitive types, collections, sObjects, user-defined types, and built-in Apex types.

  • Sets – A set is an unordered collection of elements that do not contain any duplicates. Set elements can be of any data type—primitive types, collections, sObjects, user-defined types, and built-in Apex types.
  • Maps – A map is a collection of key-value pairs where each unique key maps to a single value. Keys and values can be any data type—primitive types, collections, sObjects, user-defined types, and built-in Apex types.

16. What is Visualforce?

Ans:

Visualforce is the component-based user interface framework for the Force.com platform. The framework includes a tag-based markup language, similar to HTML. Each Visualforce tag corresponds to a coarse or fine-grained user interface component, such as a section of a page, or a field. Visualforce boasts about 100 built-in components and a mechanism whereby developers can create their own components.

17. What is a Static Resource?

Ans:

Static resources allow you to upload content that you can reference in a Visualforce page, including archives (such as .zip and .jar files), images, style sheets, JavaScript, and other files.

18. What is the difference between a standard and custom controller?

Ans:

Standard Controllers are generated automatically for all standard pages. They provide you with all the functionality that a standard page contains, such as editing or saving a record.

Custom Controllers can be written by a developer to override the standard functionality that a standard controller provides on a Visualforce page.

19. What is a Lightning Component?

Ans:

The Lightning Component framework is a UI framework for developing dynamic web apps for mobile and desktop devices. It’s a modern framework for building single-page applications engineered for growth. The framework supports partitioned multi-tier component development that bridges the client and server. It uses JavaScript on the client side and Apex on the server side.

20. Explain the differences between Workflow and Process Builder?

Ans:

Workflows and the Process Builder are declarative automation tools that can be used to extend the Salesforce platforms functionality. Both have point and click functionality and have a variety of functionality and features to automate business processes.

Workflow rules – An automation tool that can evaluate an argument, and kick off an automation function. These functions can include a field update, sending an email message, creating a task, or sending an outbound message. A workflow can only evaluate a single criteria before it either triggers the automation or does not.

Process Builder – The process builder is a newer automation tool that has a wider variety of functions. These include creating a record, updating child records, posting to chatter, launching a flow and more. The process builder can evaluate multiple criteria and trigger different automation depending on the one met.

21. How are sharing rules used in Salesforce?

Ans:

Sharing rules can be set up in order extend sharing, and to grant users access to a set of records depending on a defined criteria. A sharing rule can beset upp to extend sharing to a profile, role or public group depending on either the owner of a record, or a field value. You can either assign Read-Only access to these users, or Read/Write access.

22. Can you explain the use of custom settings?

Ans:

Custom settings are similar to custom objects and enable application developers to create custom sets of data, as well as create and associate custom data for an organization, profile, or specific user. You can use custom settings to store a variety of information that can be accessed easily by other Salesforce tools.

23. Explain the use of a roll-up summary field and where it can be used

Ans:

Roll-up summary fields can be used to calculate information based off of a parent records child records. While a formula field can calculate information within a single record, roll-up summary fields can calculate data from a set of child records. For example, a roll-up summary field could be used to calculate the total value of all closed won opportunities on an account. Roll-up summary fields can only be used on a master-detail relationship.

24. What’s the difference between Record Types & Page Layouts

Ans:

Whilst a page layout is used to define which fields, sections and related lists are displayed to a user, a record type can extend this by defining different business processes. See a full description of the differences.

25. Explain the use of an Outbound Message?

Ans:

An outbound message is one automation function that can fire from a workflow rule. They can send a message to external web services which can contain field values, this can subsequently kick off additional processes in external systems.

26. What is OAuth?

Ans:

OAuth is an open standard for access delegation, commonly used as a way to grant websites or applications access to their information on other websites, but without giving them the passwords.

27. What is a Connected App?

Ans:

A connected app integrates an application with Salesforce using APIs. Connected apps use standard SAML and OAuth protocols to authenticate, provide single sign-on, and provide tokens for use with Salesforce APIs. In addition to standard OAuth capabilities, connected apps allow Salesforce admins to set various security policies and have explicit control over who can use the corresponding apps.

28. Can you give an example of a Salesforce API and it’s usage?

Ans:

Salesforce has a variety of API’s that let you interact with the system in different ways..

REST – The REST API lets you integrate with Force.com applications using simple HTTP methods in either XML or JSON formats, making this an idea API for developing mobile applications or external clients.

Bulk – The Bulk API provides a programmatic access that lets you quickly load data into your Salesforce organisation.

Streaming – The Streaming API can be used to receive notifications for changes to Salesforce data that match a SOQL query you define. Streaming API is useful when you want notifications to be pushed from the server to the client based on criteria that you define.

29. What are External ID fields used for?

Ans:

Certain fields can be defined as an external ID on an object. These can be used in order to match up data from external systems with a unique reference ID. For example, if you need to match up data from an external accounting system to the Accounts in Salesforce, you can use an external ID field to reference the Accounting systems unique ID instead of the Salesforce ID.

30. What is a use case for Salesforce Connect?

Ans:

Salesforce Connect is a product that utilises external objects. External objects allow you to integrate information into Salesforce in real-time, but without actually utilising Salesforce storage limits. An examples of using Salesforce connect could be to integrate a large database that houses transaction history against an account. This history would be viewable and reportable in Salesforce, but without utilising the large amount of storage it would take to the house.

Course Curriculum

Best JOB Oriented Salesforce Training With Integrated Cloud-lab Facility

  • Instructor-led Sessions
  • Real-life Case Studies
  • Assignments
Explore Curriculum

31. What are the skills required to become a Salesforce Developer?

Ans:

A Salesforce Developer is the one with the basic knowledge of the Salesforce platform. They can become a Salesforce Administrator, at a later stage of the career. The developer must know how does Salesforce works.

Moreover, some knowledge is required on basic concepts such as class, object, attributes, etc. The below diagram explains the approaches in the various layers of users, business logic and data model.

Salesforce-Logic-developer

32. What is a Custom Object in Salesforce?

Ans:

Custom Objects are nothing but database tables and are the objects created by you for the storage of information on company or industry. While building a custom object, the Salesforce platform automatically builds things such as page layouts, etc for user interfaces.

For Example,

Property objects that store information on homes sold by a real estate agent.

33. How does Salesforce deploy Sales Tracking?

Ans:

Salesforce records data on details such as sales numbers, customer details, repeat customers & customers served and use these to create detailed reports, charts, and dashboards This way it keeps a track of sales in your organization.

34. What is the difference between isNull and isBlank?

Ans:

Use the ISBLANK() function for text fields. As text fields can never be NULL, even if nothing is provided as a value, ISNULL() function takes only an empty value. If ISNULL() is used with a text field then it returns false.

35. What is the limit of Data.com records which can be added to Salesforce?

Ans:

In the Data.com user’s section, find your name to view your monthly limit. It will give details such as how many records are already added or exported for this month. The user goes to the Setup, enters the User in the Quick Find Box and selects prospector users.

36. What is the difference between Role and Profile in Salesforce?

Ans:

Roles allow to control the access to Salesforce and has an impact on reports. They have control over the visibility level of organizational users. The users of a specific role level can view, edit and report on all the data, shared/owned by the users who fall below in the hierarchy.

Profiles are mandatory for all users. Profile controls the access to which records a user has in the Salesforce org. It is not possible for the users to work in the Salesforce org, without being assigned to a profile.

37. What are the Permission Sets? 

Ans:

A permission set is a collection of settings and permissions for accessing various tools and functions in Salesforce. They are used for the extension of the user’s functional access, without any changes to the profiles. Users can have only one profile but multiple permission sets.

For Example,

A set of users has the same profile called Sales Users. These users have the right to read, create and edit the leads. If some users need to transfer and delete leads, then a permission set is created here.

38. What is the use of SOQL? What are the differences between SOQL and SOSL?

Ans:

The full form of SQOL is Standard Object Query Language. SOQL evaluates to a single sObject and a list of many sObjects or an integer for count method queries. It is used to retrieve data from the Salesforce platform and resides inside Apex or Visualforce and returns a set of data.

The differences between SOQL and SOSL are given below.

SOQLSOSL
It is possible to search only one subject at a time.Multiple objects can be searched here at a time.
Uses “SELECT” keyword for retrieval of records from the database.Uses “FIND” keyword for retrieval of record from database.
It allows to search only one table.It allows to search multiple tables.
It allows to perform DML operations on query results.It is not possible to perform DML on search results.
This is used in a query ( ) call.This is used in a search ()call in the API.
This is used in classes and triggers.This cannot be used in triggers.
Returns records.Returns fields.

39. What are Governor Limits? Give three examples.

Ans:

Salesforce works in a multi-tenant environment and imposes runtime limits to have the same performance within the database. These are imposed by the Apex runtime engine and ensure that the code does not misbehave.

This way the developer is forced to write efficient, scalable code.

Here are some examples of Governor Limits:

  • The total number of SOQL queries issued has a synchronous limit of 100 and an asynchronous limit of 200.
  • The total number of records retrieved for Database getQueryLocator must be limited to 10,000.
  • The total number of records retrieved by a single SOSL query is 2000.

40. What are Workflows in Salesforce? What are the types of Workflow?

Ans:

Workflow in Salesforce is for automating the standard internal processes and procedures and thereby save time across the organization. The main container for a set of workflow instructions is a Workflow Rule. It is possible to sum these instructions as an if/then statement.

There are two components of the workflow rule i.e. criteria and the action. The criteria are the ‘if’ part of the if/then statement and the action is the ‘then’ part of the if/then statement.

For Example,

Send an email alert to the concerned manager, when a contract is about to expire. The workflow rule is run when the criteria are met.

Workflow-Rule

There are two types of workflow in Salesforce:

  • Immediate Actions: It fires immediately when the workflow criteria are met. The associated actions email alerts/field updates also take place with immediate effect.
  • Time-dependent Action: When the criteria are met, the associated actions take place after a certain duration of time. This time is based on a value set.

41. What is Object Relationship in Salesforce? What are Salesforce Relations?

Ans:

In Salesforce, a related list allows us to connect standard and custom object records. This is the purpose served by an object relationship. Various cases can be connected with specific customers through this. One can create a custom relationship too.

The object relations in Salesforce include:

  • Many to many
  • Master-Detail
  • Lookup
  • Hierarchical
  • Indirect Lookup
  • External Lookup

Given below is a diagram to explain Object Relationships:

Salesforce-Logic-developer

42. What is Force.com Platform?

Ans:

Force.com is a Platform As A Service (PAAS) and simplifies the development and deployment of cloud-based applications and websites. The developers make use of the Integrated Development Environment or IDE to create apps and websites. Later, these are deployed in the multi-tenant servers of Force.com.

43. What are the different types of reports that are available in Salesforce?

Ans:

The different types of Salesforce Reports include:

  • Tabular Report: It offers the fastest and simplest way to view your data. They have an ordered set of fields arranged in columns. They cannot create groups of data.
  • Matrix Report: Here the grouping is done based on both rows and columns.
  • Summary Report: Here the groups appear based on columns only.
  • Joined Report: In this, two or more reports are joined in a single report.

44. What is Junction Object? What is it used for?

Ans:

Junction objects are needed to build a many-to-many relationship among Salesforce objects.

For Example,

In a typical recruitment scenario, there are possibilities of creating many positions for candidates and at the same time, a candidate can apply for many positions.

The third object required for creating a data model is termed as a junction object and in this example, it can be cited as “job application”. Here, you need to use a lookup field for both position and candidate object on the junction object – which is a job application.

45. What is an Audit Trail?

Ans:

Administrators need to make changes in the organizational setup. Audit trail history helps you to track the recent 20 changes that are made in setup, by multiple administrators.

46. What is a Dashboard in Salesforce?

Ans:

A dashboard as shown in the above figure summarizes and portrays your Salesforce data in a graphical layout. This offers insights at-a-glance, for any device and for any targeted audience. In this figure, it throws light on the Sales reps of your organization.

Moreover, a dashboard visualizes your business scenario and allows you to make decisions based on the real-time data gathered from reports. A Dashboard has a page layout and displays multiple dashboard components. Multiple reports appear side-by-side on the same dashboard.

47.What is Sandbox org in Salesforce? What are the different types of Sandbox in Salesforce?

Ans:

Sandboxes are for copies of the production organization. It is possible to make such multiple copies of the same environment that serve various purposes like development, testing and training without any need for compromise of data in the production org.

As sandboxes are isolated from the production environment, operations performed in the sandbox have no impact on the production org.

There are four types of Salesforce Sandboxes as shown below:

  • Developer Sandbox
  • Developer Pro Sandbox
  • Partial Data Sandbox
  • Full Sandbox

48. What are the options for deploying from Sandbox to Production org? What is an Outbound Change Set?

Ans:

Various methods are adopted for deploying a sandbox to production. The main method is using the Change Sets. A Change Set enables to create and test a new object in the sandbox and then send that to the production org. It contains information on org and not on any data such as records.

The other methods to deploy sandbox to production org include Force.com IDE, unmanaged packages as well as ANT migration tools.

When sending customizations from current org to another org the Outbound Change Set is used. Once received by the receiving org it is called Inbound Change Set.

49. What are Bucket Fields in Salesforce?

Ans:

Bucket Fields categorize records in Salesforce reports without any need for a formula or a custom field. They exist only in the reports. When a bucket column is created then multiple categories of group report values.

50. What is Custom Label in Salesforce? How many Custom Labels can you define and of what size?

Ans:

Custom Labels enable developers to create multi-lingual applications. It automatically presents information as information or messages, by using the user’s native language. These are custom text values that accessible from Apex classes, Lightning components, and Visualforce pages.

A minimum number of 5000 custom labels can be created for each organization. The size is about 1000 characters.

Course Curriculum

Gain Hands-on Experience with Salesforce Certification Course

Weekday / Weekend BatchesSee Batch Details

51. What is Data Skew in Salesforce?

Ans:

The full form of SOQL is Standard Object Query Language. SOQL evaluates a condition in an enterprise when you require to work with say 10,000 records.

A single user owns a huge number of records and we call that as “ownership data skew” and it causes performance issues while updating in Salesforce.

52. What are the differences between Workflow and Process Builder? What is the difference between Trigger and Process Builder?

Ans:

Workflows and the Process Builder are types of declarative automation tools that can extend the functionality of the Salesforce platform. They have functionalities and features which enable them to automate the business processes.

Workflows can only handle four actions such as email alerts, outbound messages, task creation, and field updates. However, Process Builder has a huge number of functionalities such as creating a record, posting to Chatter, launching a flow, submit approvals, and quick actions.

If a process earlier had different workflows for different outcomes, then the same can be accomplished now with one process.

Moreover, only single criteria are evaluated by a Workflow, before triggering the automation. On the contrary, the Process Builder can evaluate multiple criteria and trigger different automation and all this depend on the criteria met.

53. What are Sharing Rules?

Ans:

Sharing rules extend sharing access to the users in roles, public groups or territories. It gives greater access to the users by making automatic exceptions to the sharing settings for the entire org.

This can be based on record ownership or other criteria. It selects the records to share with the users and the level of access to be given to these users or groups.

For Example,

An account sharing rule can be created based on an account owner or any other criteria such as account type.

54. What is the use of Custom Settings? What are the types of Custom Settings in Salesforce?

Ans:

Custom Settings are similar to the custom objects. The developers create custom data and associate custom data for an organizational profile or a specific user.

The exposure of custom data settings to the application cache is beneficial due to the efficient access with no need for the cost of the repeated queries to the database. This data can be used by SOAP API, validation rule or formula field.

The different types of Custom Settings in Salesforce include:

  • Hierarchy type
  • List type

55. What is the use of Roll-up Summary Field and where can you use it?

Ans:

Roll-up summary field can display a value in a master record based on the fields comprising the detail record. It creates values in related records such as those in the related lists. It can only be used in a master-detail relationship.

For Example,

The sum of all invoices can be calculated for all the related custom object records in the accounts invoice related list.

56. What is the difference between Page Layout and Record Type?

Ans:

Page Layouts control the layout and organization of fields, buttons, visualforce, custom links, s-controls, and related lists on any object record pages. They determine which all fields are visible, read-only, and mandatory. You can customize the content of record pages for users with a Page Layout.

Here is how you create a page layout:

Pagelayout-1

Use drag and drop in the above section to create the page layout.

Record Types help to define different business processes, page layouts, and picklist values that are meant for different users. Here is how a new Record Type is created.

For Example,

A record type can be created with different picklist values for differentiating a sales deal with various service engagements.

Pagelayout and Record-Type-1

57. What is a Wrapper Class in Salesforce?

Ans:

A Wrapper class is defined as a class and a data structure. It is an abstract data type which has its instances formed by a collection of objects.

The basic nature is that of a custom object and is defined by the Wrapper class properties. It allows records to be checked from a list and process them for a specific action.

58. What is the difference between WhoID and WhatID?

Ans:

WhoID refers to people such as contact or leads. Whereas “What ID” refers only to objects.

59. 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<String, String> country_city = new Map<String, String>();

 60. What is an Apex Transaction?

Ans:

An Apex transaction is a set of operations, that is executed as a single unit. These operations include DML operations that are responsible for querying records.

All the DML operations in a transaction get completed successfully or get completely rolled back if an error occurs even in saving a single record.

61. Is it possible to edit Apex Class/Trigger in the Production Environment?

Ans:

No, it is not possible. We cannot directly edit the Apex Class/Trigger in the production environment. It can be done only in the Developer edition, sandbox org or the testing org.

62. What are the ways to call an Apex Class in Salesforce?

Ans:

The various ways to call an Apex class in Salesforce are as follows:

  • From a Developer Console
  • Using Triggers
  • From Visualforce Page
  • With JavaScript Links
  • From Home Page Components
  • From Another Class

63. Is it possible to customize Apex and Visualforce directly from the Production Org?

Ans:

It is not possible to customize Apex in the production org itself, however, it can be changed and deployed through a sandbox, and must meet test coverage. Visualforce, on the contrary, can be changed in the production org.

64. When is it possible to use Apex over Workflow rules or Process Builder?

Ans:

There are various reasons to adopt Apex over Workflow rules or Process Builder as shown below:

  • Apex can be used in those cases where there are limitations for Workflow rules or Process Builder like putting information in external systems.
  • Apex is more efficient while dealing with large sets of data as it has fewer limitations.

65. What is Apex Email Service?

Ans:

When you want to process the content, attachments, and the headers of inbound emails then Apex Email Service is used. It is possible to create an email service that automatically creates contact records based on contact-related information in the messages.

Each of these email services is associated with a Salesforce generated email address, to which the users send messages for processing. It is also possible for multiple users to access a single email service.

A new email service is created as shown below.

Apex Email_service

66. What are the methods of Batch Apex Class?

Ans:

It implements Database batchable interface with three methods as shown below.

a) Start: This is used at the beginning of the batch Apex job. It is used to collect the records or objects, to pass to the interface method execute. It returns the DatabaseQueryLocator object or an iterable that contains the records or objects passed into the job.

b) Execute: This is used for each batch of records that are passed to the method. This method is used for all the processing of data. This method takes the following:

  • A reference to DatabaseBatchableContext Object.
  • A list of sObject records.

c) Finish: This is called once all the batches are processed. This is used for sending confirmation emails or for executing post-processing operations. It uses one argument, which is the reference of the DatabaseBatchableContext object.

Here is an example of a Batch Apex Class:

Batch-Apex-Class

67. What are the types of Collections in Apex? Explain List and Set in Collections.

Ans:

The types of collections in Apex are listed below:

  • List
  • Map
  • Set

The list is a variable that has an ordered collection of elements and they are distinguished by their indices. The index is numeric and starts at zero. Given below is an example of declaring a list, with the list keyword followed by primitive data, sObjects, nested lists, map or set types.

List created

A set is a collection of unordered elements of primitives or sObjects. No element can be retrieved by using an index as in the case of a list. While iterating the elements in a set, there should not be any reliance on the same order. Moreover, a set cannot contain duplicate elements.

Here is an example of a set created with hardcoded string values.

Set created

68. What is Apex Trigger? What is the Syntax of Trigger in Salesforce?

Ans:

Apex Triggers perform custom actions to records in Salesforce, before or after the events. Examples of such actions include insertion, updation, and deletion.

The triggers help to perform operations that are subject to specific conditions such as modifying related records or restricting certain operations. Triggers can be used for anything you do in Apex, executing SOQL or DML or even calling custom Apex methods.

There are two different types of trigger in Salesforce as shown below:

  • Before Trigger: It is executed to validate the record values before saving to the database.
  • After Trigger: It is executed to validate the record values after saving to the database.

69. What is Asynchronous Apex? What are its different types?

Ans:

Asynchronous Apex is used to run processes that are scheduled at a later time. There are four types of Asynchronous Apex.

They are:

  • Future Methods
  • Batch Apex
  • Queueable Apex
  • Schedules Apex

70. How to hide the Header and Sidebar in the Visualforce Page?

Ans:

Visualforce is a framework for the Force.com platform which enables developers to build custom interfaces that can be hosted natively on a lightning platform. It has a tag-based mark-up language like HTML.

Each tag is equivalent to a coarse or fine-grained user interface components such as a page section, a related list or a field. It has 100 built-in components. The developers can create their own components using Visualforce.

The attribute showHeader is set as “false” to hide the header of a Viusalforce page. To hide the sidebar, the sidebar is set as “false”. These two attributes are a part of the Visualforce component <apex page>. The attribute has a Boolean value.

Given below is an example to hide:

headerandsidebar-visualforce
Salesforce Sample Resumes! Download & Edit, Get Noticed by Top Employers! Download

71. How to perform an AJAX request in Visualforce?

Ans:

This can be done by marking the area of a Visualforce page that demarcates which components can be used by the Force.com server by using apex:actionRegion when an AJAX request is generated. Only those components within the body of apex:actionRegion are processed by the server.

72. What is the difference between Standard and Custom Controller?

Ans:

Standard Controllers generate automatically for all standard pages. They contain the same logic and functionalities that are used for any standard Salesforce page. They can be used with standard and custom objects.

Custom Controllers override the standard functionality of a standard controller which appears on a Visualforce page. Apex can be used for writing a custom controller or a controller extension.

73. How can we implement Pagination in Visualforce?

Ans:

Pagination in Salesforce refers to displaying a large number of records that are spread across multiple pages. The list control displays 20 records per page, hence pagination is used to change the page size with controller extension.

When we want to customize, a controller extension is used to set the pageSize.

The code snippet is displayed below:

Pagination-visualforce

The number of records displayed on a page by default is 20. If you want to change the number of records displayed on a page, then just make use of the method pageSize, as shown in the below diagram.

Pagesize-visualforce

74. How to call a Controller Method within a JavaScript?

Ans:

To call a controller method (Apex function) from JavaScript, you need to use actionfunction.

Below is a code snippet for your reference:

Controller-code snippet

75. What are the types of Bindings used in Salesforce?

Ans:

There are three types of bindings used in Salesforce as shown below.

  • Data Bindings: It refers to the data set in the controller.
  • Action Bindings: It refers to the action methods in the controller.
  • Component Bindings: It refers to some other Visualforce components.

76. Can you write Getter and Setter Methods in Salesforce?

Ans:

Yes, we can use a getter method to return values for a controller. Every value calculated by a controller and displayed on a page must have a getter method.

On the other hand, the setter method is used for passing user-specified values from page mark up to the controller. The setter method in a controller is automatically executed, before any actions.

77. What is Lightning Component?

Ans:

The Lightning Component framework is a user interface framework for developing single-page applications for desktop and mobile devices. It is possible to build Lightning components with two programming models i.e. Original Aura Component Model and the Lightning Web Component Model.

It is supportive of partitioned multi-tier component development. It uses JavaScript for the client-side and Apex for the server-side

78. What is a Developer Console?

Ans:

The Developer Console is an integrated development tool which has a collection of tools. These can be used to create, debug and test the applications in Salesforce.org.

79.What are Packages? What are the types of Packages? What are Managed Packages?

Ans:

A package is a bundle/collection of a list of components or related applications.

There are two types of packages:

  • Managed
  • Unmanaged

Managed Packages are used to sell and distribute applications to clients. Developers can sell user-based licenses and applications through the AppExchange for the managed packages. These are fully upgradable. In the case of seamless upgrades, removal of objects or fields is performed.

80. What are the ways to deploy Metadata in Salesforce?

Ans:

The metadata in Salesforce is deployed in the following ways:

  • Change Sets
  • Eclipse with Force.com IDE.
  • com Migration Tool – ANT/Java-based.
  • Salesforce Package

81. What is Trigger.new?

Ans:

Trigger.new is a context variable to return the new versions of the sObject record. The sObject list is only available in insert and update triggers and the records can be modified only before triggers.

82. What is an Attribute? What is a reRender Attribute Tag?

Ans:

The properties of a Visualforce component are named as attributes. Each and every Visualforce component in Salesforce comes with an attribute.For Example, <apex:CommandLink> is one of the attributes.

The reRender attribute specifies a list of elements that can be dynamically updated using AJAX library of Salesforce. There is no need for the entire page to refresh. Only a portion of the page identified by the elements is named in the “rerender” attribute.

83. Which tag is used to create a Button? Which tag is used for a URL link? Which is the tag for Password Protection?

Ans:

  • The tag <apex: commandbutton> is used for the button.
  • The tag used for URL link is <apex: outputLink>.
  • The tag used for password protection is <apex: inputSecret>.

84. What is Obligatory Outer Tag? Which tag is used for displaying a video in the Visualforce?

Ans:

The tag <apex: page> is the obligatory outer tag. The tag<apex: flash> is used to display a video in the Visualforce.

85. How to display a Chatter Feed Record?

Ans:

&

lt;chatter:feed> is the component that is used for the display of chatter feed.

The example given below displays the chatter feed for the currently logged in users.

Chatterfeed-record

86. Explain Exception Catch in a Program.

Ans:

Java has inbuilt exception handling and the normal code goes into the TRY block and the exception handling code into the CATCH block. Use try & catch block for using the code with multiple Java exceptions.

Here is the syntax:

trycatch-exception catch

87. What is an Access Modifier in a Program?

Ans:

Apex uses access modifiers for defining methods and variables. These are private, protected, global or public access modifiers.

Here is an example of an access modifier:

AccessModifiers

88. Which operation does not have Undelete?

Ans:

The before operation does not have Undelete.

89. What is the use of Blob Variable?

Ans:

Blob is a data type that is meant to collect binary data. Tostring() is a method that converts the blob back into a string.

Here is an example that uses this method to print a specific text.

Blob variables

90. How is a link passed in Visualforce?

Ans:

Link is passed in Visualforce through the hyperlink.

91. What is the Purpose of apex:ouputLink?

Ans:

This links to the URL. The body of apex:output link contains an image or text that is displayed in the link.

Given below is an example:

ouputLink-apex

92. What is Static Resource?

Ans:

Static Resource allows you to upload content to reference in the Visualforce page. The resources can be archive files such as .zip or .jar files, stylesheets, images, and JavaScript & other files. The Lightning platform acts as a CDN(Content Distribution Network) and manages and distributes these files.

93. Which tag is used for calling a Controller Name?

Ans:

The tag that is used for calling a controller name is apex: controller.

94. What is a User Interface in Salesforce?

Ans:

Set up the user interface in Salesforce for giving the best working experience for the users. You can modify your org’s user interface by enabling and disabling settings.

95. What is the use of an Outbound Message?

Ans:

An Outbound message is a part of the workflow and is created for a Workflow rule. It helps to send information to a specified URL endpoint. Information contained in the fields is specified during the creation of the outbound message. It sends secure and configurable API messages to a designated listener.

96. What is an API in Salesforce? How can we use it?

Ans:

Salesforce has a set of APIs to access data from Force.com or Database.com.

Some of the uses of these APIs include:

a) SOAP API: It is one of the well-known APIs. It uses SOAP as a wrapper for API operations. It comprises a bulk of the API traffic lies. As tooling is needed to create, SOAP messages are mostly used in enterprise settings.

b) REST API: This is ideal when you want to send a message from a client to a server and send back a response. The REST API enables you to integrate with Force.com applications by using simple HTTP methods and create dynamic interfaces. These methods are in XML or JSON formats. This helps to use the API for developing mobile applications or external clients.

c) Bulk API: It is an asynchronous API and has the ability to manage large sets of data. The programmatic access enables you to quickly load data into the Salesforce org. It cannot be used for a handful of records and is easy to program dynamic API.

d) Streaming: It allows us to create a push topic based on a query and get updates on the query, as the results keep on changing. It is used when the notifications are to be sent from the client to the server based on a defined criterion.

97. What is the use of External ID Fields?

Ans:

External ID contains unique record identifiers for a system outside Salesforce. It is used for importing records. It is a custom field that has an external ID attribute. Once this option is selected, the import wizard detects Salesforce records with the same external ID.

For Example,

While matching accounts in Salesforce with some external accounting system an external ID enables you to access the unique ID of the accounting system and not the Salesforce ID.

98. Which Platform is used for developing an App in Salesforce?

Ans:

The force.com platform is used for developing an App in Salesforce.

Are you looking training with Right Jobs?

Contact Us

Popular Courses