Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Can you give an example of a Salesforce API and its usage?

Answer»

Salesforce provides a variety of APIs that allows the developers to interact with the system in many ways. They are:

REST:

  • By using REST API you can easily integrate with Salesforce applications using simple HTTP methods in either XML or JSON formats. It is an ideal API for developing mobile applications or external clients.
  • Consider an example of retrieving information about the Salesforce version. You need to submit a REQUEST for the Versions resource by using the FOLLOWING code:
curl https://yourInstance.salesforce.com/services/data/
  • You have to replace the “your instance” text with the instance for your organization.
    The output from this request is as follows.
[ { "label" : "Winter '12", "url" : "/services/data/v23.0", "version" : "23.0" } ...]

Bulk: The Bulk API provides programmatic access that lets you quickly load and query a huge amount of data into your Salesforce organization.

Streaming: The Streaming API can be used to trigger and receive notifications, whenever CHANGES into Salesforce data are made according to the defined SOQL query criteria. It is useful when you want notifications to be pushed from the server to the client based on your defined criteria.

Conclusion

Salesforce is playing a vital role in any company’s SALES and marketing automation activities. The demand for qualified Salesforce professionals has seen its peak in recent days. Moreover, competition is also becoming tough for Salesforce-related positions, so preparation is inevitable if you want yourself to shine out of the crowd.

Salesforce is INCREASINGLY used as a term synonymous with CRM. Organizations can utilize Salesforce for varied applications like Contact Management, Workflow Creation, Customer Engagement, Opportunity Tracking, Task Management, and many more. In addition, you can also collaborate with your colleagues, run analytics, and access Salesforce from a mobile dashboard.

2.

What is Salesforce lightning?

Answer»

Salesforce lightning is a component-based framework for application development, which has a collection of TOOLS and technologies that aim to effectively increment the performance of the Salesforce platform. These tools include an entirely new version of a framework, visual UPGRADES, new and optimized interfaces, and more. It is designed to simplify processes for business users, who do not have any programming experience.

Using the lightning platform we can easily create apps that solve business problems and provide engaging experiences.

Few lightning features are:

  • Lightning app builder: It provides drag and drop capacities to facilitate the CREATION of an application and customization.
  • Lightning component framework: It CONSISTS of tools and extensions that allow the development of reusable components and standalone applications along with customization of the Salesforce mobile app.
  • AppExchange for components: It makes over 50 partner components present in the app builder.
  • Design system: It provides style guides and user experience practices for application development.
  • Lightning Connect: It is an integration tool that makes it easier for applications of Force.com to consume data from an external source that meets the OData SPECIFICATION.
3.

What are the different types of email templates available in Salesforce?

Answer»

The list of different types of email templates that can be created in Salesforce is given below:

  • Text: All the USERS in the organization are ALLOWED to create or change these templates.
  • HTML with letterhead: Only administrators and users with the “Edit HTML Templates” permissions are ABLE to create these templates based on a letterhead. The look and feel of your HTML email templates are defined by the letterheads. It can inherit the logo, text, and color settings from a letterhead.
  • Custom HTML: It is an extension of HTML with a letterhead. Administrators and users having “Edit HTML Templates” permissions can create custom HTML templates without using the letterhead. You must have knowledge about HTML or get the HTML code to insert it into your email template.
  • Visualforce: Administrators and developers are allowed to create these templates by using Visualforce. Visualforce templates provide advanced functionalities like merging with a RECIPIENT’s data, where the content of a template can have data from multiple records.
4.

Explain the types of SOQL statements in Salesforce.

Answer»

Salesforce Object Query Language(SOQL) is useful in querying the records from database.com depending on the requirement. There are 2 types of SOQL statements: Static SOQL and Dynamic SOQL.

Static SOQL:

  • The Static SOQL statement is written using [] (array brackets). This statement is similar to IINQ (Ion Integrated Query).
  • It is used in the condition where you don’t have any dynamic changes in the SOQL query. We don’t use Static SOQL when the field name or where the condition is needed to be dynamically defined.

EXAMPLE for Static SOQL query:

Contact[] contacts = [SELECT testfield__C, FirstName, LastName FROM Contact WHERE LastName = 'Dhanya'];

Dynamic SOQL:

  • It is used to refer to the SOQL string creation at RUN time with Apex code.
  • Dynamic SOQL allows you to create more flexible applications. For example, you are able to create a search based on end-user INPUT or UPDATE records with different field names.
  • To create a Dynamic SOQL query at run time using a Database.query() method, in any ONE of the given below ways:
    • Return a single sObject when the single record is returned by a query.
      sObjects s = Database.query(string_limit_1);
    • Return a list of sObjects when more than a single record is returned by a query.
      List<sObject> sobjList = Database.query(string);

