0% found this document useful (0 votes)
66 views34 pages

What Is Cloud

The document provides an overview of cloud computing, detailing various types of clouds such as Sales, Service, Marketing, Commerce, Health, and Education Cloud, each tailored for specific business needs. It also explains the sales process in Salesforce, editions of Salesforce, types of licenses, and key concepts like objects, accounts, contacts, opportunities, and data modeling. Additionally, it discusses relationships between different Salesforce entities, validation rules, and the purpose of sandboxes and orgs in Salesforce.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views34 pages

What Is Cloud

The document provides an overview of cloud computing, detailing various types of clouds such as Sales, Service, Marketing, Commerce, Health, and Education Cloud, each tailored for specific business needs. It also explains the sales process in Salesforce, editions of Salesforce, types of licenses, and key concepts like objects, accounts, contacts, opportunities, and data modeling. Additionally, it discusses relationships between different Salesforce entities, validation rules, and the purpose of sandboxes and orgs in Salesforce.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

What is cloud?

The cloud is a distributed collection of servers that host software and infrastructure, and it is
accessed over the Internet.

Types:

Sales cloud- Managing sales process and tracking the customer interactions and automatic
tasks

Service cloud – Designed for customer service terms

Ex: If a customer having an issue they can access through chat or email and rectify the issues
in a particular time

Marketing Cloud:
Provides tools for email marketing, social media marketing, customer journey management,
and marketing analytics.
Example: A company can send personalized email campaigns based on customer behavior,
improving engagement.
Commerce Cloud:
Focuses on eCommerce, helping businesses build and manage online stores. It supports B2C
and B2B commerce experiences.
Example: A retailer can manage product catalogs, pricing, and customer orders in a unified
platform.

Health Cloud:
Tailored for the healthcare industry, this cloud helps manage patient relationships and
coordinate care.
Example: A healthcare provider can manage patient records and interactions with a full view
of the patient’s health history.

Education Cloud:
Built for educational institutions, it helps manage student relationships, admissions, and
alumni engagement.
Example: A university can track prospective students, manage admissions, and engage with
alumni for fundraising.

What is sales process

Repeating of the steps converting lead to customer

A sales process is a series of repeatable steps your sales team can follow – from initial
research to closing deals and upselling.

sales process in Salesforce typically consists of the following steps:


1. Lead Generation: Lead generation is the foundation of sales success, as it involves
finding potential customers interested in your products or services through various
avenues like social media, website visitors, and marketing campaigns.

2. Lead Qualification: Salesforce sales qualifications are generated, which need to be


qualified to determine if they are a good fit for the company’s products or services.
This involves collecting information about the lead’s needs, budget, and timeline to
assess their readiness to make a purchase.

3. Opportunity Management: After the leads are qualified, they are converted into
opportunities, representing the potential for a sale. The sales team needs to manage
the opportunities by tracking their progress, assigning tasks, and collaborating with
other team members.

4. Sales Forecasting: Sales forecasting is a crucial step in the sales process as it helps
businesses plan their resources and make informed decisions. Salesforce provides
powerful forecasting tools that enable sales teams to predict future sales based on
historical data and current trends.

What is edition?

Edition is a bundle of features and services to meet the business needs

Types:

1. Essentials:

· Ideal for: Small businesses

· Features: Basic contact, lead, and opportunity management

2. Professional:

· Ideal for: Mid-sized companies


· Features: Enhanced sales forecasting and automation

3. Enterprise:

· Ideal for: Larger organizations

· Features: Advanced customization, reporting, and integration

4. Unlimited:

· Ideal for: Comprehensive needs

· Features: Full functionality, customizability, 24/7 support, premium features like generative
AI

5. Unlimited Plus:
· Ideal for: All business sizes needing robust solutions

· Features: Additional functionalities and enhanced capabilities

Key Considerations:

· Business Size: Number of users and overall scale


· Features Needed: Specific sales, service, or marketing features

· Scalability: Future growth and needs

· Budget: Cost vs. value proposition

What is License?

License in the salesforce will specify what set of basic features are offered by the
salesforce to the users.

1. Salesforce Platform License:


Used for users who need access to custom apps but not the full CRM functionality.
Ideal for internal users who don’t need access to standard CRM features like Sales
Cloud or Service Cloud.

2. Sales Cloud License:


Provides access to Salesforce’s sales features, such as managing leads, opportunities,
accounts, and forecasts. Typically used by sales teams to track and manage customer
relationships.

3. Service Cloud License:


Gives access to tools designed for customer service teams, including case
management, knowledge bases, and omnichannel support. Ideal for support teams to
handle customer inquiries and resolve issues.

4. Marketing Cloud License:


Aimed at marketing teams, it offers tools for email marketing, customer journeys, and
campaign management, helping businesses drive engagement and measure marketing
efforts.

5. Community Cloud License:


Provides access to create branded communities where customers, partners, and
employees can collaborate, share information, and resolve issues.

6. Developer License:
Intended for developers, this license offers access to the Salesforce platform to build
and test custom apps and integrations without consuming a full user license.
7. Chatter License:
Provides access to Salesforce’s social collaboration features, allowing users to share
information, collaborate on projects, and follow updates.

What is Salesforce Platform?

The Salesforce Platform is a cloud-based platform that helps businesses build, manage, and
customize applications to manage customer relationships and business processes.

Why we use Salesforce?

• Customization: You can build custom applications tailored to your business needs,
whether it's for sales, customer service, marketing, or more.Example: A company can
create a custom app to track unique customer data or automate business workflows.

• Scalability: Salesforce can grow with your business, handling everything from small
teams to large enterprises without performance issues.Example: A startup can use
Salesforce to manage a few leads, and as the business grows, it can scale to handle
thousands of customers and complex workflows.
• Integration: It integrates with other software and tools your business may use, such
as email systems, social media, and third-party apps.Example: Integrating Salesforce
with Gmail to automatically log emails from customers into the system.

