Salesforce Interview Questions and Answers 1649259908

Download as pdf or txt
Download as pdf or txt
You are on page 1of 65

Validation Rule

➢ Condition Based Error message which avoid creation updation of data based in business
rules.
➢ If the criteria is true ,Error message is displayed,if it is false record is Saved
➢ Validation rule is fired when user want to save the record insert/update

Most Popular Business cases of validation rule

1) Logical Errors

Eg1:Startdate < Enddate

Eg2:DOJ<DOB

2)Condition Based Mandatory Fields

Eg1: If type=Employee then Phone is mandatory

3)Format Validation NOT(REGEX())

Eg1:PAN CARD : ABCD-E-1212-R [A-Z]{4}-[A-Z]{1}-[0-9]{4}-[A-Z]{1}

Eg2: Adhaar Card : 1234-1234-1234[0-9]{4}-[0-9]{4}-[0-9]{4}

4)Data Consistency V Lookup

Eg.1.Bank City : Pune – SN ZipCode : 4110055

FORMULAES

Auto calucated at runtime, when you see them

Auto Calculated Fields –1)based on current record values 2) based on parent record values

Not stored in DB

Two parts

1)Formulae expression 2)Return type

Not editable as they are auto calculated

Examples

# 1Age of Case NOW() – CreatedDate Number 2) Age of Consultant todays date – dob 3)Experience of
Consultant --todays date – doj
# 2 Salary Band 1)IF(Salary__c > 10000, “Band A” , “Band B”) Text

# 3Class AssignmentEligible for Promotion

if (salary is grater than 10000 and type is vendor) or (salary < 10000 and type = intern )

Checkbox IF(OR (AND(A,B),AND(C,D))) ,true,false)

Eligible for Bonus IF(AND(ISPICKVAL(Type__c, “Employee”), Salary__c > 10000),true, false) Checkbox

Business Process Automation

Work Flow Rules Process Builder Assignment Rules Approval Process Escalation Rules Auto
Response Rules Queues Public Groups Hirarchical Relationship ( user) Flows

What is User?

So what is a user? A user is anyone who logs in to Salesforce. Users are employees at your company,
such as sales reps, managers, and IT specialists, who need access to the company's records.

Every user in Salesforce has a user account. The user account identifies the user, and the user account
settings determine what features and records the user can access. Each user account contains at least
the following:

Username

Email Address

User's First and Last Name

License

Profile

Role (optional)

What is Profile?

Profiles determine what users can do in Salesforce. They come with a set of permissions which grant
access to particular objects, fields, tabs, and records. Each user can have only one profile. Select profiles
based on a user’s job function (the Standard User profile is the best choice for most users). Don’t give a
user a profile with more access than the user needs to do their job. You can grant access to more items
the user needs with a permission set.

What is Roles?

Roles determine what users can see in Salesforce based on where they are located in the role
hierarchy. Users at the top of the hierarchy can see all the data owned by users below them.
Users at lower levels can't see data owned by users above them, or in other branches, unless
sharing rules grant them access. Roles are optional but each user can have only one. If you have
an org with many users, you may find it easier to assign roles when adding users. However, you
can set up a role hierarchy and assign roles to users at any time. Roles are only available in
Professional, Enterprise, Unlimited, Performance, and Developer editions of Salesforce.

1. What does Salesforce do?

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.

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. The below image will help you
relate to this concept.

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. To learn more about it, enroll for Salesforce
developer certification today.

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
• Email Limits
• Push Notification Limits

3. 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.

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:

• Developer
• Developer Pro
• Partial Copy
• Full

4. Can you edit an apex trigger/ apex class in production environment?


Can you edit a Visualforce 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, Visualforce 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.

5. 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. For
example:-
Sr No-{1}
Sr No-{2}
Sr No-{3}

6. Why are Visualforce pages served from a different domain?

Visualforce pages are served from a different domain to improve security standards and
block cross site scripting.

. What is WhoId and WhatId in activities?

WhoID refers to people. Typically: contacts or leads. Example: LeadID, ContactID

WhatID refers to objects. Example: AccountID, OpportunityID

8. What is the use of writing sharing rules? Can you use sharing rules to
restrict data access?
Sharing rules are written to give edit access (public read and write) or public read
only access to certain individuals in Salesforce org. A classic example is when:- only
your managers or superiors need to be given extra credentials to your records in objects
as compared to your peers.

By default, all users in your organization will have organization-wide-default sharing


settings of either Public Read Only or Private.
To give access to more records, which users do not own, we write sharing rules.
Example: Sharing rules are used to extend sharing access to users in public groups or
roles. Hence, sharing rules are not as strict as organization-wide default settings. They
allow greater access for those users.

As far as the second part of the question is concerned, the answer is no. We cannot use
sharing rules to restrict data access. It is only used for allowing greater access to
records.

9. What are the different types of email templates that can be created in
Salesforce?

The different types of Email templates are listed in the below table:-

Text All users can create or change this template

Only Administrators and users having “Edit HTML Templates”


HTML with letterhead
permissions can create this template based on a letterhead.

Administrators and users having “Edit HTML Templates” permissions


Custom HTML
can create this template without the need of a letterhead

Only administrators and developers can create this template.


Visualforce Advanced functionalities like merging data from multiple records is
available only in this template

C. Audit & Reporting Features – Salesforce Interview Questions


10. 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.

11. 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.

12. What are the different types of reports available in Salesforce? Can
we mass delete reports in Salesforce?

Salesforce Report Types


1. Tabular reports Simple Excel type tables which provide a list of items with the grand total

Similar to Tabular reports, but also have functionality of grouping rows,


2. Summary reports
viewing subtotals & creating charts
Two-dimensional reports which allow you to group records both by row and
3. Matrix reports
column

Multiple blocks showing data from different reports based on same or


4. Joined reports
different report types

Another important point to note here is that, only Summary reports and Matrix reports
can be fed as data source for dashboards. Tabular and Joined reports cannot be used
as data source for dashboards.

Can we mass delete reports in Salesforce? Of Course we can mass delete reports in
Salesforce. The option to mass delete reports can be found under Data Management in
Setup.

D. Data Modelling & Data Management – Salesforce Interview Questions


13. What are the different types of object relations in salesforce? How
can you create them?

No list of Salesforce interview questions is complete without involving relationships


between objects in Salesforce. Relationships in Salesforce can be used to establish
links between two or more objects.

