Salesforce Technical Questions with Answers -1

  • Salesforce Interview Questions

In this series of blogs and articles, Cloudely experts present you the Salesforce interview questions and answers, real-time scenarios, use cases, errors, turnarounds and more. This article is the first of this series. We hope you will find it helpful.

1)  Use Case: How to Lock the records which are queried through Apex?

Using the FOR UPDATE keyword, we can lock the rows fetched by SOQL query. We can overcome the following errors like (UNABLE TO LOCK ROW and UNABLE TO OBTAIN EXCLUSIVE ACCESS OF THIS RECORD.) When there are two/more processes updating the same record at the same time, we will face these errors.

[SELECT Id,Name from Opportunity FOR UPDATE ];

2) Error: You have reached the maximum number of 15 object references on ObjectName. You must remove at least 1 relationship(s) in order to save this Formula Field. – How to overcome this error?

This error occurs due to using more than 15 cross object references in Formula fields, Workflow Rules and Field Updates, Approval Processes, Validation Rules, Assignment Rules, Escalation Rules, Auto-Response Rules on a single object.


Create a flow/Process Builder and write a formula you want, to update a field on that specific object.

3) ERROR : Compiled formula is too big to execute. Maximum size is 5,000 characters.

When you use formula fields to calculate another formula, it will consider both fields into character limits. So, if we use a complex formula or nested formulas you might get this error.

Workaround: Move your entire formula into a flow/Process builder, calculate the values over there and load the value into another field(this is a new field you need to create based on the return type of your formula). Then update the record.

4) Case: when a user creates any opportunity, it is redirecting him/her to the product selection screen. Why?

Possibility: Prompt users to add products to opportunities this setting may be enabled.

To disable it , go to setup -> search for Opportunity settings in quick find → uncheck the checkbox for “Prompt users to add products to opportunities”.

Suggested Reading: Salesforce Interview Questions Series 1

5) How to avoid nested iterations?

We can use map collections to avoid writing loop inside loop. This will decrease the execution time.


for(Account Acc: [select id,acountcustomfield__c from account]){

for(contact con: [select id,contactcustomfield__c from contact where AccountId ]){

if(con.contactcustomfield__c != acc.accountcustomfield__c){

Delete con;




To avoid nested iterations, we can use map as shown below:

MAP<id,account> accmap= new map<id,account>();

for(Account Acc: [select id,acountcustomfield__c from account]){



for(contact con: [select id,accountID,contactcustomfield__c from contact where AccountId =:accmap.keyset()]){

if(con.contactcustomfield__c !=  accmap.get(con.accountID).contactcustomfield__c){

Delete con;



6) Why do we need Salesforce CPQ ?

CPQ stands for Configure, Price, Quote.  If you want to generate an accurate quote/ proposal and get approvals in a very fast manner in the competitive world, CRM alone could not make it.

Salesforce CPQ will allow you to avoid manual errors and fasten the process of generating quotes. Not only the quote generation, from Quote to Cash the entire process we can achieve through Salesforce CPQ and Billing.

Guided upsell and cross sell increase additional revenue, automated proposal and contract generation improves sales rep productivity and product validations will decrease the  orders rejection in some cases and boosts the customer satisfaction.

You can maintain and monitor your data all at one place like customers, Opportunities, Quotes, Orders, Approvals and Payments.

7) As a Salesforce Admin/Developer, why do we learn Salesforce CPQ?

Salesforce CPQ is very developer friendly. We can configure products, pricing and documents with some clicks. We can achieve 80% of the requirements with out of the box features in Salesforce CPQ.

On other hand, Salesforce CPQ has 9.53% market share and 2486 customers. It is in the top 3 in competition in the CPQ segment.

Suggested Reading: Salesforce Technical Questions and Answers

Learn Salesforce with Cloudely

If you learn and certified in Salesforce , It would be a great addition to your skills and profile and will get better opportunities when you are in the market because of its demand and rate of growth.

Explore our online Salesforce training programs.

Found this article informative? Share this article.

Looking for expert answers to Salesforce questions? Send them to Our Salesforce experts will answer your queries.

Gopi Dammalapati is Senior Salesforce Developer and Technical Mentor at Cloudely Inc. His areas of specialization include Apex and CPQ implementation. He has a great passion in mentoring budding Salesforce enthusiasts. You can connect with him on LinkedIn and Trailhead.

By |2023-01-11T14:09:18+00:00January 5th, 2023|Comments Off on Salesforce Technical Questions with Answers -1