• Automation: Salesforce automates repetitive tasks and processes, saving time and
reducing errors. Example: Automatically sending a follow-up email to a customer
after a sales meeting.
• Collaboration: Teams can easily collaborate within Salesforce, sharing data, tracking
progress, and managing projects. Example: Sales and customer support teams can
share information about a customer to improve the service experience.

• Access Anywhere: Being cloud-based, Salesforce allows users to access the platform
from any device, anywhere, as long as there's an internet connection.

What is Object?

An object is a database table that stores data.

Each object contains records (similar to rows in a database) and fields (similar to
columns).There are two types of objects in Salesforce: Standard Objects, Custom Objects
What is an Account?

In Salesforce, an Account represents a business or individual you have a relationship with.


There are two types of accounts:

1. Business Accounts: Store information about companies or organizations.

2. Person Accounts: Store information about individual people.

Example:

• Business Account: A company like "Tech Solutions Inc." where you track details such
as their industry, number of employees, and annual revenue.

• Person Account: An individual customer like "John Doe" where you store personal
details such as name, address, and contact information

Accounts help you manage and organize your customer data effectively. If you have more
questions or need further details, feel free to ask!

What is Contact?

A Contact represents an individual associated with an Account.


• Example: "Jane Smith," a contact at "Tech Solutions Inc." with details like email,
phone number, and job title
What is Opportunity?

An Opportunity represents a potential sales deal that you want to track through your sales
pipeline.
• Example: A deal with "Tech Solutions Inc." to sell 100 software licenses, with details
like the expected close date and deal value
What is Leads?

A Lead is a potential customer who has shown interest in your product or service but hasn't
yet been qualified.
• Example: "John Doe," who filled out a form on your website requesting more
information about your product
What is Cases?

A Case is a customer's question, feedback, or issue that needs resolution.

• Example: A support case from "Jane Smith" reporting a problem with the software she
purchased
What is Campaign?

a Campaign object represents a marketing initiative or event, such as a webinar, trade show,
or email campaign. It helps track the effectiveness of your marketing efforts and manage
related activities.

Example:

• Campaign: "Spring Product Launch 2025"

o Type: Webinar

o Start Date: March 1, 2025

o End Date: March 31, 2025


o Budgeted Cost: $10,000

o Expected Revenue: $50,000

o Members: List of leads and contacts invited to the webinar

What is Task?

A Task is a to-do item or activity that needs to be completed, such as making a phone call or
sending an email.

• Example: A task to follow up with "John Doe" about his interest in your product

What is Relation Ship between Account and Contact? (Look up)

Account to Contact: Lookup Relationship (One-to-Many)


• Example: "Tech Solutions Inc." (Account) has "Jane Smith" and "John Doe" as
Contacts.
What is Relation Ship between Account and Lead?

Lead to Account/Contact/Opportunity: Lookup Relationships upon conversion (One-to-


Many)
• Example: "John Doe" (Lead) converts to "Tech Solutions Inc." (Account), "John Doe"
(Contact), and a new sales deal (Opportunity).
What is Relation Ship between Account and Opportunity? (Look-up)

Opportunity to Account: Lookup Relationship (Many-to-One)

• Example: A deal to sell software licenses to "Tech Solutions Inc." (Account).

What is Relation Ship between Account and Case?

Case to Account/Contact: Lookup Relationship (Many-to-One)


• Example: A support issue reported by "Jane Smith" (Contact) at "Tech Solutions Inc."
(Account).

What is Relation Ship between Account and Task?

Task to Account/Contact/Opportunity/Case: Lookup Relationship (Many-to-One)

• Example: A follow-up call with "John Doe" (Contact) about an Opportunity.

What is Relation Ship between Account and Campaign?

Campaign to Lead/Contact: Junction Relationship (Many-to-Many)


• Example: "Spring Product Launch 2025" (Campaign) includes "John Doe" (Lead) and
"Jane Smith" (Contact) as members.
What is Relation Ship between Opportunity and Contact? (Junction)

In Salesforce, the Contact and Opportunity objects can be related through a Lookup
Relationship. This relationship allows you to associate multiple Contacts with a single
Opportunity, helping you track the individuals involved in a potential sales deal.

Example:
• Opportunity: A deal to sell 100 software licenses to "Tech Solutions Inc."

• Contacts: "Jane Smith" and "John Doe" are both associated with this Opportunity as
key stakeholders.

What is Data Modelling?

Data modelling in Salesforce involves structuring and organizing data within the platform
using objects, fields, and relationships. It helps ensure that data is stored in a way that is easy
to understand, access, and manage.

Key Components of Data Modeling:

1. Objects: These are like tables in a database. They can be standard (pre-built by
Salesforce) or custom (created by users).

2. Fields: These are like columns in a table, representing the type of data stored in each
object.

3. Records: These are like rows in a table, representing individual data entries.

4. Relationships: These define how objects are related to each other, such as lookup,
master-detail, and junction relationships.

Example:

Imagine you are managing a project tracking system in Salesforce.


• Custom Object: "Project" to store project details.

o Fields: Project Name, Start Date, End Date, Status.

o Records: Each project you are tracking, like "Website Redesign" or "Product
Launch."

• Standard Object: "Account" to store client information.

o Fields: Account Name, Industry, Annual Revenue.

o Records: Each client, like "Tech Solutions Inc."


• Relationship: A lookup relationship between the "Project" and "Account" objects to
associate each project with a specific client.

What is Loop-up Relationship?

What is Master- Detail Relationship?

What is Roll-up Summary?

