Question 1. What is Sandbox and the Type of Sandbox in Salesforce?

A Salesforce sandbox is an isolated copy of your organization’s production environment that is used for development and testing purposes. Your production environment has your live data and active users logging in. A Salesforce sandbox will always include a copy of your production organization’s metadata Types of Sandbox in Salesforce There are 4 types of Salesforce sandbox environments. Developer Sandbox Developer Pro Sandbox Partial Copy Full Sandbox

Question 2. What is Cloud Computing?

Cloud computing is a way to access information and applications online instead of having to build, manage, and maintain them on your own hard drive or servers. It’s fast, efficient, and secure. Simply put, cloud computing is a way of accessing services on the internet instead of on your computer. You can use the cloud to access applications, data, and development tools from virtually anywhere. Whether you’re working on your phone from a crowded train in Chicago or on your laptop at a hotel in Hong Kong, you can access the same information because it all lives online.

Question 3. What is Iaas?

IaaS stands for Infrastructure as a service: A cloud service provider owns and manages the hardware upon which your software stack runs. That includes servers, networking, and storage. This can be a great cost-reduction strategy if you’d like to avoid purchasing and maintaining infrastructure. In this type of service, you will get the Virtual System that can be connected using the internet. Where you can install any Software even in some service providers you can install the operating system.

Question 4. What is PaaS?

PaaS stands for Platform as a service: In this type of service, you get a development platform bundled with all the types of software preinstalled. You will then have to write and execute all your codes in a remote server by some mechanism.

Question 5. What is Saas?

SaaS stands for Software as a service: It offers the most support and is the simplest of all delivery models for the end user. Chances are that you already use it in your organization. This is the highest level of service in which everything is provided from hardware to software to already build applications.

Question 6. What is the type of object relationship in Salesforce?

There are six types of object relationships in Salesforce. Lookup Relationships

Master-Detail Relationship

Many-to-Many Relationships (Junction Object) Self Relationship External Relationships Hierarchical Relationships

Question 7. What is Junction Object in Salesforce?

A junction object is a custom object with two master-detail relationships, and it is the key to making a many-to-many relationship.

Question 8. What is the difference between Roles and Profiles?

Profiles help to control object privileges such as CRED (Create, Read, Edit, Delete). They also contain system permissions that a user can carry out such as exporting data. Profile used for object level and Field level access. It is mandatory for all Users. Roles on the other hand help with sharing records across an organization. They work in a hierarchical fashion, giving users access to records that are owned by people lower down in the hierarchy. Roles used for Record level access. It is not mandatory for all Users.

Question 9. How many ways we have in Salesforce for Sharing?

There are 20+ ways to share record access in Salesforce.

Profile/ Permission set Object level CRED access
View All and Modify All permission on the profile or permission set

Profile level System Permission.

Organization-Wide Default (OWD)

Record Ownership Role Hierarchy

Case Team, Account Team, and Opportunity Team.
Queues
Sharing Rules
Groups
Territory Management
Sharing Sets
Sharing Groups
Super User Access
Manual Sharing
Apex Sharing
Visualforce with Apex
Implicit Sharing
Master-Detail Relationship
External Account Hierarchy

Question 10. What are Sharing Rules?

Sharing rules in Salesforce are used to create automatic exceptions to the Organization-Wide Default settings for the users who do not own the record. They should be applied to the objects whose org-wide defaults are set to Public Read-only or Private because sharing rules can only extend the access they cannot restrict the access provided by Organization-wide defaults. There are 2 types of Sharing Rules in Salesforce based on which records to be shared: Owner Based Criteria Based

Question 11. How do we do Manual Sharing?

The Manual sharing button allows users to share records with others with one button click. Sometimes we encounter a scenario where individual users want to share their records with another colleague (user). In that case, manual sharing is the best option.

Question 12. What is Apex Sharing?

There are situations where the business requirement is too complex and standard sharing rules provided by the Salesforce will not work. In that case we can use the Apex Sharing. To access sharing programmatically, you must use the share object associated with the standard or custom object for which you want to share. For example, AccountShare is the sharing object for the Account object and for MyCustomObject it should be like MyCustomObject__Share. Here is sample code. Learn more about Apex Sharing.

