The contribution of Salesforce in fulfilling the CRM needs of organizations is invaluable. Since long back it has been a CRM global leader with its market share of 19.7%. As the growth of Salesforce is projected to be high, ultimately, the demand for the skilled Salesforce professionals would also be high.

We have collected a bunch of Salesforce interview questions and Salesforce scenario based interview questions which are sourced from Salesforce experts. I hope these questions would help you in cracking the Salesforce interview and landing in your dream job. If in case you have attended any Salesforce interview earlier and unable to find the same questions here, then feel free to comment on those questions in the comment section, and we will update them in this blog, so that, it could help other students to learn from your experience.  Let's get into the QAs now.

Salesforce Fundamentals & Advanced Level Topics Interview Questions Include:

Declarative, Audit reporting features:- Includes salesforce platform questions, creating child records, custom objects creation, user interface design, Different page layouts, governor limits for the user, custom labels in Salesforce, web service in Salesforce, specific user declaration, creating dynamic dashboards & creating object relations in Salesforce.

Programmatic features:- Includes Salesforce developer platform questions, What is apex programming language, apex class creation with examples, what is bucket field, creating a VisualForce component, what is VisualForce page, few test methods of salesforce, what needs to be done when an error occurs, different data types, sharing rules for user-level access, Different apex transactions, How DML operations to be conducted on records.

Salesforce Interview Questions

Q1) What is meant by an Object in Salesforce?

Ans: Objects in Salesforce are used as database tables that are used to store information of an organization. We have 2 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.

Q2) What is meant by App in Salesforce?

Ans: An App in Salesforce.com is a container which holds various things such as a logo, name, and a set of required tabs.  It is also called as 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. 

By following this procedure you can build an application however you want.  

Q3) What types of app we can create in SF?

Ans: We can create 2 types of Apps in Salesforce

Custom app: This type of apps can be used in every business scenario. It is widely used in the market.

Console app: This type of app can be used only in client service business, where we focus on solving client’s issues. It is not comparatively, widely used in the market.

Q4) What is Salesforce Standard Fields?

Ans: Below mentioned are the Salesforce Standard Fields

  • Owner,
  • Name,
  • Last modified by,
  • Created by.

Q5) What are Audit Fields?

Ans:  Standard fields are nothing but audit fields.

Q6) Which is the latest field you have worked in SF?

Ans: ‘Time’ is the latest field in Salesforce. 

Q7) What are the default filters in salesforce?

Ans:  They are “Date filters”.

Q8) How to get rid of Date Filter?

Ans: By selecting the “All Time” in the “Range” in the page.

Q9) What are the issues you faced on joined reports?

Ans: We can not export.

Checkout SalesForce Tutorial

Q10) What are the types of reports that we have in Salesforce? 

Ans: There are four types of reports that are available in Salesforce which are as follows. 

  • The tabular report is those which gives us the total in a tabular format.
  • Matrix report the format where grouping is done based on columns and rows. 
  • The summary report which gives us the detail reports based on columns. 
  • Joined reports which are capable of allowing two or more reports in one report. 

Q11) What is an Audit trail? 

Ans:  The Audit trail in Salesforce is a unique feature which helps in tracking the changes that have been made in the organization by you and other administrators. It would be helpful for the organization with more administrators. This audit trail shows you the information of twenty most recently made changes in your organization. 

Below are the things that you could come to know: 

  • The date and time. 
  • Username of who made the changes.  
  • What the change was. 
Q12) What are the benefits of using Salesforce CRM?

Ans:   We get the following benefits by using Salesforce CRM.   

  • Improved organizational understanding.
  • Enhanced communication.
  • We can understand the customer better and can facilitate better services.
  • Salesforce automates the repeated rule-based tasks.
  • Improved analytics and dashboards to analyse the data.
  • Reduction in cost and cycle time.
  • Improves the efficiency of teams.
Q13) What is a profile? Can two users have the same profile?

Ans:  The profile is defined as a collection of rules and procedures a person needs to follow to access particular records. There are multiple profiles available in Salesforce. For example, a sales profile can have access to leads, opportunities, contacts, campaigns, etc.