A roll-up summary field in Salesforce is used to calculate values from related records in a
master-detail relationship. It allows you to display a value in the master record based on the
values of fields in the detail records.

What is Junction Relationship?

A junction object in Salesforce is used to create a many-to-many relationship between two


other objects. This is achieved by creating a custom object that has two master-detail
relationships, each linking to one of the objects you want to connect.

1.Junction object is a custom object.

2. Junction object has two master -detail fields on it.

3. Junction object maintains Many to Many relations.

4. First Master -Detail field created on the junction object is called primary master.

5. Second Master-Detail field created on the Junction object is called secondary master.
6. Look and feel and ownership is inherited from primary master.

7. If you delete any master record, corresponding child records are deleted.

8. If any master record has more than 200 child records in the junction object,
then we cannot delete that master record.

Example:
Imagine you have two objects: "Job Position" and "Candidate". You want to track which
candidates have applied for which job positions.

1. Job Position: Stores details about job openings.

2. Candidate: Stores details about individuals applying for jobs.

To create a many-to-many relationship, you would use a junction object called "Job
Application":

• Job Application: This custom object will have two master-detail relationships:

o One to the Job Position object.

o One to the Candidate object.

What is an App?

An app is a container of all Objects, tabs and other functionalities like logo, buttons, reports,
dashboards.

Types:

Standard Apps: sales, Services, Marketing

Custom Apps: user defined

What is Fields?

It is nothing but a column in the table and fields are used to create a record in salesforce.
Field can be standard as well as custom.

Types:

Picklist, text, checkbox, date time, currency etc


What is Record?

• Records are the rows in object which are uniquely identified by their ids
• We can create records by entering values in fields available in object
• We can create, edit and view and delete in salesforce
What is Page Layout?

How we want to see our page. We can customize page layouts based on our requirements

What is Record Types?

Helps to launch different page layouts and can show different picklist values for different
page layouts
What is Record Id?

A Record ID in Salesforce is a unique identifier assigned to each record within the system. It
ensures that no two records share the same identity, making it crucial for accessing,
manipulating, and referencing records.

What is Validation Rule?

Validation rules in Salesforce ensure that the data entered into records meets specific criteria
before the record can be saved.

Types:

System Validations: These are pre-built rules provided by Salesforce to maintain


fundamental data consistency

Ex:In Users when we are creating users if the username does not contain @ and .com it
shows error

Custom Validations: These are created by administrators to address specific needs of an


organization. They use formulas and expressions to validate data in different fields. For
example, ensuring that the Close Date of an Opportunity is not set in the past

What is List view?

It allows users to filter, sort, and view records based on specific criteria, making it easier to
manage and analyze data.

Ex: Account (Recently viewed, All Accounts)

What is Owner?

In Salesforce, the owner of a record is the user or queue responsible for that record. The
owner has special permissions and responsibilities, such as editing the record, transferring
ownership, and managing related tasks and activities.

What is Sandbox?

Copy of Production data and metadata. if we want any changes in our production, we have to
load all our data into sandbox after that deploy

Types:

Developer: Ideal for coding and testing. It includes a copy of your metadata and can be
refreshed once per day (200mb Storage)

Developer pro: Similar to the Developer Sandbox but with more storage capacity, suitable for
more extensive development and testing. (2Gb)
Fully: Actual copy of data (metadata + actual data). It is used for testing (Performance
testing, load testing). It refreshes once in 29 days

Partial: (Actual data+ sample data) Contains a subset of your production data and metadata,
useful for testing with sample data. It refreshes once for 5 days

Orgs:

In Salesforce, an org (short for organization) is an instance of the Salesforce environment that
contains your data and applications. There are several types of orgs, each serving different
purposes:

1. Production Org:

o Purpose: The live environment where users perform their daily activities.

o Example: The main Salesforce instance used by a company’s sales team to


manage customer relationships.

2. Sandbox Org:

o Purpose: Used for development, testing, and training without affecting the
production environment.

o Types:

▪ Developer Sandbox: For development and testing in an isolated


environment.

▪ Developer Pro Sandbox: Similar to Developer Sandbox but with more


storage.

▪ Partial Copy Sandbox: Contains a subset of production data for testing.

▪ Full Sandbox: A complete replica of the production environment,


including all data and metadata1.

3. Developer Org:

o Purpose: A free, non-expiring environment for developers to build and test


applications.

o Example: Used by developers to create and test new features or integrations1.

4. Partner Developer Org:

o Purpose: Similar to Developer Org but with additional features and storage for
Salesforce partners.

o Example: Used by Salesforce partners to develop and test applications for the
AppExchange1.

5. Pre-Release Org:
o Purpose: Allows users to test new features and functionality before they are
released to production.

What is Org?

In Salesforce, an org (short for organization) is a specific instance of Salesforce that contains
your data, applications, and configurations. Each org is separate and secure, allowing you to
customize it to meet your business needs.

Types of Orgs:

1. Production Org: The live environment where your actual business operations take
place.

2. Sandbox Org: A copy of your production org used for development, testing, and
training without affecting live data.

3. Scratch Org: A temporary, disposable environment used for development and testing,
often created from a predefined configuration

Example:

• Production Org: Your main Salesforce environment where you manage customer data,
sales processes, and business operations.

• Sandbox Org: A testing environment where you can safely develop and test new
features before deploying them to production.
• Scratch Org: A fresh, temporary environment for developers to test new code and
configurations.

Security:
What is Security?

Protect the data at every level

security refers to the set of features and mechanisms designed to protect data, ensure proper
access control, and maintain privacy within the system.

Layer1: Object-level-security

Salesforce first verifies that the user has permissions to see objects of that type. Object-level
access can be managed through two configurations, profiles and permission sets.
1.1 Profiles

