Salesforce Interview Questions



1. What is Apex?

    It is the technology of salesforce.com which is similar to Java programming with object-oriented concepts and to write our own custom logic.

2. What is a Visualforce Page?

    Visualforce is the new markup language from salesforce, by using this, 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 parts can be determined by using Visualforce Markup Language and the business logic can be written in custom controllers associated with the Page.

3. Where to write Visualforce code?

    We can write the code basically in 3 ways.

a. Setup --> App Setup --> Develop -> Pages and create new Visualforce page.

b. Setup -> My Personal Information -> Personal Information -> Edit check the checkbox development mode. When we run the page like this, https://ap1.salesforce.com/apex/helloWorld. we will find the Page editor at the bottom of the page. we can write a page as well as the controller class associated with it, there itself.

c. Using VS Code we can create the Visualforce page and write the code.

4. What are Apex Governor Limits?

     Governor Limits are runtime limits enforced by the Apex runtime engine. Because Apex runs in a shared, multitenant environment, the Apex runtime engine strictly enforces a number of limits to ensure that code does not monopolize shared resources. Types of limits that Apex enforces are resources like memory, database resources, the number of script statements to avoid infinite loops, and the number of records being processed. If the code exceeds a limit, the associated governor issues a runtime exception.

5. How to schedule export or take the backup of salesforce?

    Salesforce allows us to obtain a copy of all data using the data export feature. We can generate backup files manually once every six days or schedule them to generate automatically at weekly or monthly intervals.

The backup file will come to us in the form of a zip file that contains all of the organization’s data in a set of CSV (comma-separated values) files. If we do not see the data export feature, contact salesforce.com support to have the Data Export Service activated.

    The following path will tell us how to schedule the export
Click Setup -> Data Management -> Data Export -> Schedule Export.

6. Do governor limits apply to sandbox instances?

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

7. What is the difference between ISNULL and ISBLANK?

    Both Determines if an expression has a value and returns TRUE if it does not. If it contains a value, this function returns FALSE

ISBLANK (expression): The expression allows both number and text fields.

ISNULL (expression): Here the expression allows only number fields.

8. What is the difference between the Workflow and Approval Process?

    Workflow Rules and Approval Processes can be used together

Workflow Rules

Approval Processes

Are triggered upon Save

Are triggered only when a user clicks “Submit for Approval” button

Consist of one set of criteria and actions

Consist of multiple steps

 

Have entry criteria, step criteria, and step actions

 

Have Initial submission actions, rejection an approval actions and actions for each step

Can be modified or deleted

Some attributes can’t be modified, processes must be deactivated before they can be deleted




9. When we can’t add Time-dependent action in the Workflow rule?

    We can’t add time-dependent actions to a rule if we choose “Every time a record is created or edited” evaluation rule criteria.

10. What are the types of email templates available in salesforce.com?

There are four kinds of Email Templates

a. Text 
b. HTML with Letter Head
c. Custom HTML
d. Visualforce

11. What is the Roll-up summary field in Salesforce?

    A read-only field that displays the sum, minimum, or maximum value of a field in a related list or the record count of all records listed in a related list. Thus, we can say that the Roll-up summary field can only be created on the Master object.

12. What are the Record Types?
    
Record types used to display different picklist values and page layouts to different users based on their profiles

13. Have you implemented Record Types in your project?

     Yes, we have created Record Types and we have done Page Layout Assignment also

14. How to make the Record type default?

By using the Profiles.

Go to the particular profile and by using Record Type Settings we can make the Record Type as a default

15. What will happen if the Account is deleted?

    If the Account is deleted then Contact, Opportunity will also be deleted from Salesforce which are related to that Account.

16. How many types of relationship fields available in Salesforce?

    There are four types of relationships in salesforce

a. Master-Detail
b. Many to Many
c. Lookup
d. Hierarchical (It is available only on User Object)

17. What is a Hierarchical Relationship?

    It is the relationship available on the User object which allows users to click a lookup icon and select another user from a pop-up list.

This type of relationship is a special lookup relationship available only for the user object. It allows creating a Manager Field on the user object to relate to another user.

This relationship will act as a Self-relationship.

18. How to create many too many relationships between objects?

Ans: Create one custom object, which should have an auto number as unique identification, and create two Master - Detail relationships for this object. And this Object is called a Junction object.


19. What is a JUNCTION object?

    A Junction object is a custom object with two Master-Detail relationships. Using this custom junction object, we can model a “many-to-many” relationship between two objects.

20. Say If we created a junction object A with masters B and C? Suppose if we try to delete the records in C what happens to the child?
    
Childs will also delete as per the properties of the Master-Detail relationship.

21. What is the Order of execution in Salesforce?

The following is the order salesforce logic is applied to a record.

1. Old record loaded from the database

2. New record values overwrite old values

3. System Validation Rules

4. All Apex “before” triggers

5. Custom Validation Rules

6. Record saved to the database (but not committed)

7. All Apex “after” triggers (EE / UE only)

8. Assignment rules

9. Auto-response rules

10. Workflow rules

11. Escalation rules

12. Parent Rollup Summary Formula value updated (if present)

13. Database commit


22. If one object in Salesforce has 2 triggers that run “before insert”. Is there any way to control the sequence of execution of these triggers?
    
    Salesforce.com has documented that trigger sequences cannot be predefined. As a best practice create one trigger per object and use comment blocks to separate different logic blocks.


23. How to delete the User from Salesforce?

As of now, salesforce does not allow us to delete any user, however, we can deactivate the user.