Example for Dynamic SOQL query:

String myTestString = 'TestName';List<sObject> sobjList = Database.query('SELECT Id FROM MyCustomObject__c WHERE Name = :myTestString');
5.

What are the differences between SOQL and SOSL in salesforce?

Answer»
SOQL(SALESFORCE Object Query Language)SOSL(Salesforce Object Search Language)
Using SOQL we can search only one object at a timeUsing SOSL we can search multiple objects at a time
We can query on all fields of any of the datatype We can query on the fields whose data TYPE is phone, text, and email
DML operations can be performed on query resultsDML operations cannot be performed on search results
Indexing happens synchronouslyIndexing happens asynchronously
We can use SOQL in the CLASSES and TRIGGERSSOSL cannot be used in triggers but can be used in classes
6.

What is Future annotation(@future)?

Answer»
  • Future ANNOTATIONS are used to specify methods that are executed asynchronously.
  • Methods having future annotation must be static methods and can only return a void type. The arguments specified must be primitive data TYPES or arrays of primitive data types or collections of primitive data types. These methods cannot take sObjects or OBJECTS as parameters.
  • When you specify a method with @future annotation, it will be executed only when Salesforce has available resources.
  • For example, you can use future annotation while making an ASYNCHRONOUS web service callout to an external service. Whereas without the usage of future annotation, web service callout will be created from the same thread which is executing the Apex code, and no additional processing will take place until that callout is complete (synchronous processing).

Syntax:

global CLASS class_name{ @future Static void methodname(parameters) { //body of the method }}`
7.

What is a wrapper class in Salesforce?

Answer»

A wrapper class is a type of container class, which contains a GROUP of objects as its MEMBERS. It is of an abstract data type. We use a wrapper class for ENCLOSING the collected data. A wrapper class is defined by a programmer, that acts as custom objects, along with wrapper class properties.

The instances of a wrapper class are helpful in displaying various objects in the corresponding table on a Visualforce page.

Some of the main advantages of using wrapper class by developers in Salesforce are given below:

  • The wrapper class structure is as efficient as that of a good data visualization process for a web page, especially in the case where the developers are DEALING with the JSON structure.
  • The developers are not required to MANAGE the passing of any map structure in order to browse necessary elements. Moreover, usage of wrapper class by developers will lead to ease the process of managing relationships between different objects.
  • Wrapper class usage prevents any penalty faced by the users for passing an object of Salesforce. Also, it makes the respective object extendable to constructors of a class.
  • The use of the wrapper class supports the developers for efficiently organizing the concerned data, provided the data is properly nested.
8.

How many ways we can share a record?

Answer»

With the help of the given below methods we can share records in Salesforce:

Role hierarchy:

  • Whenever a user is added to a role, the user above the current user in the hierarchy of roles will have access to reading the records and inheriting the permissions.
  • Follow the steps for role hierarchy: GO to Setup → FIND manage users' → roles → set up roles → click on ‘add role’ → provide name and click on save.

OWD:

  • OWD(Organization-Wide Defaults) allows you to give permissions to the organization-wide and to define baseline setting for the organization. It is also HELPFUL in defining the user’s accessibility level to the user where a user can see other user’s records.
  • OWD settings can be Public Read Only, Private, Public Read, and Write.
  • Follow the steps for OWD: Go to Setup → find the Security Controls → click on ‘sharing settings’ → click on ‘Edit.

Manual sharing:

  • Manual sharing is sharing a single record/file to a single user or group of users through manual access.
  • We can see a BUTTON for manual sharing on the detail page of the record and it can be seen only when the OWD setting is private.

Criteria based sharing rules:

  • If we want to share records based on conditions such as share records with a group of users with the criteria of the country is India.
  • Follow the steps for criteria-based sharing rules: Go to Setup → security controls → sharing settings → select the object and provide name and conditions then click on save.

Apex sharing:

  • Sharing object is available for each and every object in Salesforce. For example, the Account object’s share object is AccountShare.
  • By using Apex, if we want to share the records then we have to create a record to the shared object.
9.

Explain the various types of object relationships in Salesforce.

Answer»

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

Master-Detail relationship (1:n):

  • It is a parent-child relationship where the master object controls the behavior of dependent detail and sub-detail object. It is a 1:n relationship, in which there is only one parent, but multiple children.
  • The master field cannot be empty, since it is the controlling object. If a master object’s record or field gets deleted, the corresponding record or fields in the dependent object will also be deleted. This is called a cascade delete. Child object fields will inherit the owner, sharing, and security settings from the parent object. You can create Master-Detail relationships between two custom objects, or between a standard object and custom object until the standard object remains as a master in the relationship.
  • For example, you can define a Master-Detail relationship with two objects such as Account—Expense report. It expands the relationship to sub detail records, such as Account—Expense report—Expense line item. You will be then allowed to perform operations across the master—detail—sub detail relationship.

Lookup relationship (1:n):

  • These relationships are useful for creating a link between two objects, without the dependency on the parent object. This is again a form of parent-child relationship where there is only a single parent, but multiple children exist (1:n relationship).
  • Despite master being the controlling field, deleting a master record will not automatically delete the lookup field in the child object. So the records in the child object will not get affected and there will not be any cascade delete here. Child fields will not inherit the owner, sharing, or security settings of its parent.
  • With a lookup relationship, you are permitted to link two different objects or link an object with itself (except for the user object). For example, you may want to link a custom object “Bug” with itself for showing how two different bugs are related to the same problem.

Junction relationship (Many-To-Many):

  • You can use this kind of relationship whenever you want to create two Master-Detail relationships. By linking 3 custom objects, we can create two Master-Detail relationships. In this, two objects will be represented as master objects and the third object will act as a dependent on both of them. In simpler words, we can say that there will be a child object for both master objects.
  • This relationship ALLOWS EVERY record of one object to be linked with several records of another object and vice versa. For example, you can create a custom object “Bug” that relates to a standard object in such a way that a bug can be related to multiple causes, and also a single CASE can be related to multiple bugs.

Hierarchical relationship:

  • This is a special lookup relationship, that is available only for the user object.
  • It allows users to use a lookup field to associate a single user with another user that does not refer to itself in a direct or indirect way. For example, to store the direct manager of each user, you are allowed to create a custom hierarchical relationship field.

External lookup relationship:

  • This relationship LINKS a child's standard, custom, or external object to a master external object.
  • In this relationship, the standard External ID field values on the parent external object are matched against the external lookup relationship field values of the child object.

Indirect lookup relationship:

  • This relationship links a child's external object to a master standard or custom object.
  • For matching and associating the records, you will mention the parent object field and the child object field when you create an indirect lookup relationship field on an external object. Here, you have to select the parent object’s custom unique, external ID field to match against the child object’s indirect lookup relationship field.
Relationships in Salesforce
10.

What do you mean by a sandbox in Salesforce?

Answer»

A sandbox is a copy of the production environment/ organization and it is used for the purpose of testing and development. It’s very useful because sandboxes are completely isolated from your Salesforce production organization, so it allows you to test out new ideas on the duplicate database without disturbing the original production environment.

You can use the sandbox whenever you want to test a newly formed Force.com application or Visualforce PAGE. INSTEAD of testing it directly in production, you can develop and test it in the sandbox organization. Using this, you can develop the application without any difficulty and then migrate the metadata and data to the production environment. Doing this in a non-production environment permits developers to freely test and experiment with the newly created applications.

There are four types of sandboxes in Salesforce:

Developer sandbox:

  • It is a copy of the production organization, it copies all the information of an application and configuration to the sandbox. It is mainly used for the development and testing task in an isolated environment.
  • This type of sandboxes has limitations of up to 200MB of test or sample data. You can refresh a developer sandbox once a day.

Developer pro sandbox:

  • It copies all of your organization’s reports, dashboards, apps, price books, products, and customizations under setup. But it excludes all of your organization’s custom and standard OBJECT records, attachments, and documents.
  • This type of sandboxes has limitations of up to 1GB of test or sample data. We can refresh developer pro sandboxes once a day.

Partial data sandbox:

  • A partial data sandbox is a developer sandbox PLUS the data you define in a sandbox template, which is intended to be used only as a testing environment. It includes the reports, dashboards, price books, applications, products, and customizations under the setup (including all of your metadata).
  • Additionally, these sandboxes can have your organization’s custom and standard object records, documents, and attachments up to 5 GB of data along with a maximum of 10,000 records per chosen object.
  • A partial data sandbox is smaller compared to a full sandbox and has a SHORTER refresh interval. You can refresh partial data sandboxes every 5 days.
  • Sandbox templates permit you to select specific data and objects to copy to your sandbox, thus you can control the size as well as the content of each sandbox. Sandbox templates are available only for partial data or full sandboxes.

Full sandbox:

  • It is a replica of production including custom and standard object records, attachments, and documents and is used only as a testing environment.
  • You can refresh full copy sandboxes every 29 days.
Sandbox in Salesforce