In Salesforce, profiles have historically been the way to control access to object-level and
field-level security. However, since permission sets were released, we recommend using them
as the primary way to configure object and field permissions, together with permission set
groups.

1.2 Permission sets and Permission Set Groups

Since Maria is a new employee, an admin needs to assign Maria to the appropriate permission
sets that grant her access to the sales apps and related objects.

Layer 2: Field-Level Security:

This is about controlling access to specific pieces of data within those records. Each object
(like an Account or Contact) has multiple fields (like Name, Phone Number, Email, etc.).
Field-level security allows you to control which fields within a record a user can see or edit.
For example:
• A user may have access to the Account object but can’t see the Revenue field because
it's sensitive.

• Another user might be able to view Revenue but not edit it.

In short:

• Object-level security is about controlling which objects (like Accounts, Opportunities)


users can access.

• Field-level security is about controlling which specific fields (like a phone number or
revenue) users can see or edit within those objects.
Layer 3: Record level security:

Record-Level Security in Salesforce controls who can access specific records within an
object. Even if a user has access to an object (like Accounts or Opportunities) and its fields
(like Name or Revenue), they may still need permission to access individual records within
that object.
Record-level security ensures that users can only view or modify the records that they are
allowed to, based on specific rules.

Organization-Wide Defaults (OWD):


• This is the default level of access for all records in an object across the organization.

• Example: You can set an object’s OWD to "Private," meaning users can only see their
own records by default.

• Other options include:


o Public Read Only: All users can view records but only record owners or
specific users can edit.

o Public Read/Write: All users can view and edit all records in that object.

Role Hierarchy:

• Salesforce allows you to set up a role hierarchy, where users in higher roles can access
records owned by users in lower roles.

• Example: A manager (higher role) can see all the records owned by their team
members (lower roles), but the reverse isn’t true unless explicitly shared.

1. Sharing Rules:

o These are rules you create to share records with users or groups based on
certain criteria.

o Example: You could create a sharing rule that automatically shares all "High-
Value Opportunities" (based on certain conditions) with the sales team,
regardless of the record owner.

2. Manual Sharing:

o Users can manually share individual records with others, provided they have
the necessary permissions.

o Example: A record owner (or someone with the appropriate access) can share
a specific account with another user or group if needed.

3. Team Roles:

o Salesforce also allows you to assign "team" roles to records, especially for
things like Opportunity or Account records.

o This gives users certain access to records as part of a team, even if they don't
own the record.

What is Profile?

A Profile is a collection of settings that define what a user can access and what actions they
can perform in Salesforce.

What is Permission set?

A Permission Set is a collection of permissions that can be assigned to users on top of their
profile.
What is Permission set groups?

A Permission Set Group is a new feature introduced to organize and manage multiple
permission sets more efficiently.

What is Flow?

A Flow is an automation tool that allows you to automate complex business processes
without writing code.

Types of Flows:

1. Screen Flow: Captures user input through a series of screens.


2. Record-Triggered Flow: Executes actions automatically when a record is created,
updated, or deleted.

3. Schedule-Triggered Flow: Runs at specified times and frequencies


4. Auto launched Flow: Screenless flows launched by a button or other automation.

What is Workflow rule?

Workflow rules in Salesforce are automation tools that help streamline business processes by
automatically performing actions based on specific criteria.

What is Process Builder?

It is same as workflow, but it will perform more than one action at a time and perform
complex process.

Ex: Field update and email alert

What is Approval Process?

approving the record within your own organization


Actions: plan, create, submit

Steps: Initial submission, Approval, Rejection, Final approval, Final rejection

What is Queue?

prioritizing the tasks.

Salesforce Queues are like waiting lines for tasks. When a task (like a customer request or a
sales lead) comes in, it goes into a queue. Team members can then pick tasks from the queue
to work on them.
What Are Public Groups in Salesforce?

Public Groups are like teams or clubs in Salesforce. They are collections of users who can be
grouped together to make it easier to share information and manage access.

Example:

Imagine you have a sales team and a support team in your company. You can create a public
group for each team:

1. Sales Team Group: Includes all salespeople.

2. Support Team Group: Includes all support staff.

How They Are Used:


• Sharing Records: If you want to share a report with the sales team, you can share it
with the "Sales Team Group" instead of adding each salesperson individually.

• Approvals: If a document needs approval from the support team, you can send it to
the "Support Team Group" for any member to approve.

Benefits:
• Saves Time: You don't have to manage permissions for each user one by one.

• Organized: Keeps everything neat and organized by grouping users with similar roles.

What is Web- to -case?

Web-to-Case in Salesforce is a feature that allows you to capture customer support requests
directly from your company's website and automatically create cases in Salesforce.

Example:

Imagine you have a website for your product, and you want customers to be able to report
issues directly from the site. You can set up a Web-to-Case form that asks for their name,
email, and a description of the issue. When they submit the form, a case is created in
Salesforce, and your support team can start working on it right away.

What is Email- to -Case?

Email-to-Case in Salesforce is a feature that allows you to automatically create cases from
incoming customer emails. This helps streamline your support process by ensuring that all
customer inquiries are tracked and managed efficiently.

Example:

Imagine you run a tech support team. A customer emails your support address with an issue
about their software not working. Here's how Email-to-Case handles it:
1. Customer Email: The customer sends an email to [email protected]
describing their issue.

2. Automatic Case Creation: Salesforce receives the email and creates a new case with
the details from the email.

3. Case Assignment: The case is automatically assigned to the "Tech Support Queue."

4. Support Response: A support agent picks up the case from the queue, investigates the
issue, and replies to the customer directly from Salesforce.

What is Assignment rule?

In Salesforce, Assignment Rules are used to automatically assign records (such as Leads or
Cases) to specific users or queues based on criteria you define. This helps ensure that the
right person or team handles the record, improving efficiency and workflow automation.