As far as the second question is considered the answer would be yes. The people who work in one department have the same profile. So the people whoever works under a particular department would be assigned with the same profiles.

As we have seen in the sales profile, many people work under it and every person works under is assigned with the same profile. Hence any number of people can have the same profile.

Q14) Explain the difference between role and profile?

Ans: 

Role: In Salesforce Role is meant to increase the data visibility to a particular user. It can be done through sharing rules or by building role hierarchy. Using roles, you can control the ac

Profile: Unlike roles profile is mandatory for all, and it stays at the object level. It is treated as a building pillar of an organization.

Q15) How many relationships do we have in Salesforce?

Ans:  We have three types of relationships in Salesforce, which are:

  • Master-detail relationship
  • Lookup relationship
  • External Lookup
Q16) What is the Master-Detail relationship?

Ans:  This Master-Detail relationship is the same as the relationship between a parent & child. In this aspect, the master is treated as  Parent, and the Detail is a child. The master Object takes control over the behaviour of the Detail object. Survival of the child is dependent on the parent because if the Master get deleted the Detail will also automatically get deleted. You can create Roll-up summary fields in master records which helps in calculating the Min, Avg, Sum of the child records.

Q17) What is a “Lookup Relationship”?

Ans:  Relationship between the two objects is called lookup relationship. Lookup relationships connects two object links together so that you can look up from related items to other items. It can be one to one or one to many.

Q18) What is External lookup?

Ans:   External lookup relationship is used to connect the child object to the parent object. The child object may be either custom, standard, or an 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 to the External Id values. 

Q19) What is a self-relationship?

Ans:  It is a personal lookup 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.

Q20) What is workflow in Salesforce?  

Ans:  Workflow is an excellent way to automate specific business processes in Salesforce. To do this, you are required to define certain rules and regulations to automate tasks such as sending an email, updating a field, create a task

  • We can have access to workflow across the object.
  • It is not possible to query from the database.

[Related Page: What is cloud computing salesforce ]

Q21) What is meant by “Transfer record” in profile? 

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

Q22) Explain the Salesforce dashboard?

Ans: In Salesforce we use dashboards to represent the data in a pictorial format. Salesforce dashboard is capable of displaying 20 reports at a time.

Q23) What is SOAP?

Ans: A protocol that defines a uniform way of passing XML-encoded data. SOAP Stands for Simple Object Access Protocol.

Q24) What is a Time Trigger?

Ans:  Computer system executes one or more tasks according to the set of rules and scheduled task.

Q25) What is Trigger in Salesforce?  

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

Q26) What are the actions in the workflow? 

Ans:  Below mentioned are the actions in the workflow 

  • Field update 
  • Task
  • Outbound message 
  • Email alert 
Q27) What are the main things need to consider in the “Master-Detail Relationship”?

Ans:  Record level access is determined by the parent, Mandatory on child for reference of parent, cascade delete (if you delete the parent, it can cascade delete the child).

Salesforce Intermediate Interview Questions

Q28) How many records can be shown in matrix, tabular & summary reports?

Ans: We can create upto 2k records in Matrix, Tabular & Summary Reports.

Q29) Is Roll-Up Summary field is only possible in Master-detail relationship?

Ans: Yes, it is possible in master detail relationship.

Q30) How many Master-detail relationship fields can be created in an object?

Ans:  Maximum two MDR fields can be created in an object.

Q31) How many LR(lookup relationship) fields can be created in an object?

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

Q32) If we delete parent record in MDR, what happens to the child?

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

Q33) What about undelete option?

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

Q34) How many Roll-Up Summary fields can be created in an Object?

Ans:  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).

Q35) If we reparent in the object will the parent update?

Ans: Yes, parent will update the object.

Q36) How we can create an MDR on those objects where we already have records?

Ans: 

  1. First, we to create LR between the two objects.
  2. Connect all child records to parent.
  3. Convert the field type from LR to MDR.
Q37) How to look at the user license information in Salesforce Org?

Ans: Steps to find out the user license:

