What Is Cloud
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
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.
A sales process is a series of repeatable steps your sales team can follow – from initial
research to closing deals and upselling.
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?
Types:
1. Essentials:
2. Professional:
3. Enterprise:
4. Unlimited:
· Features: Full functionality, customizability, 24/7 support, premium features like generative
AI
5. Unlimited Plus:
· Ideal for: All business sizes needing robust solutions
Key Considerations:
What is License?
License in the salesforce will specify what set of basic features are offered by the
salesforce to the users.
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.
The Salesforce Platform is a cloud-based platform that helps businesses build, manage, and
customize applications to manage customer relationships and business processes.
• 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?
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?
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?
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?
• 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:
o Type: 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
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.
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.
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:
o Records: Each project you are tracking, like "Website Redesign" or "Product
Launch."
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.
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.
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:
What is an App?
An app is a container of all Objects, tabs and other functionalities like logo, buttons, reports,
dashboards.
Types:
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:
• 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
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.
Validation rules in Salesforce ensure that the data entered into records meets specific criteria
before the record can be saved.
Types:
Ex:In Users when we are creating users if the username does not contain @ and .com it
shows error
It allows users to filter, sort, and view records based on specific criteria, making it easier to
manage and analyze data.
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.
2. Sandbox Org:
o Purpose: Used for development, testing, and training without affecting the
production environment.
o Types:
3. 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?
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.
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.
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:
• 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.
• Example: You can set an object’s OWD to "Private," meaning users can only see their
own records by default.
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.
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:
Workflow rules in Salesforce are automation tools that help streamline business processes by
automatically performing actions based on specific criteria.
It is same as workflow, but it will perform more than one action at a time and perform
complex process.
What is Queue?
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:
• 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.
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.
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.
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.
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”.
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?
What is Dashboard?
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.
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.
● Ordering: This is used for Ordering the results. This may be optional in SOQL.
Syntax:
String query = 'SELECT ' + fieldNames + ' FROM ' + objectName + ' WHERE ' + condition
List<SObject> results = Database.query(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.
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
Syntax:
What is an Apex?
Strongly Typed
Multitenant Environment
Upgrades Automatically
Easy Testing
Applications of Apex:
● 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:
2. Learning Apex
3. Writing Apex using development Environments
4. Writing Tests
1. Lists
• 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
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():
● sObject
● Enums
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.
Benefits:
In flows we cannot be able to perform before operations but in triggers we can perform both
before and after operations
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.
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.
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
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:
3. DML Statements:
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:
6. CPU Time:
7. Execution Time:
9. Push Notifications:
These limits ensure that no single process consumes excessive resources, maintaining the
performance and stability of the Salesforce platform
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.
Best Practices:
• Create the necessary test data within your test classes. Avoid relying on existing
data in the organization.
Use System.runAs
• Use the System.assert methods to verify that your code behaves as expected
Handle Exceptions
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.
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.
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.
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.
9. Workflow Rules: Executes workflow rules. If a workflow rule updates a field, the
before and after triggers are re-executed once.
11. Escalation Rules: Executes escalation rules, such as case escalation rules.
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.
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.
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.
To handle multiple records efficiently and avoid hitting governor limits, you can perform
bulk DML operations using collections (lists, sets, or maps).
Example:
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 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;
database methods:
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.
2. getId(): Returns the ID of the record that was processed by the DML operation.
This is useful for insert and upsert operations.
Id recordId = saveResult.getId();
1. getStatusCode(): Returns the status code associated with the error. This code
indicates the type of error that occurred.
3. getFields(): Returns an array of field names that are related to the error. This is
useful for identifying which fields caused the error.
Asynchronous 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.
Example:
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:
Example:
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:
Example:
• 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.
To schedule an Apex class, you need to implement the Schedulable interface, which
requires you to define the execute method.
Example:
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:
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.
You can monitor and manage scheduled jobs from the Salesforce UI:
1. Go to Setup.
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.
Governor
Stricter limits More relaxed limits
Limits
Common
Triggers, validation rules, Future methods, Batch Apex,
Use
immediate user interactions Queueable Apex, Scheduled Apex
Cases