public static boolean apexSharingDemo(Id recordId, Id userOrGroupId){
MyCustomObject__Share myCustomObject  = new MyCustomObject__Share();
myCustomObject.ParentId = recordId;
myCustomObject.UserOrGroupId = userOrGroupId;
myCustomObject.AccessLevel = 'Read';
myCustomObject.RowCause = Schema.MyCustomObject__Share.RowCause.Manual;
Database.SaveResult[] jobShareInsertResult = Database.insert(myCustomObject,false);
}

Question 13. Type of Flow in Salesforce?

Flow is an automation tool provided by Salesforce which can be used to perform various tasks like Sending Emails, Posting chatter, Sending custom Notifications &, etc using clicks instead of code. Check Salesforce Flow Builder training if you are new. Screen Flow: With Screen Flow you can create a custom UI (user interface) and guide users through a business process that can be launched from Lightning Pages, Experience Cloud (previously known as Community Cloud), quick actions and more. Record-Triggered Flow: This Flow launches when is record is created, updated, or deleted. So far, we have used Apex triggers for these automations some of which can now be done using Flows. Scheduled-Triggered Flow: This flow launches at the specified time and frequency for each record in a batch. Traditionally we have met this kind of requirement using Apex batch jobs. Platform Event Flow: Launches when a platform event message is received. For example, you can pump the data from an external system in Platform Events and then use Flows to split and save the records in different objects. Auto launched Flow: Launches when invoked by Apex, Process Builder or even REST API

Question 14. When to use Salesforce Flow and Apex?

Try not to mix Apex, Process Builders, Workflow Rules, and Record-Triggered flows. In general, you should choose one automation tool per object. Salesforce Flow Apex let declarative tools handle non-DML activities like email alerts and in-app alerts separate DML activity and offload it to Apex

Question 15. Best practices for Salesforce Flow?

Check out the Apex hour blog post to learn about Best practices for Salesforce Flow. Always! Plan Before You Build “One Record-Triggered Flow” Per Object – Per Type No DML Statement in Loops Use the Advanced Technique to Merge Decision Node Build Reusable Flow(s) – Subflow(s) Don’t Create Flow for Everything Build in a test/Sandbox environment Supercharge Flow with Invocable Apex Don’t Hardcode IDs, Query for them! Dont mix Trigger, Process Builder, Flow and Record Trigger Flow Handle Errors with Fault Paths Exception handling in flow using Platform Events Use Debug Log to Check Why a Flow Fails at Runtime Flow Naming Conventions

Question 16. What is Apex? and when to use Apex over Flow?

Apex is a programming language developed by Salesforce. It is a strongly typed, object-oriented programming language that allows developers to execute flow and transaction control statements on the Salesforce platform. One common approach is to separate DML activity and offload it to Apex, and let declarative tools handle non-DML activities like email alerts and in-app alerts — just be careful and ensure none of your Apex conflicts.

Question 17. What are Apex Best practices in Salesforce?

Apex code is used to write custom and robust business logic. As with any language, there are key coding principles and best practices that will help you write efficient, scalable code. Check our Apex best practices of Salesforce. Bulkify Apex Code Avoid SOQL & DML inside for Loop Querying Large Data Sets Use of Map of Sobject Use of the Limits Apex Methods Avoid Hardcoding IDs Use Database Methods while doing DML operation Exception Handling in Apex Code Write One Trigger per Object per event Use Asynchronous Apex

Question 18. What is Apex Trigger? and When we should use Apex Trigger?

The trigger is a procedure in a database that automatically invokes whenever a special event in the Database occurs. Apex triggers enable you to perform custom actions before or after events to records in Salesforce, such as insertions, updates, or deletions. Learn more about apex trigger here. There lots of automation tool available in Salesforce. Lets understand the when to use Apex Trigger in Salesforce. Complex logic incapable of being processed via declarative artifacts Logic associated with DML Operations on unrelated objects Integration with External Systems

Question 19. What is Apex Trigger Handler pattern?

Check this blog post to learn about which all trigger patterns are available in Salesforce. For Trigger Handler code check this post.

Question 20. What is Apex Trigger Framework? What are different Trigger Framework are available in Salesforce?