The different types of object relationships in Salesforce are:

1. Master-Detail Relationship (1:n):- It is a parent-child relationship in which the


master object controls the behavior of the dependent child object. It is a 1:n
relationship, in which there can be only one parent, but many children.The main
concept you need to be know is that, being the controlling object, the master field
cannot be empty. If a record/ field in master object is deleted, the corresponding
fields in the dependent object are also deleted. This is called a cascade delete.
Dependent fields will inherit the owner, sharing and security settings from its
master.You can define master-detail relationships between two custom objects,
or between a custom object and standard object as long as the standard object is
the master in the relationship.
2. Lookup Relationship (1:n):-
Lookup relationships are used when you want to create a link between two
objects, but without the dependency on the parent object. Similar to Master-
Detail relationship, you can think of this as a form of parent-child relationship
where there is only one parent, but many children i.e. 1:n relationship.The
difference here is that despite being controlling field, deleting a record will not
result in automatic deletion of the lookup field in the child object. Thus the
records in the child object will not be affected and there is no cascade delete
here. Neither will the child fields inherit the owner, sharing or security settings of
its parent.
3. Junction Relationship (Many-To-Many):-
This kind of a relationship can exist when there is a need to create two master-
detail relationships. Two master-detail relationships can be created by linking 3
custom objects. Here, two objects will be master objects and the third object will
be dependent on both the objects. In simpler words, it will be a child object for
both the master objects.

14. 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.

15. Can you have a roll up summary field in case of Master-Detail


relationship?

Yes. You can have a roll-up summary in case of a master-detail relationship. But not in
case of a lookup relationship.

A roll-up summary field is used to display a value in a master record based on the
values of a set of fields in a detail record. The detail record must be related to the
master through a master-detail relationship.

There are 4 calculations that you can do using roll-up summary field. You can count the
number of detail records related to a master record. Or, you can calculate the sum,
minimum value, or maximum value of a field in the detail records.

16. 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.

17. Explain skinny table. What are the considerations for Skinny Table?

In Salesforce, skinny tables are used to access frequently used fields and to avoid joins.
This largely improves performance. Skinny tables are highly effective, so much so that
even when the source tables are modified, skinny tables will be in sync with source
tables.

Considerations for skinny tables:

• Skinny tables can contain a maximum of 100 columns.


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

18. 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.

19. How to handle comma within a field while uploading using Data
Loader?

In a Data Loader .CSV, if there is a comma in field content, you will have to enclose the
contents within double quotation marks: ” “.

E. Logic & Process Automation – Salesforce Interview Questions


20. 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”.
21. 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 Hierar
chy 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.

22. How many active assignment rules can you have in a lead/ case?

Only one rule can be active at a time.

23. What are custom labels in Salesforce? What is the character limit of
custom label?

Custom labels are custom text values that can be accessed from Apex classes or
Visualforce pages. The values here can be translated into any language supported by
Salesforce.
Their benefit is that they enable developers to create multilingual applications which
automatically presents information in a user’s native language.

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

24. 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.
25. What are the examples of non-deterministic Force.com formula
fields?

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

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

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

F. Software Testing – Salesforce Interview Questions


26. 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. Why? 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.

Why are they so powerful? 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 testMethod, is a test method.

27. What is minimum test coverage required for trigger to deploy?

In Salesforce, if you want to deploy your code to production, then you must make sure
that at least 75% of your Apex code is covered by unit tests. And all these tests must
complete successfully.
G. Debug & Deployment Tools – Salesforce Interview Questions
28. What are the different ways of deployment in Salesforce?

You can deploy code in Salesforce using:

1. Change Sets
2. Eclipse with Force.com IDE
3. Force.com Migration Tool – ANT/Java based
4. Salesforce Package

H. Integration – Salesforce Interview Questions


29. 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.

30. How many callouts to external service can be made in a single Apex
transaction?

Governor limits will restrict a single Apex transaction to make a maximum of 100
callouts to an HTTP request or an API call.

31. How can you expose an Apex class as a REST WebService in


Salesforce?

You can expose your Apex class and methods so that external applications can access
your code and your application through the REST architecture. This is done by defining
your Apex class with the @RestResource annotation to expose it as a REST resource.
You can then use global classes and a WebService callback method.

Invoking a custom Apex REST Web service method always uses system context.
Consequently, the current user’s credentials are not used, and any user who has
access to these methods can use their full power, regardless of permissions, field-level
security, or sharing rules.
Developers who expose methods using the Apex REST annotations should therefore
take care that they are not inadvertently exposing any sensitive data.

I. Programmatic Features – Advanced Salesforce Interview Questions and


Answers for Experienced Professionals
32. 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 Visualforce
pages through the controller attribute.

33. How can we implement pagination in Visualforce?

To control the number of records displayed on each page, we use pagination. By


default, a list controller returns 20 records on the page. To customize it, we can use a
controller extension to set the pageSize.

Take a look at the sample code below:-

<apex:page standardController="Account" recordSetvar="accounts">

<apex:pageBlock title="Viewing Accounts">

<apex:form id="theForm">

<apex:pageBlockSection >

<apex:dataList var="a" value="{!accounts}" type="1">

{!a.name}

</apex:dataList>

</apex:pageBlockSection>

<apex:panelGrid columns="2">

<apex:commandLink action="{!previous}">Previous</apex:commandlink>

<apex:commandLink action="{!next}">Next</apex:commandlink>
</apex:panelGrid>

</apex:form>

</apex:pageBlock>

</apex:page>

34. How can you call a controller method from JavaScript?

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


use actionfunction.

Look at the below piece of code to understand how a controller method is called using
actionfunction.

<script>

function JSmethodCallFromAnyAction()

callfromJS();

</apex:page>

35. How to get the UserID of all the currently logged in users using Apex
code?

You can get the ID’s of all the currently logged in users by using this global
function: UserInfo.getUserId().

36. How many records can a select query return? How many records can
a SOSL query return?

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.


37. What is an attribute tag? What is the syntax for including them?

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:

<apex:component>

<apex:attribute name="myValue" description="This is the value for the component."


type="String" required="true"/>

<apex:attribute name="borderColor" description="This is color for the border." type="String"


required="true"/>

</p>

<p>

</p>

<p>

</p>

<p>

</p>

<h1 style="border:{!borderColor}">

<apex:outputText value="{!myValue}"/>

