Salesforce Interview Questions with Answers Part 35

1. When will you use Process builder or Workflow?

2. When a new opportunity is created I need to update the status as Processing, what will you use? Process Builder or Workflow? Why?

Workflow Field Update is preferable because if field update is done using Process builder, then record will go through complete Save cycle again.
If field update is done using Workflow field update, then Custom validation rules, duplicate rules, and escalation rules will not run again.

3. You have a customer sitting in front of you and giving his requirements. You go into your org to check something. How do you identify if you are in FORCE.COM or ?

Setup keyword in the URL says that we are in

4. How can we avoid View State memory error?

5. what is transient ? is it class level or Object level?

Class level.

6. Can we use SOSL within triggers? Can we use SOSL within APEX classes?

We can't use SOSL in Triggers Because the apex developer's guide says SOSL statements evaluate to a list of lists 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 SOSL query. SOSL queries are only supported in Apex classes and anonymous blocks.You cannot use a SOSL query in a trigger.

7. What is External ID? How it is used? Can it have duplicates?

It can contain duplicates. But if unique check box is checked, then it cannot contain duplicates.

8. How is deployment process carried out in FORCE.COM IDE?

Backup from target is archived and then deployed to target.

9. What are the WSDLs that Salesforce offers?

Enterprise WSDL
Partner WSDL
Metadata WSDL
Tooling WSDL
Delegated Authentication WSDL

10. What is stateless and state full?

Stateless and State full determines whether to maintain variable value inside the Batch class.

11. If you want an secure interface which one will you use? SOAP or REST?


12. Can we update a record in Before Insert using Trigger.New?

No using DML operation since Id won't be available. Yes without using DML operation for pre-populating field values.

13. Is Static at class level? 


14. What is the maximum number of records returned by SOQL ? 

It depends upon the context. Inside the Apex controller it is 50,000.

15. What are the types of SOQL statements in Salesforce?

1.Static SOQL: The static SOQL Statement is written in [] (Array Brackets)

List < String > listTypes = new List < String > {'Customer', 'Partner'};
List < Account > listAcct = [ SELECT Id, Name FROM Account WHERE Type =: listTypes ];

2. Dynamic SOQL: It is used to refer to the creation of a SOQL string at runtime with Apex code.

List < String > listTypes = new List < String > {'Customer', 'Partner'};
List < Account > listAcct = Database.query('SELECT Id, Name FROM Account WHERE Type =: listTypes');


  1. 12. Can we update a record in Before Insert using Trigger.New?


    In before triggers, we can make the changes to same record right?

    1. Same record yes. But, we cannot use DML operation on it.