May 16, 2021

Salesforce Interview Question and Answers

Salesforce Interview Question and Answers


1. What is Apex

Ans: It is the in-house technology of which is similar to Java programming with object oriented concepts and to write our own custom logic.

2. What is S-Control ?

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

3. What is a Visualforce Page ?

Ans: Visualforce is the new markup language from salesforce, by using which, We can render the standard styles of salesforce. We can still use HTML here in Visualforce. Each visualforce tag always begins with “apex” namespace. All the design part can be acomplished by using Visualforce Markup Language and the business logic can be written in custom controllers associated with the Page.

4. Will Visual force still supports the merge fields usage like S-control ?

Ans: Yes. Just like S-Controls, Visualforce Pages support embedded merge fields, like the {!$User.FirstName} used in the example.

5. Do governor limits apply to sandbox instances?

Ans : Governor limits do apply to all Salesforce instances (trial, developer, production or sandbox environments). However code coverage and successful execution of test classes is only enforced when deploying to a production environment.

6. What are the types of email templates available in

Ans :

  1. Text
  2. HTML with Letter Head
  3. Custom HTML
  4. Visual force

7. How many types of the relationship fields available in Salesforce?

Ans :

  1. Master Detail
  2. Many to Many
  3. Lookup
  4. Hierarchical (It is available only on User Object, we cannot create this relationship)

8. How to delete the User from Salesforce?

Ans : As per now, salesforce does not allow to delete any user, however you can deactivate the user.

9. How to delete the users data from Salesforce?

Ans : To delete the Users Data go to Setup | Administration Setup | Data Management |  Mass Delete Record, from there select the objects like Account, Lead etc and in criteria select the users name and delete all records of that user related to particular object.

10. How to restrict the user to see any record, lets say opportunity?

Ans : set up opportunity sharing to be private.  If both users are admins or have view all records on opportunity, then that overrides private sharing.

11.  What is difference between WhoId and WhatId in the Data Model of Task ?

Ans : WhoID refers to people things. So that would be typically a Lead ID or a Contact ID

WhatID refers to object type things. That would typically be an Account ID or an Opportunity ID

12. How you can provide the User Login (Authentication) in Public sites created by Salesforce.

Ans : We can provide the authentication on public sites using “Customer Portal”.

13.  What is the dynamic Apex?

Ans : Dynamic Apex enables developers to create more flexible applications by providing them with the ability to “Access sObject and field describe information”, “Write Dynamic SOQL Queries”, “Write Dynamic SOSL Queries” and “Dynamic DML”

14. How to get the list of all available sobject in salesforce database using Apex (Dynamic Apex)?

Ans : Map<String, Schema.SObjectType> m =  Schema.getGlobalDescribe();

15. What is the controller extension ?

Ans : Any apex class having a public constructor with Custom Controller or Standard Controller object as a single argument is known as controller extension.

16 : How to read the parameter value from the URL in Apex?


Consider that the parameter name is “RecordType”.

String recordType = Apexpages.currentPage().getParameters().get(‘RecordType’);

17. Can we convert the lookup relationship to Master Detail relationship?

Ans: We can convert the lookup relationship to master detail relationship if and only if all the existing record has valid lookup field.

18. In How many way we can invoke the Apex class?


  1. Visualforce page
  2. Trigger
  3. Web Services
  4. Email Services

19. Can we create Master Detail relationship on existing records?

Ans: No. As discussed above, first we have to create the lookup relationship then populate the value on all existing record and then convert it.

20. How validation rules executed? is it page layout / Visualforce dependent?

Ans : The validation rules run at the data model level, so they are not affected by the UI. Any record that is saved in Salesforce will run through the validation rules.