Salesforce Org → Setup → Administer → Company Profile → Company Information.
Q38) Can we delete a user in Salesforce?

Ans:  No, we cannot delete the user in the salesforce. 

Q39) Can we change the license when we create a profile?

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

Q40) Explain about object relationship overview?

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

Q41) How to create many to many relationships in Salesforce?

Ans:  It helps in creating a many-to-many relationship between two objects in Salesforce. Using many-to-many relationship you can connect each record of an object to be linked with multiple records of other objects and vice versa. Junction object helps us in connecting the two selected objects with each other.

relationships in Salesforce

Q42) What are permission sets? 

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

Q43) What is sharing rule?

Ans:  If we want to give access to other users we use sharing rules.

Q44) What are the default indexed fields in Salesforce? 

Ans:  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
Q45) What is Fiscal year in Salesforce?

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

  1. Standard fiscal year 
  2. Custom fiscal year

Fiscal year in Salesforce

Q46) List some examples of custom fields?

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

Q47) What are the different ways to store various types of records in Salesforce? 

Ans:  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.
Q48) What is the main difference between data table vs page block table tags?

Ans:  The differences between Data table and Page block

Page block:

  • It defines inside the pageblockstation or pageblock
  • To design the visual pages it uses style sheets
  • The required attribute is “value”
  • Automatically it will display Column Headers

DataTable:

  • No need to mention inside the pageblock station or pageblock
  • No required value.
  • The  data will be displayed using custom style sheets.
  • we need to specify column headers explicitly. 
Q49)What can cause data loss in Salesforce? 

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

  1. Migrating to number, per cent, 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. 
Q50) What is the junction object and what is it used for? 

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

Q51) How does Salesforce track sales details?  

Subscribe to our youtube channel to get new updates..!

Ans: Salesforce gives the accurate results of following things such as 

  • Number of customers served on a daily basis 
  • Regular sales numbers 
  • Complete reports from sales Manager. 
  • Generates sales reports on a timely basis 
  • It provides the details of repeat customer activity.
Q52) Is it possible to restrict access to data using sharing rules?

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

Q53) Can we schedule a dynamic dashboard in Salesforce? 

Ans:  No, we can not do that in Salesforce.

Q54) How many ways we can share a record?

Ans: Role Hierarchy :

If we add a user to a role, the user 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 single user or group of users.

We can see this button detail page of the record and this is visible only when OWD setting is private.

Q55) What is difference insert() and database .insert()?

Ans: Using 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 success of bulk insert operation we will use database .insert.

Q56) Does user can create insert their own custom logo, while creating their own custom applications?

Ans:  Yes user can upload their custom logo in documents and then they choose that logo for the organization.

Q57) List things that can be customized on page?

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

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

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

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

Ans: No either all or none.

Salesforce Apex Interview Questions:

Salesforce Beginner Interview Questions

Q60) What is Apex Interface?

Ans:  Interface is a collection of unimplemented methods. This will specify the signature of the method, types of inputs that we pass the method specifies what type is given as an output.

Note: Generally the interface methods we give it as global.

Q61) Where can I use Apex?

Ans:  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 workflow.
  • Create custom transaction logic
  • Attach custom logic to another operation
Q62) How Does Apex Work?

Ans:  All Apex programs runs entirely On-Demand on Force.com Platform.

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

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

Q63) What is Apex in Salesforce?

Ans:  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 record updates and VisualForce pages.

Q64) What are the ways to call the Apex class? 

Ans: 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
Q65) Explain various methods of batch Apex class?

Ans: The Database Batchable contains three methods that must be implemented.

  1. Start method
  2. Execute method 
  3. Finish method 
Q66) What is Apex Email Service?

Ans:  Email services is an automated process that use 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 address to which the users can send messages for processing.

Q67) Explain about Apex Programming Language?

Ans:  

  • 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

[Relate Page: SalesForce Integration]

Q68) What is Map Class in Apex Salesforce?

Ans:  Map Class in Apex:

  • Map Class Contains methods for the Map collection type.
  • A Map is a collection of key values pairs where each unique key map to a single value.
  • Map keys and values can be any data type primitive types, collections, sObjects, users 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’