</h1>

<p>

</p>

<p>

</p>
<p>

</p>

<p>

</apex:component>

38. What are the three types of bindings used in Visualforce? What does
each refer to?

There are three types of bindings used in Salesforce:-

• Data bindings, which refer to the data set in the controller


• Action bindings, which refer to action methods in the controller
• Component bindings, which refer to other Visualforce components.

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

39. What are the different types of collections in Apex? What are maps in
Apex?

Collections are the type of variables which can be used to store multiple number of
records (data).

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

There are 3 collection types in Salesforce:

• Lists
• Maps
• Sets

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>();
40. How can you embed a Visualflow in a Visualforce page?

1. Find the flow’s unique name.


a. From Setup, enter Flows in the Quick Find box, then select Flows.
b. Click the name of the flow.
c. Copy the unique name of the flow.
2. From Setup, enter Visualforce Pages in the Quick Find box, then select Visualforce Pages.
3. Define a new Visualforce page, or open an existing one.
4. Add the <flow:interview> component somewhere between the <apex:page> tags.
5. Set the name attribute to the unique name of the flow.

For example:

</apex:page>

<flow:interview name="flowuniquename"/>

<apex:page>

6. Click Save.
7. Restrict which users can access the Visualforce page.
a. Click Visualforce Pages.
b. Click Security next to your Visualforce page.
c. Move all the appropriate profiles from Available Profiles to Enabled Profiles by
using the ‘add’ and ‘remove’ buttons.
d. Click Save.
8. Add the Visualforce page to your Force.com app by using a custom button, link, or Visualforce
tab.

41. 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).
42. What are the different methods of batch Apex class?

Database.Batchable interface contains three methods that must be implemented:

1. Start method:
global (Database.QueryLocator | Iterable<sObject>)
start(Database.BatchableContext bc) {}
2. Execute method:
global void execute(Database.BatchableContext BC, list<P>){}
3. Finish method:
global void finish(Database.BatchableContext BC){}

43. What is a Visualforce component?

A Visualforce Component is either a predefined component (standard from component


library) or a custom component that determines the user interface behavior. For
example, if you want to send the text captured from the Visualforce page to an object in
Salesforce, then you need to make use of Visualforce components.
Example: <apex:detail>

44. What is Trigger.new?

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

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

45. What all data types can a set store?

Sets can have any of the following data types:

• Primitive types
• Collections
• sObjects
• User-defined types
• Built-in Apex types

46. What is an sObject type?

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.

47. What is the difference between SOQL and SOSL?

The differences are mentioned in the table below:

SOQL vs SOSL
SOQL (Salesforce Object Query Language) SOSL (Salesforce Object Search Language)

Only one object can be searched at a time Many objects can be searched at a time

Can query any type of field Can query only on email, text or phone

Can be used in classes and triggers Can be used in classes, but not triggers

DML Operation cannot be performed on search


DML Operation can be performed on query results
results

Returns records Returns fields

48. What is an Apex transaction?

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

49. What is the difference between public and global class in Apex?

Global class is accessible across the Salesforce instance irrespective of namespaces.


Whereas, public classes are accessible only in the corresponding namespaces.

50. What are getter methods and setter methods?


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 controller variable.

Q #2) What is a Custom Object in Salesforce?


Answer: 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.

Q #3) How does Salesforce deploy Sales Tracking?


Answer: 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.

Q #4) What is the difference between isNull and isBlank?


Answer: 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.

Q #5) What is the limit of Data.com records which can be added to Salesforce?
Answer: 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.

Q #6) What is the difference between Role and Profile in Salesforce?


Answer: Roles allow to control the access to Salesforce and have 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.

Q #7) What are the Permission Sets?


Answer: 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.

Q #8) What is the use of SOQL? What are the differences between SOQL and SOSL?
Answer: The full form of SOQL 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.


SOQL SOSL

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 Uses “FIND” keyword for retrieval of record fro
database. 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 res

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.

Q #10) What are Workflows in Salesforce? What are the types of Workflow?
Answer: 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.
There are two types of workflow in Salesforce:
1. Immediate Actions: It fires immediately when the workflow criteria are met. The
associated actions email alerts/field updates also take place with immediate effect.
2. 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.

Q #12) What is Force.com Platform?


Answer: 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.

Q #14) What is Junction Object? What is it used for?


Answer: 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.

Q #15) What is an Audit Trail?


Answer: 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.
Q #16) What is a Dashboard in Salesforce?

Answer: 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.

Q #18) What are the options for deploying from Sandbox to Production org? What is
an Outbound Change Set?
Answer: 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.

Q #22) What are the differences between Workflow and Process Builder? What is the
difference between Trigger and Process Builder?
Answer: 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.

Q #26) What is the difference between Page Layout and Record Type?
Answer: 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:

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.
Q #27) What is a Wrapper Class in Salesforce?
Answer: 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.

Q #29) What is Apex?


Answer: Apex is an object-oriented programming language that enables the developers to
execute flow and transaction control statements, on Salesforce servers in association with a
call to an API.
It adds business logic to system events such as related record objects, button clicks, and
Visualforce pages – with Java-like syntax and acts as a stored procedure.

Q #30) What are Maps in Apex?


Answer: 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>();

Q #31) What is an Apex Transaction?


Answer: 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.

Q #32) Is it possible to edit Apex Class/Trigger in the Production Environment?


Answer: 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.

Q #33) What are the ways to call an Apex Class in Salesforce?


Answer: 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

Q #34) Is it possible to customize Apex and Visualforce directly from the Production
Org?
Answer: 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.

Q #35) When is it possible to use Apex over Workflow rules or Process Builder?
Answer: 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.

Q #36) What is Apex Test Coverage?


Answer: The Apex testing framework generates code coverage numbers for the Apex
classes and triggers, every time when one or more tests are run. Code Coverage denotes
the number of executable lines of code in classes and triggers which is exercised by test
methods.
Test methods are written and tested to generate the Code Coverage. It is calculated as a
percentage of a covered line divided by a covered and uncovered line.

The minimum test coverage must be 75 % for deployment in the production org.

Q #37) What is Apex Email Service?


Answer: 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.

Q #38) What are the methods of Batch Apex Class?


Answer: 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:

Q #39) What are the types of Collections in Apex? Explain List and Set in Collections.
Answer: 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.

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.


Q #40) What is Apex Trigger? What is the Syntax of Trigger in Salesforce?
Answer: 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.

