Salesforce Questions
Salesforce Questions
Ans. Salesforce offers several cloud solutions, each designed to serve different
business needs. Here's a breakdown of the main Salesforce cloud types:
1. Sales Cloud
• Purpose: Helps manage sales processes, leads, opportunities, accounts, and
contacts.
• Key Features: Lead management, opportunity tracking, sales forecasting,
workflows, reports, dashboards.
2. Service Cloud
• Purpose: Manages customer service and support.
• Key Features: Case management, knowledge base, live chat, call center
integration, AI-powered service (Einstein), field service.
3. Marketing Cloud
• Purpose: Enables businesses to manage marketing campaigns and customer
journeys.
• Key Features: Email marketing, social media, advertising, marketing
automation, audience segmentation, personalization, journey builder.
4. Commerce Cloud
• Purpose: Supports both B2C and B2B e-commerce.
• Key Features: Personalized shopping experiences, mobile commerce, AI-
powered recommendations, order management.
5. Experience Cloud (formerly Community Cloud)
• Purpose: Builds branded portals, forums, and customer/member/partner
communities.
• Key Features: Custom portals, knowledge sharing, collaboration, integration
with CRM data.
6. Analytics Cloud (now part of Tableau CRM)
• Purpose: Provides advanced data analytics and business intelligence.
• Key Features: Data visualization, AI-driven insights, custom dashboards,
forecasting.
7. Integration Cloud
• Purpose: Connects Salesforce with other systems using APIs and integration
tools.
• Key Features: MuleSoft Anypoint Platform, API management, data integration
across systems.
8. Health Cloud
• Purpose: Tailored for healthcare organizations.
• Key Features: Patient profiles, care plans, coordination tools, HIPAA
compliance.
9. Financial Services Cloud
• Purpose: For banking, insurance, and wealth management.
• Key Features: Client profiles, relationship management, financial planning,
compliance tracking.
2. Permission Set
"A Permission Set is used to give a user extra access without changing their
profile.
It’s like a ‘bonus permission’ you can add on top of their profile."
Example:
If someone needs temporary access to Campaigns, I can assign them a
Marketing permission set instead of changing their whole profile.
3. Public Group
"A Public Group is a collection of users, roles, or other groups that we use to
share records or give access to folders.
It makes sharing easier by grouping people together."
Example:
I can share certain reports or records with the ‘Finance Team’ group instead of
picking users one by one.
4. Queue
"A Queue is like a waiting area for records that need to be worked on.
Records in a queue aren’t owned by any one person — anyone in the queue can
take them."
Example:
New leads can go into a Sales queue, and reps can pick the ones they want to
follow up on.
Closing Summary:
"In short:
Profiles define what users can do,
Permission Sets add extra permissions,
Public Groups help with sharing, and
Queues hold records until someone takes them.
9. Can you explain Flow Builder, types of flows, how they are called, and the major
elements used in flows?
Ans. Flow Builder is a no-code automation tool in Salesforce. I use Record-
Triggered Flows for automation, Screen Flows for guided user input, and Auto-
Launched Flows for logic reuse. With elements like Assignment, Get Records,
Decision, and Create/Update Records, I can build complex processes easily
and maintain them without Apex.
Yes, Flow Builder is a tool in Salesforce that lets me automate business
processes without writing code. It’s very flexible — I’ve used it in several real-
world scenarios to improve user experience and reduce manual work.
For example, I recently built a Record-Triggered Flow that runs when a new
Case is created. If the Case is marked as ‘High Priority’ and the customer is a
Platinum account, the flow:
• Automatically assigns the case to a VIP Support Queue,
• Sends an email notification to the manager,
• And updates a custom field on the Account to track the number of urgent cases.
This eliminated the need for support agents to manually escalate cases and
ensured that high-value customers were prioritized immediately.
I’ve also used Screen Flows to guide users through processes like creating a
Lead, qualifying it, and then converting it to an Opportunity — all from a single
screen. It helps reduce clicks and ensure data consistency.
In another project, I used an Auto-Launched Flow called from a Process Builder
to update child records when the parent record was updated. This saved us from
writing Apex triggers.
Triggered when a
Platform Event- Responds to Platform platform event is
Triggered Flow Events being published received
10. Write batch apex and quable apex for that batch class.
Ans. 1. Batch Apex
"Batch Apex is used when I need to process a large number of records (over
50,000) in Salesforce asynchronously. It breaks the data into small chunks,
called 'batches', and processes them one at a time.
I’ve used Batch Apex for tasks like:
• Updating millions of old records,
• Data clean-up jobs (like filling missing fields),
• Scheduled jobs that run weekly or nightly.
Because it works in chunks, it's efficient and avoids hitting governor limits."
Example: I used a Batch Apex class to update Status__c on all Accounts older
than 1 year — around 300,000 records — without hitting limits.
2. Queueable Apex
"Queueable Apex is used when I need to run smaller jobs asynchronously that
don’t exceed governor limits. It’s faster and easier than batch, and I often use it
for:
• Chaining jobs (one after another),
• Handling logic after DML operations,
• Sending bulk emails or making callouts.
It’s great when I need more control than Future methods and the volume is
manageable — typically under 50,000 records."
Example: I used Queueable Apex to send welcome emails to new users after
signup and also log activity in a custom object — all handled asynchronously.
Let's say we’re updating a custom field Status__c on Account records to 'Active' if
their Industry is 'Technology'.
AccountStatusBatch :-
public class AccountStatusBatch implements Database.Batchable<SObject> {
AccountStatusQueueable:-
public class AccountStatusQueueable implements Queueable {
public void execute(QueueableContext context) {
List<Account> accList = [SELECT Id, Industry, Status__c FROM Account
WHERE Industry = 'Technology'];
for (Account acc : accList) { acc.Status__c = 'Active'; }
if (!accList.isEmpty()) {
update accList; }
}
}
handleFlowStart() {
const flow = this.template.querySelector('lightning-flow');
flow.startFlow(this.flowName, this.flowParams);
}
}
In this example:
• The lightning-flow component is used to embed the Flow in the LWC.
• The Flow is triggered via the startFlow() method, passing in any input parameters
required.
13. Can you explain Lightning Message Service (LMS) and its
usage?
Ans. Lightning Message Service (LMS) is a powerful tool in Salesforce that
allows components (both Aura and Lightning Web Components) to
communicate with each other on the same page without having to be in direct
parent-child relationships. This is especially useful when components are
loosely coupled or not in the same hierarchy but still need to share data.
Lightning Message Service (LMS) enables asynchronous, cross-component
communication without the need for a parent-child relationship. I use LMS
when components need to interact but are loosely coupled. It’s ideal for
sending notifications or data between components, even across pages or
browser tabs. It’s simple to implement with message channels, and I don’t need
Apex to make it work, which makes it very flexible and efficient for modern
Salesforce apps.
How It Works:
1. Message Channel:
o A message channel is created as a part of the LMS setup. It defines the
structure of the messages that will be sent and received.
o You define the message structure in an XML file that both the sending
and receiving components will use.
2. Publishers and Subscribers:
o Publisher: A component that sends messages. For example, a
component that triggers some action or event (e.g., a button click).
o Subscriber: A component that listens for the messages and takes action
accordingly.
Example of Usage:
1. Create a Message Channel:
In your project, you need to create a messageChannel folder with a .xml file that
defines the structure of the message.
xml
<messageChannel xmlns="http://soap.sforce.com/2006/04/metadata">
<channelName>myMessageChannel</channelName>
</messageChannel>
Constructor:
• This is the first thing that happens. It's like when a component is born, but it's
still not on the page yet.
• At this point, you can set up initial variables or do anything that's needed when
the component is first created.
Js :-
constructor() {
console.log('Constructor runs first');
}
connectedCallback():
• After the component is added to the page, this is where it comes to life.
• It’s a good place to do things like fetch data from an API or set up subscriptions
(for things like events or messages).
Js:-
connectedCallback() {
console.log('Component added to DOM');
}
renderedCallback():
• This runs every time the component renders, so it’s triggered when the
component is added, and also whenever any data changes and causes the
component to update.
• This is where you can manipulate the DOM or trigger actions after the
component has finished rendering.
Js:-
renderedCallback() {
console.log('Component rendered or re-rendered');
}
disconnectedCallback():
• This is called when the component is removed from the page (like if it’s
removed from the DOM or the page is refreshed).
• Good place to clean up things like event listeners or cancel any ongoing API
calls.
Js:-
disconnectedCallback() {
console.log('Component removed from DOM');
}
In this example:
• When the component is added, a setTimeout() is set to run in 3 seconds.
• If the component is removed before those 3 seconds, disconnectedCallback()
gets triggered, and we use clearTimeout() to cancel the timer to avoid it running
after the component is gone.
16. Can you explain the @api, @wire, and @track decorators in
LWC?
Ans. @api (Public Property/Method)
• What it does: This decorator is used to mark a property or method as public,
meaning it can be accessed or modified by parent components. It makes the
property or method exposed to the outside world.
• Where it’s used: When you want a parent component to be able to interact with
a child component’s data or call a method.
Js:-
export default class ChildComponent extends LightningElement {
@api publicProperty = 'Hello from Child!'; // Can be accessed by parent
components
}
@api
changeMessage(newMessage) {
this.publicProperty = newMessage; // Method to change the value of
publicProperty
}
}
Explanation: In this example, the publicProperty is exposed to the parent
component because it is decorated with @api. Similarly, the changeMessage()
method is also exposed to allow the parent to modify the publicProperty.
handleChangeMessage() {
// Accessing the public method of the child component to change its
property
this.childComponent.changeMessage('New Message from Parent');
}
}
Html:-
<!-- parentComponent.html -->
<template>
<c-child-component onmessagechange={handleChangeMessage}
ref="childComponent"></c-child-component>
</template>
Explanation: In the parent component, you can access and call the exposed
method or property of the child using a ref. In this case, the
handleChangeMessage() method triggers the child’s changeMessage() method
to modify the publicProperty in the child.
Summary:
• Exposing properties from Child to Parent: Use the @api decorator in the child
component to make properties and methods accessible to the parent
component.
• Passing properties from Parent to Child: Simply pass properties from the
parent to the child as attributes in the child’s tag, and use the @api decorator in
the child to make them reactive.
1. Event Bubbling:
• Think of bubbling like a chain reaction—when you fire an event from a child
component, it can bubble up to the parent, and then maybe to the grandparent,
and so on.
• In LWC, events don’t bubble by default. You need to explicitly enable it by
setting bubbles: true when dispatching the event.
Js:-
this.dispatchEvent(new CustomEvent('mycustomevent', {
bubbles: true
}));
Why it's useful:
I use bubbling when I want a parent component to catch an event fired by its
child—like when the child button is clicked, and the parent should respond.
2. Composed:
• composed: true allows the event to pass through the shadow DOM boundary.
• Without it, the event stays stuck inside the component, even if it bubbles. So if
you're firing an event from a child component inside a shadow DOM and want
the parent (outside the shadow) to catch it, you need composed: true.
Js:-
this.dispatchEvent(new CustomEvent('mycustomevent', {
bubbles: true,
composed: true
}));
Why it's useful:
If I have a deeply nested child and I want a top-level component to handle the
event, composed makes sure the event escapes the component’s shadow DOM
and reaches the top.
3. Shadow DOM:
• The shadow DOM is basically a way to encapsulate a component’s HTML and
CSS so that it doesn’t interfere with the rest of the page.
• Every LWC component has its own shadow DOM by default, which keeps its
style and structure private.
Why it's important:
It helps avoid conflicts—like one component’s styles accidentally changing
another’s. But it also means that normal DOM queries and events don’t cross
shadow boundaries unless you explicitly allow them using composed.
Public Read Only Users can see all records, but only edit their own.
21. What is the difference between View All Records and View
All Data in Salesforce?
Ans. View All Records gives access to all records of a specific object, bypassing
sharing rules for that object only. View All Data gives access to all data in the
org, so it’s much broader and usually for admins.
1. View All Records – Object-Level Permission
• This permission lets a user see all records of a specific object, regardless of
ownership or sharing rules.
• It ignores OWD and sharing rules, but only for that object.
Example:
If I give a user View All on the Account object, they can see all Account records,
even if the OWD for Account is set to Private.
• Set via: Profile → Object Settings → Object Permissions
18. Depth Limit Reached You hit the 16-level recursion limit,
(Trigger Recursion) usually due to triggers calling each other.