Q69) What is Batch Apex in Salesforce?

Ans: 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 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 Number of subtasks where each subtask may contain the 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.

Salesforce Intermediate Interview Questions

Q70) What is Apex Scheduler?

Ans:  It will invokes the Apex classes to run at specific time.

Anybody who want to schedule their class they have to implement schedulable interface.

Schedule Interface: The class that implements this interface can be scheduled to run at different intervals. This interface has several methods they are

Public void execute(schedulablecontext sc)
Public class mySchedule implements schedulable
{
Public void execute(schedulablecontext sc)
{
Account a = new Account(Name = ‘Faraz’)
Insert a;
}
}
Q71) What is the Apex Trigger in Salesforce?

Ans: Trigger is an Apex Code that executes before or after. The following types of DML Operation:

  • Insert
  • Update
  • Delete
  • Merge
  • Upsert
  • Undelete
Q72) What is meant by Apex transaction?

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

Q73) What are The Types of Apex Triggers in Salesforce?

Ans: 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.
Q74) What is Apex Managed Sharing?

Ans: Apex Managed Sharing provides developers with the ability to support an application to share requirements.

  • This type of sharing available to only users with modify all data permissions. Only these users can add/change apex managed sharing.
  • Apex Managed Sharing uses a Sharing reason (Apex Sharing Reason)

Multi-tenant Architecture

Q75) What is the Usage of apex program with within VisualForce page?

Ans:  When you want to call apex class in VisualForce page we have to declare in the following format.

< Apex : page controller = “class name “ >

Whenever we call a VisualForce page in which 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.

Q76) What is Sandbox in Salesforce?  

Ans: A Sandbox is defined as a testing environment which is used to test the code or to conduct experiments in an isolated environment without harming the production environment.

Q77) When do we use Sandbox?

Ans: A Sandbox helps you when you want to test the newly developed application on force.com or VisualForce page. It is not possible to check something in the production environment if do, so it creates a problem for the regular functioning. So, to get out of this problem developers uses Sandbox to test the application.

Types of sandboxes available are :

  • Developer
  • Developer pro
  • Partial copy
  • Full

Salesforce Advanced Interview Questions

Q78) What is Multitenant Architecture in Salesforce?

Ans:  It is clouds fundamental technology to share the IT resources securely and cost efficiently.

Q79) 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. Maximum size of a static resource of an organization is 250 MB. 

Q80) List the data types that a Set can store?

Ans:  The Sets can store any of the following data types

  • Collections 
  • User-defined types
  • subjects 
  • Primitive types
  • Built-in Apex types
Q81) What is a Visualforce component? 

Ans:  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 behaviour. 

Q82) What is SOQL?

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

Q83) What is the Bulkification best practice?

Ans:  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 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 Technical Interview Questions With Solutions are Explained in Detail Below

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

Ans:  Insert ListForBulkDML;

Q85) How can we perform DMl partially?

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

Q86) What Are The Types of SOQL Statements in SalesForce?

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

There are 2 types of SOQL Statements:

  1. Static SOQL
  2. Dynamic SOQL

Static SOQL: 

The Static SOQL Statement is written in []  (Array Brackets)

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 Dynamic SOQL query at run time use 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);

Example 2:- Queries

String resolvedfield L = myvariable.field__c;
List L = Database.Query(‘SELECT Id FROM myCustomObject__c WHERE field__c = ‘+resolvedfield_L);

Q87) What is the Syntax of SOQL Statement?

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

Q88) Explain briefly about GROUP BY with the syntax?

Ans:  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]

Q89) SOSL Statements In Salesforce Apex?

Ans: SOSL statement evaluate to a 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]);
Q90) Explain Javascript remoting for apex controllers?

Ans:  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.
Q91) How to add javascript remoting to a Visualforce page?

Ans:  To use javascript remoting in a Visualforce page, add the request as a javascript invocation with the following form:

Syntax -

 [namespace.] controller.method ( [parameters ...] Call back Function, [configuration] );
Q92) Give some of Configuring javascript remoting requests?