Q #41) What is Asynchronous Apex? What are its different types?


Answer: 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

Visualforce Questions
Q #42) What is Visualforce? How to hide the Header and Sidebar in the Visualforce
Page?
Answer: 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:

Q #43) How to perform an AJAX request in Visualforce?


Answer: 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.

Programmatic Features
Q #44) What is the difference between Standard and Custom Controller?
Answer: 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.

Q #45) How can we implement Pagination in Visualforce?


Answer: 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:

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.
Q #46) How to call a Controller Method within a JavaScript?
Answer: To call a controller method (Apex function) from JavaScript, you need to
use actionfunction.
Below is a code snippet for your reference:

Q #47) What are the types of Bindings used in Salesforce?


Answer: There are three types of bindings used in Salesforce as shown below.
1. Data Bindings: It refers to the data set in the controller.
2. Action Bindings: It refers to the action methods in the controller.
3. Component Bindings: It refers to some other Visualforce components.

Q #48) Can you write Getter and Setter Methods in Salesforce?


Answer: 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.

Q #49) What is Lightning Component?


Answer: 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

Q #50) What is a Developer Console?


Answer: 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.

Q #51) What are Packages? What are the types of Packages? What are Managed
Packages?
Answer: 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.

Q #52) What are the ways to deploy Metadata in Salesforce?


Answer: 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

Q #53) What is Trigger.new?


Answer: 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.

Q #54) What is an Attribute? What is a reRender Attribute Tag?


Answer: 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.

Q #55) Which tag is used to create a Button? Which tag is used for a URL link? Which
is the tag for Password Protection?
Answer:
• 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>.

Q #56) What is Obligatory Outer Tag? Which tag is used for displaying a video in the
Visualforce?
Answer: The tag <apex: page> is the obligatory outer tag. The tag<apex: flash> is used to
display a video in the Visualforce.

Q #57) How to display a Chatter Feed Record?


Answer: <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.
Q #58) Explain Exception Catch in a Program.
Answer: 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:

Q #59) What is an Access Modifier in a Program?


Answer: 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:

Q #60) Which operation does not have Undelete?


Answer: The before operation does not have Undelete.

Q #61) What is the use of Blob Variable?


Answer: 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.

Q #62) How is a link passed in Visualforce?


Answer: Link is passed in Visualforce through the hyperlink.

Q #63) What is the Purpose of apex:ouputLink?


Answer: 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:
Q #64) What is Static Resource?
Answer: 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.

Q #65) Which tag is used for calling a Controller Name?


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

Q #66) What is a User Interface in Salesforce?


Answer: 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.

Integration Questions
Q #67) What is the use of an Outbound Message?
Answer: 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.

Q #68) What is OAuth?


Answer: OAuth is an open-standard authorization protocol or framework. It describes how
unrelated services and servers can safely allow authenticated access to their assets. But
there is no need to share related, initial, and single login credentials.

Q #69) What is a Connected App?


Answer: A connected app uses APIs to integrate any application with Salesforce. It uses
standard OAuth and SAML protocols for authentication purposes and provides single sign-
on and tokens for use with Salesforce APIs. It allows the Salesforce admins to set various
security policies and exercise control of who can use the connected apps.

Q #70) What is an API in Salesforce? How can we use it?


Answer: 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.

Q #71) What is the use of External ID Fields?


Answer: 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.
Further reading =>> Salesforce Solution Architect Interview Questions and Answers

Miscellaneous Questions
Q #72) Which Platform is used for developing an App in Salesforce?
Answer: The force.com platform is used for developing an App in Salesforce.

Q #73) How to build Salesforce on Mobile Application?


Answer: Mobile SDK can be used to build Salesforce on the mobile application.

Q #74) What are Primitive Data Types?


Answer: Integer, Double, Long, Date, Date-Time, String, ID, Boolean, etc., are some of the
examples of primitive data types. These are passed by value and not by reference.

Q #75) What does the Data Wrapper Class contain?


Answer: This contains abstract, structured and collection data.

Q #76) Is Return Type a must for a Method?


Answer: Yes, the return type is a must for a method.

Q #77) How long is Bit Variable for a long statement?


Answer: The long statement has 64-bit.

Q #78) What are the development tools for Apex?


Answer: The development tools for Apex are Force. Com Developer Tools, Force. Com
IDE and Code Editor.

Q #79) What is the use of Debug Log?


Answer: Debug Log is used for catching the exception.

Q #80) Can we reference Standard Controller and Controller Attribute at the same
time?
Answer: No, it is not possible to reference both the Standard Controller and the Controller
at the same time. Use the reference attribute to reference the standard controller with a
custom controller.
Here is how these are referenced:

Q #81) What is the Development Mode? When do we enable the Development Mode?
How do we do it?
Answer: The best way to build Visualforce pages is to enable the development mode. It
makes it easy to simultaneously view the code and output.
The Development Mode helps in:
• Define new Visualforce pages by entering a new URL.
• Error messages containing detailed stack traces than what is received by the
standard users.
• Displays a footer with the page’s view state, a link to component reference
documentation, and any associated controller link.
• Offers Page Markup Editor for highlighting find-replace functionality as well as auto-
suggest for attribute names and component tags.

Testing Questions
Q #82) Why do You write Test Classes?
Answer: Test classes refer to the maximum lines of code covered when your execution
takes place. If you want to develop a robust and error-free code, then the test classes are
used as a tool for testing your code. It ensures that if any Apex customization has to be
deployed in your org, then it will operate properly.
Every test class will be annotated with @isTestkeyword. In fact, we must annotate a test
class with @isTest, for defining as a test class. If the keyword testMethod is used within
any method within a class, then it is called as a test method.

Q #83) What is the Minimum Test Coverage that is required for Deployment?
Answer: At least 75 % of your Apex code must be covered by unit tests in Salesforce, and
all these tests must be completed successfully.

Debug And Deployment


Q #84) What are the different ways of Salesforce Deployment?
Answer: Salesforce code is deployed with:
• Salesforce packages
• Change Sets
• Com Migration Tools
• Eclipse with Force.com IDE
3. What is meant by an Object in Salesforce?

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?

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:

Setup ---> build---> Create---> App---> Click on new.

9. What are the default filters in salesforce?

They are “Date filters.”

10. How to get rid of Date Filter?

By selecting the “All Time” in the “Range” on the page.