There are two main types of assignment rules:

1. Lead Assignment Rules: These are used to automatically assign incoming Leads to
specific users or queues based on conditions such as Lead source, geographic region,
or other custom criteria.

2. Case Assignment Rules: Similar to Lead Assignment Rules, these are used to
automatically assign Cases to users or queues based on predefined criteria such as
case type, priority, or region.
Example of a Lead Assignment Rule:

• Criteria: If the Lead’s “Industry” is "Technology", assign the Lead to the "Tech
Team" queue.
• Criteria: If the Lead’s “Region” is "West Coast", assign the Lead to the user “John
Doe”.

What is Escalation rule?

In Salesforce, an Escalation Rule is used to automatically escalate cases (or other records) to
higher-level users or teams if they haven’t been resolved within a specific timeframe.

Example:

Imagine a scenario where you have the following escalation rule for customer support:

• Rule: If a High Priority Case is not resolved within 24 hours, escalate it to the
Senior Support Manager.

• If the case is still not resolved after 48 hours, escalate it again to the Customer
Support Director.
What is Report type?

Organize and analyze the data

Summary: Group by column

Tabular: Represents the data in the tabular form


Matrix: Group by rows and columns

Custom: Creating for custom objects only

What is Dashboard?

Pictorial representation of reports

What is SOSL?
Salesforce Object Search Language (SOSL) is a powerful search language used in Salesforce
to perform text-based searches across multiple objects. It allows you to search for specific
terms within fields and retrieve data from different objects in a single query.

FIND 'Tech' IN ALL FIELDS RETURNING Account (Name), Contact (FirstName,


LastName)

Return type of SOSL is List<List<sObject>>

What is SOQL?

SOQL Syntax Salesforce Object Query Language uses SELECT keyword to fetch data from
Objects and fields. In Structures Query language (SQL) the keyword SELECT is used to
fetch data.

Return type of SOQL is sObject

SOQL Syntax : SELECT fields FROM object WHERE condition LIMIT


● Fields: When we mention fields it uses API names of an Object.
● Object: When we mention Object it denotes Custom and Standard Objects.

● Condition: To filter records we use conditions in SOQL.

● Ordering: This is used for Ordering the results. This may be optional in SOQL.

● Limit: It Limits the number of records when fetching

What is Dynamic SOQL?


Dynamic SOQL refers to the ability to construct and execute SOQL (Salesforce Object Query
Language) queries dynamically at runtime using Apex code, rather than writing static,
hardcoded SOQL queries in your code. This is especially useful when you need to build
queries based on variable conditions or user input, allowing you to retrieve data flexibly and
dynamically.

Syntax:

String query = 'SELECT ' + fieldNames + ' FROM ' + objectName + ' WHERE ' + condition
List<SObject> results = Database.query(query);

• Database.query retrieve upto 50000 record per query

What is Parent-to-child?

In Salesforce, parent-to-child relationships are used to link objects together, allowing you to
create complex data models. These relationships can be established between both standard
and custom objects.

Types of Relationships:

1. Lookup Relationship: A loose relationship where the child record has a reference to
the parent record. The parent record is not required for the child record to exist.

2. Master-Detail Relationship: A strong relationship where the child record (detail) is


tightly linked to the parent record (master). The child record cannot exist without the
parent record.
SELECT Name, (SELECT FirstName, LastName FROM Contacts) FROM Account
SELECT Name, (SELECT Name, Status__c FROM Tasks__r) FROM Project__c

To find the relationship name go to child object and then take child relationship name and
append with __r

For one parent we can create only 20 subqueries and for one parent can form with 4 childs

What is Child-to-parent?
In Salesforce, child-to-parent relationships in SOQL allow you to retrieve data from a parent
object through a child object. This is done using dot notation to reference the parent fields.

To find the relationship name go to child object and then take child field name and append
with __r for only custom objects

What is Aggregate Query?


An Aggregate Query in Salesforce SOQL (Salesforce Object Query Language) is used to
perform aggregations on data, such as calculating sums, averages, counts, or finding the
minimum or maximum values of specific fields across multiple records.

Syntax:

SELECT AGGREGATE_FUNCTION (fieldName) FROM Object WHERE condition


GROUP BY fieldName HAVING condition

What is an Apex?

Apex is a strongly typed, object-oriented programming language developed by Salesforce. It


allows developers to execute flow and transaction control statements on the Salesforce
platform. Apex is similar to Java and C# and is used to add business logic to applications,
automate processes, and integrate with external systems.
Features of Apex:
Integrated

Java like syntax and easy to use

Strongly Integrated with Data

Strongly Typed

Multitenant Environment

Upgrades Automatically
Easy Testing
Applications of Apex:

● Create email services for email blast or email setup.

● Perform complex validation over multiple objects at the same time and also custom
validation implementation.

● Create complex business processes that are not supported by existing workflow
functionality or flows.

Apex Development Process Apex follows a development process lifecycle, where we can use
different organizations and tools to develop Apex. Different process for lifecycle can be
stated as:

1. Creating a Developer or Sandbox org

2. Learning Apex
3. Writing Apex using development Environments

4. Writing Tests

5. Deploying Apex to a Sandbox organization

6. Deploying Apex to a Salesforce Production organization


7. Adding Apex Code to a Force.com AppExchange App

What are Collections?

In Apex, collections are used to store multiple items in a single variable.

1. Lists

• Description: Ordered collections of elements that can contain duplicates.

• Use Case: Useful when you need to maintain the order of elements or allow duplicates
List Methods:
• add(element)

• add(index, element)

• get(index)

• remove(index)

• size()

2. Sets

• Description: Unordered collections of unique elements.


• Use Case: Ideal when you need to ensure that no duplicates are present.

Set Methods:

• add(element)

• contains(element)

• remove(element)

• size()

3. Maps
• Description: Collections of key-value pairs, where each key is unique.

• Use Case: Useful for quickly retrieving values based on unique keys.

Map Methods:
• put(key, value)

• get(key)

• remove(key)

• containsKey(key)
• size()

keySet():

• Map<String, String> fruitColors = new Map<String, String>{


'Apple' => 'Red',
'Banana' => 'Yellow'
};
Set<String> keys = fruitColors.keySet();
System.debug(keys); // Output: {Apple, Banana}
values()

• List<String> values = fruitColors.values();


System.debug(values); // Output: (Red, Yellow)

Apex supports the following data types –

● Primitive (Integer, Double, Long, Date, Datetime, String, ID, or Boolean)

● Collections (Lists, Sets and Maps)

● sObject
● Enums

● Classes, Objects and Interfaces

What is SObjects?

In Apex, an sObject is a generic data type that represents any object in Salesforce, whether
it's a standard object (like Account or Contact) or a custom object (like Project__c). The
sObject type is used to handle records dynamically when the specific object type is not
known at compile time.

What is trigger?

Triggers are pieces of code that run automatically when something happens to your data.
They help you automate tasks and enforce rules.

When Do Triggers Run?

Triggers can run:


• Before a record is saved (to check or change data).

• After a record is saved (to do something with the saved data)

Benefits:

• Automation: Saves time by doing tasks automatically.


• Consistency: Ensures data is always handled the same way.

Why we use triggers?

In flows we cannot be able to perform before operations but in triggers we can perform both
before and after operations

What is Trigger Context Variables?

Trigger context variables in Apex provide information about the records and the context in
which the trigger is executed. These variables help you write logic that responds to specific
events and conditions.

Variables that provide information about the records and the context in which the trigger runs.

Trigger.new, Trigger.old, Trigger.newMap, Trigger.oldMap, Trigger.isInsert, Trigger.isUpdate,


Trigger.isDelete, Trigger.isBefore, Trigger.isAfter

Common Trigger Context Variables:

1. Trigger.new: Contains the new versions of the records that are being inserted or
updated.

2. Trigger.old: Contains the old versions of the records that are being updated or deleted.

3. Trigger.newMap: A map of IDs to the new versions of the records.


4. Trigger.oldMap: A map of IDs to the old versions of the records.
5. Trigger.isInsert: Returns true if the trigger was fired due to an insert operation.

6. Trigger.isUpdate: Returns true if the trigger was fired due to an update operation.

7. Trigger.isDelete: Returns true if the trigger was fired due to a delete operation.

8. Trigger.isBefore: Returns true if the trigger was fired before any record was saved.

9. Trigger.isAfter: Returns true if the trigger was fired after all records were saved.
Trigger Events

Specific actions that cause a trigger to execute.

before insert, before update, before delete, after insert, after update, after delete, after
undelete

What is Bulkification?

Bulkification in Apex (Salesforce) refers to the practice of writing code that can handle
multiple records at once, rather than processing one record at a time. This is crucial in
Salesforce because it helps to avoid hitting governor limits, which are restrictions put in place
to ensure efficient use of resources on the multi-tenant platform.

1. SOQL Queries:

o Total number of SOQL queries issued: 100 (synchronous), 200 (asynchronous)

o Total number of records retrieved by SOQL queries: 50,000


2. SOSL Queries:

o Total number of SOSL queries issued: 20

o Total number of records retrieved by a single SOSL query: 2,000

3. DML Statements:

o Total number of DML statements issued: 150

o Total number of records processed as a result of DML statements: 10,000

4. Callouts:
o Total number of callouts (HTTP requests or web service calls) in a transaction:
100
o Maximum cumulative timeout for all callouts in a transaction: 120 seconds
5. Heap Size:

o Total heap size: 6 MB (synchronous), 12 MB (asynchronous)

6. CPU Time:

o Maximum CPU time on the Salesforce servers: 10,000 milliseconds


(synchronous), 60,000 milliseconds (asynchronous)

7. Execution Time:

o Maximum execution time for each Apex transaction: 10 minutes


8. Email:

o Total number of sendEmail methods allowed: 10

9. Push Notifications:

o Maximum number of push notification method calls allowed per Apex


transaction: 10

o Maximum number of push notifications that can be sent in each push


notification method call: 2,000

These limits ensure that no single process consumes excessive resources, maintaining the
performance and stability of the Salesforce platform

What are the best practices for Apex?

• Use Trigger Handler


• Bulkification
• Proper Exception Handling
• Don’t write soql queries inside the for loop
• Use collection
• For governor limits
• For Dml use database methods
• Don’t mix test practices and apex practices
• One trigger for one object
• Avoid hard coding ids
• Use proper naming conventions

What is test classes?

A test class in Apex (Salesforce) is a class that contains test methods to verify the
functionality and correctness of your Apex code. Test classes are essential for ensuring that
your code works as expected and for maintaining the quality and reliability of your
applications.

Minimum 75% percent code coverage of apex is mandatory for production

To remove the bugs from the code

How to Implement Test Classes

Here are the steps to implement a test class in Apex:

@isTest: Test the data within the method


@TestSetup: The record which is given in the method can be used throughout the methods
within the same package. Creating data for every test case in central location

@isTest (SeeAllData=True): It takes data from database directly

@testVisible is used to access the private classes

Test.loaddata- commonly used for loading large datasets

Best Practices:

Use @isTest Annotation

Avoid Using SeeAllData=true

Always use @isTest(SeeAllData=false) to ensure your tests are independent of


the organization’s data

Create Test Data

• Create the necessary test data within your test classes. Avoid relying on existing
data in the organization.

Use System.runAs

• Use System.runAs to test your application in different user contexts, ensuring