How many trigger frameworks are available in Salesforce, which one is a lightweight apex trigger framework and a Comparison of different approaches? Check our Apex hours Trigger Framework in Salesforce sessions. Trigger Handler Pattern Trigger Framework using a Virtual Class Trigger Framework using an Interface An architecture framework to handle triggers

Question 21. What is Async Apex in Salesforce? How many ways do we have for Async processing?

In technology terminology, Asynchronous operation means that a process operating independently of other processes. Schedule & Batch jobs

Queues

@future Change Data Capture – Apex Triggers (Summer ’19) Platform Events – Event Based Continuations (UI)

Question 22. What is a Batch job in Salesforce?

Batch class is used to process millions of records with in normal processing limits. With Batch Apex, we can process records asynchronously to stay within platform limits. If you have a lot of records to process, for example, data cleansing or archiving, Batch Apex is probably your best solution. In Batch Apex each transaction starts with a new set of governor limits, making it easier to ensure that your code stays within the governor execution limits

Question 23. What is the difference between the Stateful and Stateless batch jobs?

If your batch process needs information that is shared across transactions, one approach is to make the Batch Apex class itself stateful by implementing the Stateful interface. This instructs Force.com to preserve the values of your static and instance variables between transactions.

global class SummarizeAccountTotal implements Database.Batchable<sObject>, Database.Stateful{
}

In Short, if you need to send a mail to check the number of records passed and failed in the batch job counter, in that case, can you Stateful batch job? If you want to create one counter and share/ use it in each execute method use the same. Batch Apex is stateless by default. That means for each execution of your execute method, you receive a fresh copy of your object. All fields of the class are initialized, static and instance.

global class SummarizeAccountTotal implements Database.Batchable<sObject>{
}

Question 24. What is mixed DML?

A Mixed DML operation error occurs when you try to persist in the same transaction and change to a Setup Object and a non-Setup Object. For example, if you try to update an Account record and a User record at the same time.

Question 25. What is Lightning Data Service?

Use Lightning Data Service to load, create, edit, or delete a record in your component without requiring Apex code. Lightning Data Service handles sharing rules and field-level security for you. In addition to simplifying access to Salesforce data, Lightning Data Service improves performance and user interface consistency

Question 26. How to do communication between Lightning web components?

Use the Events in lightning web components (LWC) to communicate between components. Events in Lightning web components are built on DOM Events, a collection of APIs and objects available in every browser. Here we will be see how to the events using the Custom-event interface and publish-subscribe utility. Learn about Event in LWC in our Events in Lightning web components post. Events are used in LWC for components communication. There are typically 3 approaches for communication between the components using events. Parent to Child Event communication in Lightning web component Custom Event Communication in Lightning Web Component (Child to Parent ) Publish Subscriber model in Lightning Web Component or LMS (Two components which doesn’t have a direct relation )

Question 27. How to call Apex class in Lightning web component and how many way we have and when to use which option?

You can call the apex methods as functions into the component by calling either via the wire service or imperatively. To call an Apex method, a Lightning web component can: Wire a property Wire a function Call a method imperatively To expose an Apex method to a Lightning web component, the method must be static and either global or public. Annotate the method with @AuraEnabled

Question 28. What are the basic difference between Application Event and Component Event in Aura component?

Application Event Component Events Application Events are handled by any component have handler defined for event.These events are essentially a traditional publish-subscribe model Component Events can be handled by same component or a component that instantiates or contains the component Application event can be used through out the application. The component events can only be registered in child component and handled by parent component We use attribute type="APPLICATION" in the aura:event tag for an application event. We use attribute type="COMPONENT" in the aura:event tag for a component event.

Question 29. What is a lightning messaging service?

Lightning Message Service (LMS) allows you to communicate between Visualforce and Lightning Components (Aura and LWC both) on any Lightning page. LMS API allow you to publish message throughout the lightning experience and subscribe to the same message anywhere on lightning page.

Question 30. What is lazy loading in LWC and how do lazy loading in LWC?

Lazy loading is an optimization technique to load the content on demand. Instead of loading the entire data and rendering it to the user in one go as in bulk loading, the concept of lazy loading assists in loading only the required section and delays the remaining, until it is needed by the user. Learn how to use lazy load in the lightning web component here.