20. What is an External lookup?

The external lookup relationship is used to connect the child object to the parent object. The
child object may be either a custom, standard, or external object. It uses to identify the
correct map of the child object with the parent external object. The external
lookup relationship values fields are matched against the External Id values.

21. What is a self-relationship?


It is a personal look up to the same object. The self-relationship creates a tree diagram of
the objects. Let's take an example as an object “merchandise”. In this, we can create
relationship merchandise between two accounts. This is called a self-relationship.

23. What is meant by “Transfer record” in profile?

Transfer record is a type of function used to grant permission. If a user has permission to
share a record with others, then he can share the records that have read-only access.

26. What is a Time Trigger?

The computer system executes one or more tasks according to the set of rules and
scheduled tasks.

27. What is Trigger in Salesforce?

The trigger is defined as an Apex code that executes before or after the following functions
such as insert, update, delete, etc. trigger enables to perform custom actions before and
after modifications to the records of Salesforce.

28. What are the actions in the workflow?

Below mentioned are the actions in the workflow

• Field update
• Task
• Outbound message
• Email alert

29. What are the main things that need to consider in the “Master-Detail
Relationship”?

Record level access is determined by the parent, Mandatory on the child for reference of
the parent, cascade delete (if you delete the parent, it can cascade delete the child).
30. How many records can be shown in matrix, tabular & summary
reports?

We can create up to 2k records in Matrix, Tabular & Summary Reports.

31. Is the Roll-Up Summary field is only possible in the Master-detail


relationship?

Yes, it is possible in a master-detail relationship.

32. How many Master-detail relationship fields can be created in an


object?

Maximum two MDR fields can be created in an object.

33. How many LR(lookup relationship) fields can be created in an


object?

Maximum 40 Lookup relationship fields can be created in an object.

34. If we delete parent records in MDR, what happens to the child?

If you delete the parent record in the MDR, the child record also gets deleted in MDR.

35. What about the undelete option?

It will restore the record with the data in the object.

36. How many Roll-Up Summary fields can be created in an Object?

Up to 40 can be created. (before 2010 it is 10 after 2016 it is up to 40 and it will change


accordingly to salesforce updates).

37. If we reparent in the object will the parent update?

Yes, the parent will update the object.

38. How we can create an MDR on those objects where we already have
records?

1. First, we create LR between the two objects.


2. Connect all child records to parents.
3. Convert the field type from LR to MDR.

39. How to look at the user license information in Salesforce Org?

Steps to find out the user license:

Salesforce Org → Setup → Administer → Company Profile → Company


Information.

40. Can we delete a user in Salesforce?

No, we cannot delete the user in the salesforce.

41. Can we change the license when we create a profile?

No, we cannot change the license when we are creating the profile.

42. Explain about object relationship overview?

It creates a link between the custom object and the standard object recorded in a related
list. This is helpful to find the product's defects.

43. How to create many to many relationships in Salesforce?

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.

44. What are the permission sets?


A Permissions set is a collection of settings or permissions and is used to extend the user
functional access without changing actual profiles. You can use permission sets to various
types of users to extend the functionality access regardless of their roles. It is time taking
task to create a profile; instead of this, you could easily create a permission set.

46. What are the default indexed fields in Salesforce?

We have some fields which are indexed by default in Salesforce, which are :

• Name
• ID
• Owner fields
• Master-detail relationship fields
• Lookup fields
• Last modified dates
• Audit dates

47. What is the Fiscal year in Salesforce?

The Fiscal year is known as the starting and ending date of a company's financial year. We
have two types of financial years in Salesforce which are as follows.

1. Standard fiscal year


2. Custom fiscal year

48. List some examples of custom fields?

There are many custom fields available they are Picklist, Currency, Date, Text,
Picklist (multi-select), Email, Percent, Number, Phone, Text area, Lookup relationship,
Geolocation, Checkbox, Master-Detail relationship, etc..

49. What are the different ways to store various types of records in
Salesforce?

We have five different ways in Salesforce to store various types of records such as images,
files, and documents.

They are

• Attachments
• Google drive
• Chatter Files
• Libraries
• Attachments.

50. What is the main difference between data table vs page block table
tags?

The differences between the Data table and Page block

Page block:

• 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

DataTable:

• 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.

51. What can cause data loss in Salesforce?

There are many things that can contribute to the data loss in Salesforce. Which includes :

1. Migrating to number, percent, and money, from other data types.


2. When you change the date and time
3. Migrating to multi-select picklist from any other type but except picklist.
4. Moving from Checkbox, auto number,multi-select picklist to any other types.
5. Changing text area to phone, URL, email, or text.

52. What is the junction object and what is it used for?

Junction objects are mainly used to create a many-to-many relationship in Salesforce. If you
consider a recruiting application as an example, you can find a position that is linked to
many candidates, and in the same fashion, a candidate can apply for many positions.

53. How does Salesforce track sales details?

Salesforce gives the accurate results of following things such as

• Number of customers served on a daily basis


• Regular sales numbers
• Complete reports from the Sales Manager.
• Generates sales reports on a timely basis
• It provides the details of repeat customer activity.

54. Is it possible to restrict access to data using sharing rules?

The sharing rules are used only for allowing greater access to records not for restricting.

55. Can we schedule a dynamic dashboard in Salesforce?

No, we can not do that in Salesforce.

56. How many ways we can share a record?

Role Hierarchy :

If we add a user to a role, the user who is above in the role hierarchy will have read access.

Setup → manage users → roles → setup roles → click on ‘add role’ → provide
name and save.

OWD:

• Defines the baseline setting for the organization.


• Defines the level of access to the user can see the other user’s record

OWD can be Private, Public Read Only, Public Read and Write.

Setup → Security Controls → sharing settings → Click on ‘Edit’

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.

57. What is the difference between insert() and database .insert()?

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.
58. Does the user can create insert their own custom logo while creating
their own custom applications?

Yes, users can upload their custom logo in documents, and then they choose that logo for
the organization.

59. List things that can be customized on-page?

We can customize different things on page layouts like Fields, Buttons, Custom Links, and
Related Lists. We can also create sections.

60. Can we create a Roll-Up Summary(RUS) field on the master object?

Yes. we can create a Roll-Up Summary field on the master object.

61. Can the governor limit perform partial DML activity? Eg: we are
inserting 200 records in a loop, the Governor limit is hit at the 151st
record, then will those 150 records be created?