that your code respects user permissions and sharing rules

Avoid Hard-Coding IDs

Cover All Scenarios

Use Assert Statements

• Use the System.assert methods to verify that your code behaves as expected

Focus on Code Coverage

Handle Exceptions

Use Test.startTest and Test.stopTest

What is With Sharing?

When a class is defined with the with sharing keyword, it respects the sharing rules of
the current user. This means that the code will only have access to records that the user
has permission to view or modify.
What is Without Sharing?

When a class is defined with the without sharing keyword, it ignores the sharing rules of
the current user. This means that the code can access all records, regardless of the
user’s permissions.

What is concept of order of execution?

The Order of Execution refers to the sequence in which Salesforce performs different
operations and actions when you create, update, or delete a record. This helps to
determine when things like triggers, validation rules, workflows, and other
automation tools run.

1. System Validation Rules: Salesforce performs system validations, such as


checking for required fields and data type constraints.

2. Before Triggers: Executes all before triggers. These triggers run before the record
is saved to the database.

3. Custom Validation Rules: Executes custom validation rules defined by the user.

4. Duplicate Rules: Executes duplicate rules to check for duplicate records.

5. Save Record: The record is saved to the database, but not yet committed.

6. After Triggers: Executes all after triggers. These triggers run after the record is
saved to the database.

7. Assignment Rules: Executes assignment rules, such as lead assignment rules.

8. Auto-Response Rules: Executes auto-response rules, such as sending


automatic email responses.

9. Workflow Rules: Executes workflow rules. If a workflow rule updates a field, the
before and after triggers are re-executed once.

10. Processes: Executes processes created in Process Builder.

11. Escalation Rules: Executes escalation rules, such as case escalation rules.

12. Entitlement Rules: Executes entitlement rules, such as case milestones.

13. Roll-Up Summary Fields: Updates roll-up summary fields in the parent record, if
applicable.

14. Parent Roll-Up Summary Fields: If the parent record is updated due to roll-up
summary fields, the parent record's before and after triggers are executed.

15. Criteria-Based Sharing Rules: Evaluates criteria-based sharing rules.

16. Commit: The transaction is committed to the database.


17. Post-Commit Logic: Executes post-commit logic, such as sending email
notifications.

What are DML Statements?

DML (Data Manipulation Language) statements in Apex (Salesforce) are used to perform
operations on records in the database. These operations include inserting, updating,
deleting, and undeleting records. DML statements are essential for interacting with
Salesforce data programmatically.

Common DML Statements

1. Insert: Adds new records to the database.

2. Update: Modifies existing records in the database.

3. Delete: Removes records from the database.

4. Undelete: Restores records that have been deleted.

5. Upsert: Inserts a new record if it does not exist, or updates the record if it does
exist.

6. Merge: Merges up to three records of the same object type into one record.

Bulk DML Operations

To handle multiple records efficiently and avoid hitting governor limits, you can perform
bulk DML operations using collections (lists, sets, or maps).

Example:

List<Account> accounts = new List<Account>();


accounts.add(new Account(Name = 'Account 1'));
accounts.add(new Account(Name = 'Account 2'));
accounts.add(new Account(Name = 'Account 3'));
insert accounts;

Error Handling

When performing DML operations, it's important to handle potential errors using try-
catch blocks. This ensures that your code can gracefully handle exceptions and provide
meaningful error messages.

Example:

try {
Account acc = new Account(Name = 'Error Handling Account');
insert acc;
} catch (DmlException e) {
System.debug('Error: ' + e.getMessage());
}

By understanding and using DML statements effectively, you can interact with
Salesforce data programmatically and build robust applications. If you have any
specific questions or need further examples, feel free to ask!

Account masterAcc = [SELECT Id FROM Account WHERE Name = 'Master Account'


LIMIT 1];
Account acc1 = [SELECT Id FROM Account WHERE Name = 'Duplicate Account 1' LIMIT
1];
Account acc2 = [SELECT Id FROM Account WHERE Name = 'Duplicate Account 2' LIMIT
1];
merge masterAcc acc1 acc2;

Account acc = new Account(Name = 'Upsert Account');


upsert acc;

Account acc = [SELECT Id FROM Account WHERE IsDeleted = TRUE LIMIT 1 ALL ROWS];
undelete acc;

Account acc = [SELECT Id FROM Account WHERE Name = 'Updated Account' LIMIT 1];
delete acc;

Account acc = [SELECT Id, Name FROM Account WHERE Name = 'New Account' LIMIT
1];
acc.Name = 'Updated Account';
update acc;

Account acc = new Account (Name = 'New Account');


insert acc;

database methods:

partial and also support all-or-nothing

in dml statements: all or nothing

The Database.SaveResult class in Apex provides methods to access the results of DML
operations performed using the Database class. These methods help you determine
whether the operation was successful and retrieve any error messages if it failed.

Key Methods of Database.SaveResult


1. isSuccess(): Returns a Boolean value indicating whether the DML operation was
successful.

2. getId(): Returns the ID of the record that was processed by the DML operation.
This is useful for insert and upsert operations.

3. getErrors(): Returns an array of Database.Error objects that contain detailed


information about any errors that occurred during the DML operation.

Database.Error[] errors = saveResult.getErrors();

Id recordId = saveResult.getId();

Boolean success = saveResult.isSuccess();

The Database.Error class in Apex provides methods to access detailed information


about errors that occur during DML operations. These methods help you understand the
nature of the error and take appropriate action.

Key Methods of Database.Error

1. getStatusCode(): Returns the status code associated with the error. This code
indicates the type of error that occurred.

2. getMessage(): Returns the error message. This message provides a description of


the error.

3. getFields(): Returns an array of field names that are related to the error. This is
useful for identifying which fields caused the error.