Ans:  Configure a remoting request by proving an object with configuration settings when you declare the remoting request.

JavaScript remoting supports the following configuration parameters.

Name Datatype Description
Buffer Boolean Whether to group requests executed close to each other in time into a single request. The default is true.
Escap Boolean Whether to escape the apex methods response. The default is true.
Timeout Integer The timeout for the Static Resource request in milliSeconds. Default is 30000(30 second)
Q93) What is Declarative Approach?

Ans:  Working on a project without code.

Q94) What is Customisation / non Declarative approach?

Ans:  Working on a project with code.

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

Ans: 

=: is the operator used to compare.
Q96) When one wants to pass the collection to the query instead of passing one value which keyword helps us?

Ans: 

IN - keyword.
Q97) What 2 benefits we get by writing controllers?

Ans: We get Logic & Data.

Q98) Mention 2 reasons why we prefer VFP instead of using configuration(no coding) things?

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

Q99) Difference between < apex:inputText / > Vs < apex:inputField / > ?

Ans: 

inputField - copy the field from any object and display on a VF page | like copy paste work.

inputText - it will help to create a field from scratch | new creation

Q100) How to call javascript using in VisualForce page?

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

Q101) Difference between SOQL Vs SOSL in salesforce?
SOQL- (Salesforce Object Query Language) SOSL (Salesforce object Search Language)
Using SOQL we can Search only on one object one time. Using SOSL we can search on many objects at one time.
We can query on all fields of any datatype We can query only on fields whose data type is text,phone and Email.
We can use SOQL in the Triggers and the classes. We cannot use in Triggers but can in classes.
We can perform DML operation on sql query results. We cannot perform DML operation on search results.
Q102) What is Future Annotation(@Future)?

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

  • Methods with future annotation must be static methods
  • Methods with future annotation can only return a void type.

Syntax:

global class class_name
{
@future
Static void methodname(parameters)
 {
//body of the method
}
}
Q103) What is AppExchange directory?

Ans: A web directory where hundreds of appexchange 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.

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

Ans:  We use

Q105) Which field cannot be added to a custom index?

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

106) What is the difference between trigger and workflow?

Ans: Workflow:

  • Workflow is an automated process that fired an action based on Evaluation criteria and rule criteria.
  • We can access a workflow across the object.
  • We cannot perform DML operation on workflow
  • We cannot query from database

Trigger:

  • 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 database in one trigger.
Q107) What are some apex classes that are commonly used within?

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

Q108) What are the effects of using the transient keyword?

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

Q109) What is the maximum number of field dependencies we can use in VisualForce page? 

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

Q110) What is the procedure to get the Security token in Salesforce?       

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

Q111) What is Metadata-driven development model?

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

Q112) What is S-Control?

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

Q113) What is wrapper class in Salesforce?  

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

Q114) What are force platform sites?

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

Q115) What is Tab in Salesforce?

Ans: A Tab is a user interface to display custom object data or other embed web content to a user. We have three types of tabs in Salesforce which are:

  • Custom Tabs.
  • Visualforce Tabs.
  • Web Tabs.
Q116) What are the types of email templates that can be created in Salesforce?

Ans: The below mentioned are the list of templates available in Salesforce :

  1. Text Template: This template can be modified or changed by any user.
  2. HTML with letterhead: People like administrators and users with Edit HTML permission can create this email template based on letterhead.
  3. Custom HTML: People like administrators and users with Edit HTML permission can create this email template without using letterhead. It requires knowledge of HTML or gets the HTML code to insert it into the email template.
  4. Visualforce Email Template: This template can only be created by administrators and developers using VisualForce. It is capable of merging the data from various records.
Q117) If we want to share records based on condition like share records to a group of users.Whose country criteria is India. What are the steps to be followed?

Ans: 

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

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 share object.

Q118) Is it possible to edit VisualForce page in production environment?

Ans:  Yes, of course! We can create and edit the VisualForce pages in both the production environment and in a sandbox. The only thing you can not do in a production environment with a VisualForce page is adding the unique values for which you need to do this in the sandbox.

Q119) Is it possible to make changes to apex trigger/apex class in production function?

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

Q120) What are the things that can be customized on page layouts?           

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

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

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

Syntax:

Public static ID execute batch ( sObject class name)

Public static ID execute batch (sObject class name, integers scope)

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 what we are passing to the database.execute batch( ) method should be object of the class which has implemented database.batchable interface.

Q122) Will Visualforce still supports the merge fields usage like S-control?

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

Salesforce Scenario Based Interview Questions

Q123) As things are time taking client wants a report wherein single screen, without doing anything, he can see SALE PER COUNTRY? And in another report, sale per country per mobile brand.

Ans:  This can be viewed in the Summary Report.

Q124) As client wants to motivate sales reps to make more efforts, they are going to analyse the sale done by every sales report and reward them.They want a report where they can see country wise sell AlSO IN the SAME REPORT, sales rep wise sell.So they can also see in which country how the sale is & they want this analysis to be separate but in the SAME REPORT.

Ans: This can be viewed in the Matrix Report.

Q125) Client wants to see data from mobile sell DB and Home Appliance sell DB together to take the decision of next financial year planning. Also, the client wants to group the sell, discount related columns grouped together?

Ans:  They can see all the required data by using the Joined Report.

Q126) When two objects are connected with each other using r/s, then on secondary record the relationship will be shown using field. On primary record, the relationship will be shown using related list.

Ans: 

Lookup R/S:

  1. It is used to connect 2 or more objects with each other as per the business requirement.
  2. It works on standard objects and custom objects.
  3. It is so simple type.
  4. It helps to loosely connect 2 objects.
  5. It is used whenever we don’t have much strong dependency between 2 objects.

[Related Page: Field Dependency in Salesforce]

Q127) There is only 2 MDR allowed per object how many custom levels it can have?

Ans:  It allow three custom levels per object.

(Eg: company → Workers → Sub workers.)

Q128) There is an object called Employee Details, and another object called Salary Info, think on a business perspective. If you want to combine the 2 objects, what will you choose in the relationship?

Ans:  This can be seen with Master Detail Relationship.

Q129) Assume that you require PC’s in bulk and have given an order to ‘XYZ’ company & they found a bulk supplier and asked to process, what would be the relationship between the company and the supplier?

Ans: This can be seen with LookUp Relationship.

Q130) Business Requirement - Assume there is finance dept, there are many users and they have access to an object called finance, In that object, there is a field called “Bonus”, and in the dept 10 users, only one should not see the field?

Ans: 

Scenario: Creation of Permission set for the users, other than the user who should not have the Bonus field access.

Description:

Object: profit & loss.

Users: John & Philip

Condition::

OWD: Private.

Profile of John: Finance profile.

Finance Profile : CRED : Yes | VA : No | MA : No

Permission set of john : N/A

Role : N/A.

Q131) Can John see records of Philip?

Ans: No, John cannot see the records of philip.

Condition:: OWD: PRO(Public Read only).

Q132) Can John see records of Philip?

Ans:  Yes, now John can see the records of the Philip.

(Hint: Does he have min access to work on the object & OWD= PRO).

Condition:: OWD: PRW(Public Read Write).

Q133) Can John edit records of Philip?

Ans:  Yes, John can edit the records of Philip.

(Hint: Does he have min access to work on the object & OWD= PRW).

Q134) Can John delete records of Philip?

Ans: No, now John cannot delete the records of philip.

Profile: Sales Profile.

Users: Stephen, Philip.

User in another profile: Celia.

Condition:: Object Setting in finance profile : CRED=Y | VA=N | MA=N.

Q135) In the above scenario can Stephen see the record of Celia or not?

Ans:  No.

Q136) Can Stephen see the record of Philip?

Ans: No.

Condition :: Object Setting in finance profile : CRED=Y | VA=Y | MA=N.

Q137) Can Stephen see the record of Celia?

Ans: Yes.

Q138) Can Stephen delete the record Philip & Celia?

Ans:  No, he cannot delete anyone’s records.

Mindmajix offers you a great way to showcase your level of skills and areas of expertise with industry level projects, and fast track your career with Salesforce Certifications.