No either all or none.

62. What is Apex Interface?

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.

63. Where can I use Apex?

We can use Apex in the following ways

• To create Email services


• Create web services
• Perform complex validation over multiple objects
• To create complex business processes that are not supported by a workflow.
• Create custom transaction logic
• Attach custom logic to another operation
64. How Does Apex Work?

All Apex programs run entirely On-Demand on the Force.com Platform.

• First, the platform application server compiles the code into an abstract set of
instructions that can be understood by the Apex runtime interpreters.
• The compiled code is stored in metadata.

When the end-users trigger the execution of Apex by clicking a button or the VisualForce
page the application servers retrieve the compiled instructions from the metadata and send
them to the runtime interpreter before returning the result.

65. What is Apex in Salesforce?

Apex is a strongly typed object-oriented programming language.

It allows the developer to execute flows and transaction control statements.

Apex enables developers to add business logic to most system events like button clicks
related to record updates and VisualForce pages.

66. What are the ways to call the Apex class?

Below mentioned are the ways in Salesforce to call Apex class.

• From another class


• From developer console
• From JavaScript links
• From home page components
• By using trigger
• From VisualForce page

67. Explain various methods of batch Apex class?

The batch apex class deploys the database batchable interface with the three methods as
follows:

• Start
• Finish
• Execute

Start: We use the start method at the beginning of the batch apex job. We use it for
collecting the objects or records, for passing them to the interface for executing. It returns a
DatabaseQueryLocator object that comprises objects or the records sent to the job.

Finish: We call this method once we finish the batch processing. We use this method to
send confirmation emails or to execute the post-processing operations.
Execute: We use this method for every batch of the records that are sent to the method.
We use this method for data processing. This method does the following:

• sObjects records list


• Reference to the DatabaseBatcheable context.

68. What is Apex Email Service?

Email services are an automated process that uses Apex classes to process the contents,
Headers, Attachments of Inbound Email.

Note:

• Visualforce email templates cannot be used for mass emails.


• We can associate each email service with one or more salesforce-generated email
addresses to which the users can send messages for processing.

69. Explain about Apex Programming Language?

• Integrated: It provides built-in support for DML Calls


• Inline Salesforce Object Query Language
• Easy to Use
• Easy to Test
• Version
• Multi-Tenant Aware Application

70. What is Map Class in Apex Salesforce?

Map Class in Apex:

• 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.

For Example, the following table represents a map of countries and currencies

Country(Key) ‘United States ‘Japan’ France’ ‘England’ ‘India’


Currency (Value) ‘Dollar’ Yen’ ‘Euro’ ‘Pound’ ‘Rupee’
71. What is Batch Apex in Salesforce?

Batch Apex: Batch Apex allows you to define a single job that can be broken up into
manageable chunks, whereas every chunk can be processed separately.

In the Batch Apex it will fetch all the records on which you want to perform the field update
and divide them into a list of 200 records and on every 200 records operation is performed
separately.

This would help us to execute on more than 10,000 records as it won’t perform an operation
on all the records in a single transaction instead it dividing them into a Number of subtasks
where each subtask may contain records up to 4000.

Example:

If you need to make a field update of every record of account object in your organization,
then we have governing limits that would restrict us from achieving the above task.

Reason: In a single transaction we can process only 10,000 records. Now in the above
case if we have more than 10,000 records in the organization then we can not perform this
field update.

72. What is Apex Scheduler?

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;
}
}

73. What is the Apex Trigger in Salesforce?

The trigger is an Apex Code that executes before or after. The following types of DML
Operations:

• Insert
• Update
• Delete
• Merge
• Upsert
• Undelete

74. What is meant by Apex transaction?

An Apex transaction represents a group of operations that are needed to be executed at


once. It includes the Data Manipulation Language (DML) and is responsible for querying
records. The DML operations in a transaction either success or if anything goes wrong or
occurs even with a single record could result in a rollback of the entire transaction.

75. What are The Types of Apex Triggers in Salesforce?

Triggers are divided into 2 types

1. Before Triggers
2. After Triggers

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 separated list of events.

76. What is Apex Managed Sharing?


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)

77. What is the Usage of the apex program within the VisualForce page?

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.

80. What is Multitenant Architecture in Salesforce?

It is the cloud's fundamental technology to share IT resources securely and cost-efficiently.

81. What are static resources?

Ans: Static resources allow you to add the content that you want to reference it on the
VisualForce page, which includes things like images, Javascript, archives, CSS files, etc.
The maximum size of a static resource of an organization is 250 MB.

82. List the data types that a Set can store

The Sets can store any of the following data types


• Collections
• User-defined types
• subjects
• Primitive types
• Built-in Apex types

83. What is a Visualforce component?

Visualforce components are small reusable components of functionality such as widgets,


user interface elements, panels, etc. We have two types of VisualForce
components which are standard and custom and are used to define the user interface
behavior.

84. What is SOQL?

A query language that allows you to construct simple but powerful query strings and to
specify the criteria that should be used to select the data from the platform database. SOQL
Stands for Salesforce Object Query Language.

85. What is the Bulkification best practice?

We must avoid using index values like Trigger.New[0] as we never know how many records
we get in Trigger.New at runtime.

1. We need to use it for each loop whether we have 1 record or many.


2. We must not use SOQL inside for loop.
3. We must not use SOSL inside for loop.
4. We must not use DML inside for loop.
5. We need to store data in collections, so our code will work for single as well as
multiple records.

Salesforce Apex Technical Interview Questions

86. database.insert(ListForBulkDML, True) means what?

Insert ListForBulkDML;

87. How can we perform DML partially?

If we want partially to happen, use a database.insert(list, false);


88. What Are The Types of SOQL Statements in SalesForce?

Salesforce Object Query Language is used to query records from the database.com
based on the requirement.

There are 2 types of SOQL Statements:

1. Static SOQL
2. Dynamic SOQL
3. Static SOQL:
4. The Static SOQL Statement is written in [] (Array Brackets)
5. These statements are similar to IINQ (Ion Integrated Query)

Example:

String search for =’Jones’;


Contact[] contacts=[select testfield__c, FirstName, LastName from Contact
Where Last Name=:search for];

Dynamic SOQL:

It is used to refer to the creation of a SOQL string at run time with Apex code.

• Dynamic SOQL enables you to create a more flexible application.