String[] errorFields = error.getFields();

String errorMessage = error.getMessage();

StatusCode statusCode = error.getStatusCode();

Asynchronous Apex:

Asynchronous Apex in Salesforce allows you to run processes in the background


without blocking the main execution thread. This is useful for long-running operations,
callouts to external services, and handling large data volumes. Here are three key types
of asynchronous Apex: Future Methods, Batch Apex, and Queueable Apex.

Future Methods

Future Methods are used to run processes in a separate thread, at a later time when
system resources become available. They are useful for:
• Making callouts to external web services.

• Performing operations that need to run asynchronously to avoid delaying the


main transaction.

• Segregating DML operations to avoid mixed DML errors.

Example:

public class FutureExample {


@future
public static void updateAccounts(List<Id> accountIds) {
List<Account> accounts = [SELECT Id, Name FROM Account WHERE Id IN
:accountIds];
for (Account acc : accounts) {
acc.Name = 'Updated ' + acc.Name;
}
update accounts;
}
}

Batch Apex

Batch Apex is used to process large volumes of records by breaking them into
manageable chunks. It is ideal for long-running jobs that need to be performed in
batches, such as data cleansing or archiving.

Key Methods:

1. start: Collects the records or objects to be passed to the execute method.

2. execute: Processes each batch of records.

3. finish: Executes post-processing operations after all batches are processed.

Example:

public class BatchExample implements Database.Batchable<sObject> {


public Database.QueryLocator start(Database.BatchableContext bc) {
return Database.getQueryLocator('SELECT Id, Name FROM Account');
}

public void execute(Database.BatchableContext bc, List<Account> scope) {


for (Account acc : scope) {
acc.Name = 'Updated ' + acc.Name;
}
update scope;
}

public void finish(Database.BatchableContext bc) {


System.debug('Batch job completed.');
}
}

Queueable Apex

Queueable Apex is similar to future methods but provides additional features like job
chaining and the ability to pass complex types. It allows you to add jobs to the queue
and monitor them.

Benefits:

• Allows passing of non-primitive types.

• Supports job chaining.

• Provides an ID for monitoring the job.

Example:

public class QueueableExample implements Queueable {


public void execute(QueueableContext context) {
Account acc = new Account(Name = 'Queueable Account');
insert acc;
}
}

// Enqueue the job


ID jobId = System.enqueueJob(new QueueableExample());

When to Use Each

• Future Methods: For simple asynchronous operations, especially callouts.

• Batch Apex: For processing large volumes of data in manageable chunks.

• Queueable Apex: For more complex asynchronous operations that require job
chaining or passing complex data types.

By choosing the appropriate asynchronous Apex feature, you can optimize your
Salesforce applications for better performance and scalability

Scheduled Apex in Salesforce allows you to run Apex classes at specific times, which is
useful for periodic tasks like daily or weekly maintenance. To use Scheduled Apex, you
need to implement the Schedulable interface and then schedule the class using the
System.schedule method.

Implementing the Schedulable Interface

To schedule an Apex class, you need to implement the Schedulable interface, which
requires you to define the execute method.

Example:

global class ScheduledJobExample implements Schedulable {


global void execute(SchedulableContext sc) {
// Your logic here
System.debug('Scheduled job executed.');
}
}

Scheduling the Class

You can schedule the class to run at a specific time using the System.schedule method.
This method takes three parameters: the job name, a CRON expression to specify the
schedule, and an instance of the class that implements the Schedulable interface.

Example:

// Schedule the job to run at 8:00 AM every day


String cronExp = '0 0 8 * * ?';
ScheduledJobExample job = new ScheduledJobExample();
String jobId = System.schedule('Daily Job', cronExp, job);

CRON Expression

The CRON expression specifies the schedule for the job. It consists of six fields:
seconds, minutes, hours, day of month, month, and day of week.

Example of CRON Expression:

• 0 0 8 * * ? - Runs at 8:00 AM every day.

• 0 0 12 * * ? - Runs at 12:00 PM every day.

• 0 0 0 1 * ? - Runs at midnight on the first day of every month.

Monitoring Scheduled Jobs

You can monitor and manage scheduled jobs from the Salesforce UI:

1. Go to Setup.

2. Enter Scheduled Jobs in the Quick Find box.


3. Select Scheduled Jobs to view, pause, or delete scheduled jobs.

Best Practices

• Avoid Scheduling from Triggers: Be cautious when scheduling jobs from triggers
to avoid exceeding the limit of 100 scheduled jobs.

• Use Separate Classes: Keep the logic in the execute method minimal and
delegate the actual processing to separate classes.

• Handle Exceptions: Implement proper exception handling within the execute


method to ensure that errors are logged and managed appropriately.

Scheduled Apex is a powerful feature for automating periodic tasks in Salesforce. By


following these best practices, you can ensure that your scheduled jobs run efficiently
and reliably

Aspect Synchronous Apex Asynchronous Apex

Execution Delayed execution (runs in the


Immediate execution
Timing background)

Use Real-time tasks requiring


Long running or background tasks
Cases immediate feedback

Governor
Stricter limits More relaxed limits
Limits

Common
Triggers, validation rules, Future methods, Batch Apex,
Use
immediate user interactions Queueable Apex, Scheduled Apex
Cases

apex public class FutureExample {


apex public void
@future public static void
updateAccountName(Id
updateAccounts(List<Id> accountIds) {
accountId, String newName) {
List<Account> accounts = [SELECT Id,
Example Account acc = [SELECT Id, Name
Name FROM Account WHERE Id IN
FROM Account WHERE Id =
:accountIds]; for (Account acc :
:accountId]; acc.Name =
accounts) { acc.Name = 'Updated ' +
newName; update acc; }
acc.Name; } update accounts; } }

You might also like