Quantcast
Monday , September 24 2018
Home / Salesforce Interview Questions / Salesforce Interview Question and Answers Part 2

Salesforce Interview Question and Answers Part 2

Salesforce Interview questions on DML

Q. How many types of DML statements does Salesforce supports?

A. There are altogether 6 types of statements:-

  1. Insert
  2. Delete
  3. Update
  4. Merge
  5. Undelete
  6. Upsert

Q. How many DML statements are allowed in on transactions?

A. Salesforce allows 150 DML statements per transaction.

 

Q. What is difference between insert and Database.insert()?

A. The main difference between them is that Database.insert, lets one process partial record processing if an error is encountered during the processing of bulk records.

 

Q. How to undelete a record from recycle bin with the help of DML?

A. For this to work records should be deleted and present in the recycle bin:

For eg : List<contacts> cons= [select id from contact where isDelete = true ALL ROWS];

Undelete cons;

 

Q. What happens to the child record when we merge two records?

A. You can merge max 3 records in one time and Salesforce deletes the other records and reparent the child records.

 

Salesforce interview Questions SOQL

 

Q. What is SOQL?

A. It stands for Salesforce Object Query Language.

 

Q. How many SOQL we can perform per transaction?

A. We can perform 100 SOQL statements per transactions.

 

Q. How can we fetch top 5 opportunity according to the amount?

A. Select Name, id from opportunity order by desc amount limit 5.

 

Q. How many records can we fetch using one SOQL query?

A. We can get upto 50000 rows of records per SOQL query.

 

Q. How can we fetch related contact records by querying on Account object?

A. We would have to use inner query to fetch all the child records using their relationship name.

Select Name, id, (select name from contacts) from account

 

Q. What is SOSL?

A. It stands for Salesforce Object search language.

 

Q. How it is different from SOQL?

A. We can search for a value in more than one object in one SOSL query. Its syntax is also different with respect to SOQL. We can only perform 20 SOSL per transaction and we can only see 2000 rows of returned records.

 

Q. How to use filter on Name field if only partial string value is known?

A. SELECT Name, id FROM Account WHERE Name LIKE ‘Z%’

 

Q. What is the correct way to use date in where clause?

A. For this we need to make sure that the field we are using in where clause is of type Date or DateTime as syntax for both are different.

For DateTime: SELECT Name, id FROM contact WHERE CreatedDate > 2017-04-26T10:00:00-08:00

For Date         : SELECT Name, id FROM contact WHERE CreatedDate > 2017-04-26

 

Q. How to filter Boolean field in SOQL?

A. The syntax of where clause would be something like this:- ’ Where BolleanFieldName = True ‘

 

Q. How to use Multi Select picklist as a filter while fetching data using SOQL?

A. For Exact match of ABC and EFG below statement is used

SELECT Id, Name, FieldNameMultiSelectPl__C FROM CustomObjectName__c WHERE FieldNameMultiSelectPl__C = ‘ABC;EFG’

 

Or for multiple values.

 

SELECT Id, Name, FieldNameMultiSelectPl__C FROM CustomObjectName__c WHERE FieldNameMultiSelectPl__C includes (‘ABC;EFG’ ,’CDE’  )

 

Q. How many characters are allowed in a where clause?

A. We are allowed to use maximum of 4000 characters in a where clause per SOQL.

 

Q. What are the considerations for using Group by clause?

A. There are some fields on sObject which are not supported in grouping.

If a query includes Group by clause then it cannot be used with queryMore() method.

Relationship queries cannot be used in conjunction with Group By clause.

***** more questions to come 

 

Next: 

About Sumit Datta

Sumit Datta
I am a 3x Certified Salesforce developer with overall 5 years of IT experience and 3 years of Implementation experience in Salesforce. I am here to share my knowledge and help Beginners in Salesforce to understand the concepts of Apex, Visualforce, Salesforce Lightning and Salesforce Configuration.

Check Also

MODAL Box

How to create a Modal box in Lightning Component?

How to create a Modal box in Lightning Component? In this post we are going …

Salesforce Lightning Training

How to send parameters in AuraEnabled methods in Salesforce Lightning Components?

How to send parameters in AuraEnabled methods in Salesforce Lightning Components? Passing value to and …

Salesforce Lightning Tutorials

How to use lightning accordion

How to use lightning accordion and how to dynamically add accordion section in lightning. In …

Salesforce Lightning Tutorial

How to fetch and display list of records in Lightning Component

How to fetch and display list of records in Lightning Component? In this post we …