• To create a Dynamic SOQL query at run time use a Database.Query() method, in
one of the following ways.
• Return a single sObjects when the query returns a single record.
• sObjects s = Database. Query(String_limit_l);
• Return a list of sObjects when the query returns more than a single record.

Example 1:- Queries

String myTestString = ‘TestName’;


List List= Database.Query(SELECT Id FROM MyCustomObject__c WHERE Name =
:myTestString);

89. What is the Syntax of SOQL Statement?

Syntax -

SELECT field1, field2,.... FROM Object_Type [WHERE condition]

Example:-Queries
List accountList = [SELECT ID, Name, FROM Account];
List accountList = [SELECT ID, Name, FROM Account WHERE annual
revenue<10000];

90. Explain briefly about GROUP BY with the syntax?

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.

Syntax: [ GROUP BY field GROUP BY LIST]

91. SOSL Statements In Salesforce Apex?

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 ];

Note:

• 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.

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.

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]);

92. Explain Javascript remoting for apex controllers?

Use javascript remoting in VisualForce to call methods in apex controllers from javascript.

Javascript remoting has 3 parts.

• 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.

93. How to add javascript remoting to a Visualforce page?

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] );

94. Give some of Configuring javascript remoting requests?

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 ex


close to each other in time into
single request. The default is t

Whether to escape the apex m


Escap Boolean
response. The default is true.

The timeout for the Static Res


Timeout Integer request in milliSeconds. Defau
30000(30 seconds)

95. What is a Declarative Approach?

Working on a project without code.

96. What is the Customisation / non Declarative approach?

Working on a project with code.

97. If one wants to actually compare the variable name in a query what
operator should be used?

=: is the operator used to compare.

98. When one wants to pass the collection to the query instead of
passing one value which keyword helps us?

IN - keyword.

99. What 2 are benefits we get by writing controllers?

We get Logic & Data.

100. Mention 2 reasons why we prefer VFP instead of using


configuration(no coding) things?

Multiple edits, insert, javascript, angular js can be included.

101. Difference between < apex:inputText / > Vs < apex:inputField / > ?

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


102. How to call javascript using in VisualForce page?

Add javascript file in Static Resource setup -> develop -> Static Resources -> click on ‘New’
-> Name: filename and add file from local desktop and save.

04. What is Future Annotation(@Future)?

Use the future annotation to specify that these methods are executed asynchronously.

• Methods with future annotation must be static methods


• Methods with future annotations can only return a void type.

Syntax:

global class class_name


{
@future
Static void methodname(parameters)
{
//body of the method
}
}

105. What is the AppExchange directory?

A web directory where hundreds of app exchange apps are available to Salesforce
customers to review, demo, comment upon, and /or install. Developers can submit their
apps for listing on the appexchange directory if they want to share them with the
community.

106. Which tag is used with both radio buttons and picklists to create
the selectable values?

We use <Apex:selectoption>

107. Which field cannot be added to a custom index?

We can not add formula fields to the custom index in Salesforce.

108. What is the difference between trigger and workflow?


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.

109. What are some apex classes that are commonly used within?

Standard controller, select option, page reference, message, etc.

110. What are the effects of using the transient keyword?

The transient keyword prevents the data from being saved into view state. This should be
used for very temporary variables.

111. What is the maximum number of field dependencies we can use in


the VisualForce page?

The maximum number of field dependencies we can use is a VisualForce page is 10.

112. What is the procedure to get the Security token in Salesforce?

Click on your Name tab, then click on Personal and you will find Reset my security token.

113. What is a Metadata-driven development model?

An app development model that allows apps to be defined as declarative “blueprints,” With
no code required. Data model, objects, forms, workflows, and more are defined by
metadata.
114. What is S-Control?

S-Controls are the predominant salesforce.com widgets that are completely based on
JavaScript. These are hosted by salesforce but executed at the client-side. S-Controls are
superseded by VisualForce now.

115. What is wrapper class in Salesforce?

A wrapper or container is a data structure, a class type, or an abstract data type that
contains multiple collections of objects. It helps in displaying various objects on a
VisualForce page in a single table.

116. What are force platform sites?

Public websites and applications that are directly integrated with your Salesforce
organization without requiring users to log in with a username and password.

119. 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?

Setup → Security Controls → sharing settings → Click on ‘Edit’

Apex sharing: Share object is available for every object(For Account object share object is
AccountShare ). If we want to share the records using apex we have to create a record to
the shared object.

120. Is it possible to edit the VisualForce page in a production


environment?

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.

121. Is it possible to make changes to the apex trigger/apex class in the


production function?

No, you can not do that if you want to make any edits to the apex trigger/apex class that
should be done in a sandbox environment.

122. What are the things that can be customized on page layouts?
Page layouts allow you to personalize or customize the given page objects or records. It
helps in customizing or designing the page according to your requirements. Page layout
editor helps you in customizing the pages. Using this page, you can customize things like
buttons, fields, custom links, and related lists.

123. How to invoke batch apex job (or) how to execute the batch apex
job programmatically?

We can use database.executebatch ( ) method to programmatically begin the batch job.

Syntax:

1. Public static ID execute batch ( sObject class name)


2. Public static ID execute batch (sObject class name, integers scope)
3. The above two methods are static methods of database class. We can use any one
of the methods to execute the batch job.

Note: The class name that we are passing to the database.execute batch( ) method should
be the object of the class which has implemented the database.batchable interface.

124. Will Visualforce still support the merge fields usage like S-control?

Yes. Just like S-Controls. Visualforce pages support embedded merge fields.

Salesforce Admin Interview Questions

1) What is the Roll-up summary field?

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.

2) Explain Queues?

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.

6) Explain Time-dependent workflow?


We perform time-dependent actions at particular times before closing the record. Workflow
re-evaluates the record after time passes. It checks whether the workflow rule criteria are
satisfied, and only then workflow rule executes the actions.

7) What is the Workflow Task and Workflow Alert?

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 is transmitted to different recipients.

8) Explain Auto-Response?

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.

9) Explain Custom Labels?

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

12) Define the Approval process?

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.

13) What is the importance of Salesforce Chatter?


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.

14) Explain Guest users?

Guest users are the users who do not have user accounts in our organization. They are
also known as unauthorized users as they do not have to log in. We can make the pages
accessible. Unauthorized users can create or edit the records.

Generally, we have various limitations and considerations for assessing. Yet, we can use
this feature for solving use cases, and we do it financially because the guest user licenses
are free.

15) Explain Change Set?

A changeSet is a group of components that we can migrate between the associated


organizations (like from a sandbox to the production, sandbox to the sandbox, etc.).

1) What is Apex test coverage?

To assure that our code satisfies particular standards, Apex test coverage displays to you
how many lines of code in our classes or triggers have been tested by the tested methods.
Test coverage percentage is the result of the number of the covered lines divided by the
sum of uncovered lines and covered lines. To deploy to production, we need a minimum of
75% test coverage.

2) Explain Lightning Message Service(LMS)?

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.

7) How can we create partial page refreshes?

First, we have to define the page section that is going to be refreshed, and then we have to
define the event that leads to refreshing. The method changes if the area being refreshed is
similar to the one managing the event. It also relies on if we are processing on the server or
if we have to change the user interface.
8) How can we invoke the javascript controller action by using a
component markup?

By using the action provider, we can invoke the javascript controller action through a
component markup

9) What are component and application events?

Application events

By using any component, we can fire the application events, and we can manage them.
Application events do not need any relationship among the components; however, these
components should be a part of an application.

Component events

Child components fire the component events, and Parent components handle the
component events. We use component events when we have to send a value from the child
component to the parent component.

10) What is Pagination, and How can we achieve it?

For example, if we have to display 100 records over the page.

• First: Display the first ten records.


• Previous: Display previous ten records.
• Next: Display the following ten records.
• Last: Display the previous ten records.

We can perform the above process through Pagination. We can achieve pagination through
the following ways:

Through StandardSetController
Through Offset and Limit keywords in SOQL Query

11) How do we display error messages on the VisualForce Page?

To display error messages on the VisualForce Page, we must use:

<apex:pageMessages></apex:pageMessages>

In Apex class, we must use:


ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.Error,
‘Error Message’));

12) What are the differences between Custom Objects and Custom
Settings?

Custom Objects Custom Settings

Custom settings store the data in the Application


Custom Objects store the data in the database.
Cache memory.

Custom objects have to use SQL queries for fetching Do not need to use SQL queries for fetching the
the records from the database. records.

In Custom settings, only confined data types exis


In custom objects, all data types exist.
when compared to custom objects

On Custom objects, we can create apex triggers and On List Custom settings, we cannot create apex
validation rules. triggers and validation rules

We can create a tab for custom objects. We cannot create a tab for custom settings

13) Can we customize the Apex in a production organization?

We cannot customize Apex in the production organization. We must change and deploy
through a sandbox and satisfy test coverage requirements.

14) Can you give an example of Salesforce API and its importance?

Salesforce has different API’s that allow us to communicate with the system in various
ways:

REST API: REST API will enable us to integrate with the salesforce applications through
HTTP methods in either JSON or XML formats.

Bulk: Bulk API gives us programmatic access that allows us to load the data into our
salesforce enterprise rapidly.
Streaming: We can use Streaming API for receiving the notification for the changes to the
salesforce data that equal the SOQL query we define. Streaming API is functional when we
have to push the notification from server to client according to the criteria we define.

16) Differentiate isNull and isBlack?

We use isBlack() for the text fields. Since text fields cannot be NULL, even though nothing
is given as a value, ISNULL() function fetches only empty values. If we use ISNULL() with a
text field, then it returns false.

17) How does Salesforce implement Sales Tracking?

Salesforce records data on the details like customer details, sales numbers, customer
served, repeat customers and use of these records for creating detailed charts, dashboards,
and reports. In this way, it tracks the sales of our organisation.

18) What is the limit of the Data.com records that we can add to
Salesforce?

In the user section of Data.com, we have to discover our name to see our monthly limit. It
will provide details like how many records we can export or add for this month. The user
enters setup and types the user in the Find box and chooses prospector users.

19) Explain the methods of the Batch Apex Class?

The batch apex class deploys the database batchable interface with the three methods as
follows:

Start: We use the start method at the beginning of the batch apex job. We use it for
collecting the objects or records, for passing them to the interface for executing. It returns a
DatabaseQueryLocator object that comprises objects or the records sent to the job.

Finish: We call this method once we finish the batch processing. We use this method to
send confirmation emails or to execute the post-processing operations.

Execute: We use this method for every batch of the records that are sent to the method.
We use this method for data processing. This method does the following:

• sObjects records list


• Reference to the DatabaseBatcheable context.
20) What are the different types of Bindings?

Following are the different types of bindings:

• Action Bindings: Action Bindings refers to action methods in the controller.


• Data Bindings: Data Bindings refers to the data sets in the controller.
• Component Bindings: Component Bindings refers to Visualforce components.

21) Can we write Setter and Getter methods in Salesforce?

Yes, we use a getter method for returning the values for a controller. Each value computed
by the controller and shown on the page should have a getter method.

On the other way, we use the setter method to pass the user-defined values from the page
markup to the controller. In the controller, we execute the setter method automatically.

22) Explain Developer Console?

The developer console is an incorporated development tool that has a collection of tools.
We use these tools for debugging, creating, and testing the applications in salesforce.org.

23) Explain packages and different kinds of packages?

The package is a collection of the components list or associated applications. Following are
the kinds of packages:

• Managed
• Unmanaged

We use managed packages for distributing and selling the applications to the clients.
Developers sell user-friendly applications and licenses by using AppExchange for managed
packages. These are entirely updatable in the event of continuous upgrades; we perform
the removal of fields or objects.

24) What are the ways to implement the metadata in Salesforce?

Following are the ways to implement metadata in the Salesforce:

• By using Change Sets


• Eclipse with Force.com IDE
• Salesforce package
• Through Migration tools
25) Explain reRender Attribute Tag?

The reRender attribute defines an elements list that we can update dynamically through the
AJAX library of the Salesforce. We do not need the entire page to refresh. Only a part of the
page detected by the components is named in the “.rerender” attribute.

26) How can we display the Chatter Feed Record?

By using the <chatter: feed> component, we can display the chatter feed.

Example:

<apex:page>
<chatter: feed entityId=”{!$User.Id}”/>
</apex:page>

27) Explain the Blob variable?

Blob variable is the variable that is intended to gather binary data. tostring() converts the
blob back into the string.

string string1='test string';


Blob blob1 = Blob.valueof(myString);
String String2 = myBlob.toString();
System.debug(String2);

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy