0% found this document useful (0 votes)
3 views32 pages

Questions

The document outlines the implementation of Omni-Channel in Salesforce, detailing steps such as enabling the feature, defining routing configurations, and setting up queues to optimize agent workload and improve customer service. It also compares Lightning Web Components (LWC) and Lightning Web Runtime (LWR), discusses various Salesforce sandbox types, and explains routing types and their benefits. Additionally, it covers governor limits, debugging strategies, case management, and the importance of entitlements and escalation rules in Service Cloud.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views32 pages

Questions

The document outlines the implementation of Omni-Channel in Salesforce, detailing steps such as enabling the feature, defining routing configurations, and setting up queues to optimize agent workload and improve customer service. It also compares Lightning Web Components (LWC) and Lightning Web Runtime (LWR), discusses various Salesforce sandbox types, and explains routing types and their benefits. Additionally, it covers governor limits, debugging strategies, case management, and the importance of entitlements and escalation rules in Service Cloud.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1.

how did u implement omnichannel in your project


When I implemented Omni-Channel in a Salesforce project, the goal was to intelligently
route work items (Cases, Leads, Chats, etc.) to the right agents based on availability, skills,
and workload. Here’s how we approached it step by step:
🔹 Implementation Steps
1. Enable Omni-Channel
o Activated Omni-Channel in Service Setup.
o Configured Service Channels (e.g., Cases, Live Chat, Leads).
2. Define Routing Configurations
o Created Routing Configurations to decide how work is prioritized:
 Priority: High-value cases routed first.
 Routing Model: Most Available Agent vs. Least Active Agent.
 Capacity: Defined how many items an agent can handle at once.
3. Set Up Queues
o Created Queues for different work types (VIP Cases, Standard Cases,
Leads).
o Associated Routing Configurations with these Queues.
4. Presence Configurations
o Defined Presence Statuses (Available for Cases, Available for Chat, Offline).
o Assigned them to agents so they could control when they receive work.
5. Assign Agents
o Added users to Queues and Presence Configurations.
o Ensured agents had Omni-Channel permissions via Profiles/Permission Sets.
6. Test Routing
o Created test Cases and Leads.
o Verified that high-priority cases were routed to available agents instantly.
o Checked that workload balancing worked correctly (no agent overloaded).
7. Monitor & Optimize
o Used Omni Supervisor to monitor agent activity in real time.
o Adjusted capacity and routing rules based on performance metrics.
🔹 Example Scenario
 A VIP Case enters the system.
 Omni-Channel checks routing configuration → sees it’s high priority.
 Routes it to the least busy agent with “Available for Cases” status.
 Agent gets a pop-up in the console with the case details.
✅ Benefits Achieved
 Faster response times for high-priority customers.
 Balanced workload across agents.
 Real-time visibility for supervisors.
 Improved customer satisfaction due to intelligent routing.
Would you like me to also sketch a visual flow diagram showing how a Case moves from
creation → Queue → Routing → Agent console in Omni-Channel?

2. Difference between lwc and lwr


LWC vs LWR
⚖️Difference
Aspect LWC LWR
Full Form Lightning Web Components Lightning Web Runtime
Type UI component model Framework/runtime
Usage Build components Build high-performance sites
Where used Lightning pages Experience Cloud sites
Performance Good Very high (SSR supported)

3. Sand boxes...
 Developer → small changes
 Developer Pro → more storage
 Partial Copy → sample data
 Full Copy → complete production clone

4. Opportunity to transfer
 Change ownership:
 Manual transfer
 Mass transfer
 Assignment rules
 Apex/Flow automation

5. Can we call future from batch


❌ No (not recommended)
👉 Use:
 Queueable
 Batch chaining
6. What is Omni Channel?
Omni-Channel in Salesforce is a Service Cloud feature that enables seamless customer
service across multiple channels like chat, email, phone, and social media. It automatically
routes work items—such as cases, leads, or chats—to the most qualified agents in real time
based on skills, availability, and priority
Key Features
Presence Configuration: Agents set their status and capacity to receive work only when
available.
Routing Models: Supports queue-based, skills-based, or external routing to match
work with the right rep.
Supervisor Tools: Managers monitor wait times, open cases, agent capacity, and
performance metrics.
How It Works
Work items enter queues, where Omni-Channel evaluates priority, size, and agent capacity
before pushing them automatically. For example, high-priority cases go to skilled agents first,
reducing response times and improving customer satisfaction.

7. What is Routing?
Routing in Omnichannel is the process of automatically directing customer requests
(like emails, chats, calls, or tickets) to the right agent or team based on rules such as
availability, workload, or skills. It ensures faster response times, balanced workloads, and
better customer experiences. There are several routing types, each designed to optimize
how work is distributed.
8. What are the Routing types and explain them clearly?
Routing Type How It Works Best Use Case
Least Active Assigns work to the agent with the fewest Ensures balanced workload
Routing active tasks. among agents.
Most Available Routes to the agent with the most free Useful when agents have
Routing capacity (based on workload limits). varying task capacities.
Considers each agent’s maximum
Capacity-Based Prevents overloading agents
workload capacity (e.g., handling 3 chats
Routing and improves efficiency.
at once).
Matches tickets to agents with specific
Skills-Based Improves first-contact resolution
expertise (e.g., technical support vs.
Routing and customer satisfaction.
billing).
Routing Type How It Works Best Use Case
Urgent or high-value cases are routed Ideal for VIP customers or
Priority Routing
first, regardless of queue order. critical issues.
Queue-Based Requests enter a queue and are assigned Traditional method for
Routing in order, often with rules for escalation. structured call centers.

Key Benefits of Routing


 Efficiency: Agents spend less time picking tickets manually.
 Fairness: Workload is evenly distributed.
 Customer Satisfaction: Customers are connected to the right agent faster.
 Flexibility: Supports multiple channels (chat, email, phone, social).

9. Governor Limit Issues in Salesforce


 Governor Limits are Salesforce’s way of ensuring efficient use of shared resources
in a multi-tenant environment. They restrict things like SOQL queries, DML
statements, heap size, CPU time, etc.
 Common Issues Faced:
o Too many SOQL queries inside loops.
o Exceeding heap size due to large data sets. Heap size errors are about
memory overload. The fix is to query less(filter and Index), process in
chunks(Batch 200), clear collections[ [Link]()], and use async Apex.
o Too many DML operations in a single transaction.

 Resolution Strategies:
o Bulkify Code: Avoid queries/DML inside loops; instead, use collections
(Lists, Sets, Maps).
o Use Batch Apex / Queueable Apex: Break large jobs into smaller chunks.
o Optimize Queries: Use selective filters, avoid unnecessary fields, leverage
indexed fields.
o Caching / Custom Settings: Reduce repeated queries.
 Example: If you had a trigger querying inside a loop, you’d move the query outside
and store results in a Map for reuse.

10. Handling Team Conflicts in Technical Discussions


 Situation: Technical disagreements are common (e.g., choosing between Batch
Apex vs. Future methods).
 Approach:
o Listen Actively: Understand the other person’s reasoning before responding.
o Use Data & Examples: Instead of opinions, show proof (documentation,
benchmarks, Salesforce best practices).
o Neutral Language: Avoid “you’re wrong”; instead say “Let’s evaluate both
approaches.”
o Consensus Building: Suggest a pilot or small test to validate which
approach works better.
 Outcome: Misunderstandings are reduced when you focus on facts and shared
goals rather than personal opinions.

11. Write a triggger which will restrict Email update if the lead is converted already and
show a friendly error message?
trigger RestrictEmailUpdateOnConvertedLead on Lead (before update) {
for (Lead newLead : [Link]) {
Lead oldLead = [Link]([Link]);

// Check if lead is converted


if ([Link] && [Link] != [Link]) {
[Link]('This lead is already converted. Email update is not
allowed.');
}
}
}
12. Write a java script function to find each alphabet occurrences in a string including
space and return through a map?
Ex : a ==> 10
b ==> 5
function countOccurrences(str) {
let map = new Map();
for (let char of str) {
// Convert to lowercase if you want case-insensitive
char = [Link]();
if ([Link](char)) {
[Link](char, [Link](char) + 1);
} else {
[Link](char, 1);
}
}
return map;
}

// Example usage:
let result = countOccurrences("a big brown bag");
for (let [key, value] of result) {
[Link](`${key} ==> ${value}`);
}
13. A new employee joined in your organization and how will you guide him to fill time
sheets.
“Every day, open the timesheet page. Write how many hours you worked and what
you did. At the end of the week, check everything and click submit.”

What is External routing?  Definition: External routing means sending work items (like
cases or chats) to an external system outside Salesforce for assignment.
 Use Case: When a company uses a third-party routing engine or workforce management
tool to decide which agent should handle the request.
What is skill based routing?  Definition: Assigns work to agents based on their skills
(e.g., language, product knowledge, technical expertise).
 Benefit: Customers get connected to the most qualified agent, improving resolution
speed and satisfaction.
14. . Debugging Routing Issues
 Check Presence Configuration (are agents available?).
 Verify Routing Configuration (rules set correctly?).
 Review Omnichannel Supervisor for stuck work items.
 Use Debug Logs to trace assignment logic.
 Test with sample cases to reproduce the issue.
15. Governor Limits in Salesforce
 SOQL Queries: Max 100 per transaction.
 DML Statements: Max 150 per transaction.
 Heap Size: 6 MB synchronous, 12 MB async.
 CPU Time: 10,000 ms per transaction.
 Future Calls: Max 50 per transaction. 👉 These limits enforce efficient coding
practices.
16. Order of Execution in Salesforce
 System validation rules.
 Before triggers.
 Custom validation rules.
 Duplicate rules.
 After triggers.
 Assignment rules.
 Auto-response rules.
 Workflow rules (before save).
 Processes, flows, escalation rules.
 Roll-up summary fields.
 Criteria-based sharing.
 Commit to database.
 Post-commit logic (email, async jobs).
17. PSR (Presence Status Record)
 Defines an agent’s availability status in Omnichannel (e.g., Available, Busy, Offline).
 Used to decide if routing can assign work to them.
18. Presence Configuration
 A setup that defines which statuses agents can use (Available, Away, Do Not
Disturb).
 Controls what kind of work items can be routed when an agent is in a certain status.
19. Routing Configuration
 Defines how work is assigned: priority, routing model (least active, most available,
skills-based), and capacity.
 Ensures requests are distributed according to business rules.
20. Escalation Rules
 Automatically escalate cases if they are not resolved within a set time.
 Example: If a case is open for more than 48 hours, escalate to a manager.
21. Case Lifecycle
 Case Creation – Customer raises an issue.
 Assignment – Routed to the right agent/team.
 Work in Progress – Agent investigates and updates.
 Escalation (if needed) – Sent to higher support.
 Resolution – Issue fixed, solution documented.
 Closure – Case marked closed, customer notified.
 Post-Closure – Feedback or survey sent.
22. Trigger to Fetch Number of Associated Opportunities for Contacts and Accounts
apex
trigger CountOpportunities on Contact (after insert, after update) {
Set<Id> accountIds = new Set<Id>();
for (Contact con : [Link]) {
if ([Link] != null) {
[Link]([Link]);
}
}

Map<Id, Integer> oppCountMap = new Map<Id, Integer>();


for (AggregateResult ar : [
SELECT AccountId, COUNT(Id) cnt
FROM Opportunity
WHERE AccountId IN :accountIds
GROUP BY AccountId
]) {
[Link]((Id)[Link]('AccountId'), (Integer)[Link]('cnt'));
}

for (Contact con : [Link]) {


if ([Link] != null && [Link]([Link])) {
con.Opportunity_Count__c = [Link]([Link]);
}
}
}
👉 This assumes you have a custom field Opportunity_Count__c on Contact. A similar trigger
can be written for Account.
24. Difference Between Omni Supervisor and PS (Presence Status)
 Omni Supervisor: A monitoring tool for managers to see agent availability,
workload, and performance in real time.
 Presence Status (PS): Defines whether an agent is available, busy, or offline for
receiving routed work.
25. Debugging Omni-Channel Errors
 Check Presence Configuration (agent status).
 Verify Routing Configuration (rules, queues).
 Use Debug Logs to trace assignment.
 Review Omni Supervisor for stuck work items.
 Test with sample cases to reproduce.
26. Security System in Salesforce
 Authentication: Username/password, SSO, MFA.
 Authorization: Profiles, Roles, Permission Sets.
 Data Security: Sharing rules, field-level security, object-level security.
 Auditing: Login history, field history tracking.
 Encryption: Shield Platform Encryption.
27 Permission Sets
 Collections of settings and permissions that grant users access to additional features
without changing their profile.
 Example: A user’s profile doesn’t allow “Modify All Data,” but a permission set can
grant it.
28. Complex Issues in Omni-Channel
 Misconfigured routing rules.
 Agents not receiving work due to incorrect presence status.
 Conflicts between multiple routing configurations.
 SLA breaches due to delayed routing.
29. Agent Not Receiving Cases – Possible Reasons
 Agent is Offline or in wrong presence status.
 Routing Configuration not linked to the queue.
 Capacity exceeded (agent already handling max items).
 Skills mismatch (case requires skills agent doesn’t have).
30. Omni-Channel Configuration
 Define Routing Configurations.
 Set up Presence Configurations.
 Create Queues.
 Assign agents to queues.
 Enable Omni-Channel in Service Console.
31. Entitlement
 Defines customer’s right to support (SLA).
 Tracks timelines for response and resolution.
 Works with Milestones to enforce SLA compliance.
32. Case Routing
 Assigns cases to agents/queues based on rules (skills, availability, workload).
 Uses Routing Configurations and Omni-Channel.
33. Case Escalation
 Automatically escalates cases if not resolved within a defined time.
 Example: Escalate to manager after 48 hours.
34. What is Service Cloud?
 Salesforce’s customer support platform for managing cases, knowledge,
omnichannel, and SLAs.
35. Case Management in Salesforce
 End-to-end handling of customer issues: creation, assignment, resolution, escalation,
closure.
36. Lifecycle of a Case
1. Case Creation
2. Assignment
3. Work in Progress
4. Escalation (if needed)
5. Resolution
6. Closure
7. Feedback
37. Case Assignment Rules
 Automatically assign cases to users/queues based on conditions (region, product,
priority).
38. Auto-Response Rules
 Send automatic email responses to customers when cases are created.
39. Escalation Rules
 Escalate cases to higher levels if not resolved within SLA.
40. Web-to-Case
 Converts web form submissions into cases.
41. Email-to-Case
 Converts customer emails into cases.
42. Entitlement
 Defines customer’s support contract and SLA.
43. Milestones in Service Cloud
 Specific checkpoints in entitlement process (e.g., “First Response Due”).
44. Entitlement Process
 Timeline of milestones defining SLA compliance.
45. Handling SLA in Service Cloud
 Use Entitlement Processes + Milestones to track response/resolution times.
 Escalation rules if SLA is breached.
46. Omni-Channel
 Intelligent routing engine in Salesforce to distribute work across agents.
47 Presence Configuration
 Defines agent statuses (Available, Busy, Offline) and what work they can receive.
48. Routing Configuration
 Defines how work is routed (priority, skills, capacity).
49. Skill-Based Routing
 Routes cases to agents with required skills (language, product expertise).
50. Queue-Based Routing
 Routes cases into queues; agents pull or are assigned from queues.
51. PSR (Pending Service Routing)
 Record that represents work waiting to be routed to an agent.
52. Service Console
 Unified workspace for agents to manage cases, chats, and knowledge.
53. Salesforce Knowledge
 Central repository of articles for agents and customers.
54. Merge Field in Email Template
 Dynamic placeholders (e.g., {![Link]}) that auto-populate with record
data.
55. Case Actions You May Create
 Quick Actions like “Close Case,” “Escalate Case,” “Send Email,” “Log Call.”
56. Service Cloud and Utilization
 Used to manage customer support across channels.
 Example: Implemented Email-to-Case, Omni-Channel routing, Knowledge base,
and Entitlements to improve SLA compliance and customer satisfaction.
📊 8. Trigger: Count Opportunities for Account & Contact
trigger CountOpportunities on Contact (after insert, after update) {
// Step 1: Collect all Account Ids from the Contacts being processed
Set<Id> accountIds = new Set<Id>();
for (Contact con : [Link]) {
if ([Link] != null) {
[Link]([Link]);
}
}

// Step 2: Query Opportunity counts grouped by Account


Map<Id, Integer> oppCountMap = new Map<Id, Integer>();
for (AggregateResult ar : [
SELECT AccountId, COUNT(Id) cnt
FROM Opportunity
WHERE AccountId IN :accountIds
GROUP BY AccountId
]) {
[Link]((Id)[Link]('AccountId'), (Integer)[Link]('cnt'));
}

// Step 3: Update each Contact with the Opportunity count of its Account
List<Contact> contactsToUpdate = new List<Contact>();
for (Contact con : [Link]) {
if ([Link] != null && [Link]([Link])) {
Contact updatedCon = new Contact(Id = [Link]);
updatedCon.Opportunity_Count__c = [Link]([Link]);
[Link](updatedCon);
}
}

// Step 4: Perform DML update (since this is an after trigger)


if (![Link]()) {
update contactsToUpdate;
}
} 📞 9. Service Cloud Basics
What is Service Cloud?
Platform for customer support and case management.
Case Lifecycle
New → Assigned → In Progress → Escalated → Closed

Case Features
 Assignment Rules → auto assign
 Auto Response → send email
 Escalation Rules → escalate cases
 Web-to-Case → website cases
 Email-to-Case → email cases

🧠 Entitlement & SLA


 Entitlement → support agreement
 Milestones → SLA checkpoints
 Entitlement Process → defines SLA rules

🤖 Einstein Features
 Case classification
 Chatbots
 Predictions

🔐 Security
 Profiles
 Permission Sets
 Roles

⚙️Deployment Tools
 Change Sets
 VS Code
 Git
 CI/CD
 Copado

⚡ Apex vs Flow
👉 Use Apex when:
 Complex logic
 Integration
 Large data
👉 Use Flow when:
 Simple automation
 No-code solution

🧠 Simple Answer (Time Sheet Guidance)


“I will explain the process step-by-step, show how to log hours daily, select the correct
project, and submit before deadline. I will also guide them using a demo and answer any
doubts.”

 Apex + Scenarios
OAuth 2.0 is the recommended approach.
JWT Bearer Flow is used for server-to-server integrations.
Username Password flow is supported but less secure.

Named Credentials manage tokens automatically, reducing complexity.

Challange :
A developer at SkyNet Global must check if an Account’s Annual Revenue > 1,000,000.

If yes → create a task with subject "VIP Account Review",


Else → create a task with subject "Standard Account Review".

👉 How would you solve this using Apex?

[Link]

[Link]

At Vertex Systems, a requirement states:


If a Case is created with Priority = High, → auto-create a task with subject "Immediate Action
Required".

Otherwise, → auto-create a task with subject "Regular Case Handling".

How would you implement this logic?


trigger CreateTaskOnCasePriority on Case (after insert) {
List<Task> tasksToInsert = new List<Task>();

for (Case c : [Link]) {


Task t = new Task();
[Link] = [Link]; // link task to case
[Link] = [Link]; // assign to case owner
[Link] = 'Not Started';
[Link] = 'Normal';

if ([Link] == 'High') {
[Link] = 'Immediate Action Required';
} else {
[Link] = 'Regular Case Handling';
}

[Link](t);
}

if (![Link]()) {
insert tasksToInsert;
}
}
hen a Case is created:
At Vertex Systems, a requirement states: If a Case is created with Priority = High, → auto-
create a task with subject "Immediate Action Required". Otherwise, → auto-create a task
with subject "Regular Case Handling". How would you implement this logic?
Using Flow (admin-friendly, no code)
 Create a Record-Triggered Flow on Case (triggered on create).
 Add a Decision element:
o If Priority = High → Create Task with subject “Immediate Action Required”.
o Else → Create Task with subject “Regular Case Handling”.
 Assign Task to Case Owner and relate it to the Case.

SOQL interview questions


Querying Deleted Records
 Deleted records remain in the Recycle Bin temporarily.
 To query them, use the ALL ROWS keyword in SOQL.
sql
SELECT Id, Name FROM Account WHERE IsDeleted = true ALL ROWS
 IsDeleted = true filters only deleted records.
 Without ALL ROWS, SOQL only returns active records.
Deleted records stay in the recycle bin temporarily.
Using ALL ROWS allows querying both existing and deleted records.
Querying Deleted Records
 Deleted records remain in the Recycle Bin temporarily.
 To query them, use the ALL ROWS keyword in SOQL.
sql
SELECT Id, Name FROM Account WHERE IsDeleted = true ALL ROWS
 IsDeleted = true filters only deleted records.
 Without ALL ROWS, SOQL only returns active records.
🔹 Parent-to-Child and Child-to-Parent Queries
 Salesforce doesn’t use SQL joins; instead, it uses relationship queries.
Child → Parent (dot notation):
sql
SELECT Id, Name, [Link] FROM Contact
👉 Fetches parent Account’s Name from Contact.
Parent → Child (subquery):
sql
SELECT Id, Name, (SELECT LastName FROM Contacts) FROM Account
👉 Fetches all child Contacts for each Account.
🔹 SOQL & SOSL Interview Questions
 SOQL: Structured query language for Salesforce objects.
o Example: SELECT Id, Name FROM Account WHERE Name LIKE 'A%'
 SOSL: Search across multiple objects and fields.
o Example: FIND 'Acme*' IN ALL FIELDS RETURNING Account(Id, Name),
Contact(Id, Name)
Key differences:
 SOQL → Query one object at a time, with relationships.
 SOSL → Search text across multiple objects simultaneously.
🔹 Managing Salesforce Deployments
 Source-Driven Development: Use Git to version control metadata and code.
 Salesforce DX: CLI-based development for scratch orgs, packaging, and
automation.
 CI/CD Pipelines: Automate testing and deployment (Jenkins, GitHub Actions, Azure
DevOps).
 Change Sets: Native Salesforce tool for small teams, manual, less scalable.
 Copado: DevOps platform purpose-built for Salesforce, integrates Git, CI/CD, and
release management.

How do you manage Salesforce deployments?


Deployments are where teams panic.
I prefer source-driven development using Git and Salesforce DX.
CI/CD helps reduce human error.
Change Sets still work for small teams.
Method How It Works Pros Cons Best For
Manual, error-
Point-and-click tool Easy to use, no
prone, limited to Small teams,
Change inside Salesforce to coding required,
connected orgs, simple
Sets move metadata between native to
no version deployments.
related orgs. Salesforce.
control.
Source-driven
development: metadata Version control,
Requires setup, Medium to large
stored in Git, automated rollback,
DevOps teams, modern
Git + CI/CD pipelines (Jenkins, collaboration,
knowledge, engineering
GitHub Actions, Azure automation,
more complex. practices.
DevOps) handle testing scalable.
& deployment.
Modular, supports Steeper
CLI-based development
Salesforce packaging, learning curve, Teams adopting
with scratch orgs,
DX (with automation- requires DevOps, modular
packaging, and source-
Git/CI/CD) friendly, integrates developer architecture.
driven workflows.
with CI/CD. skillset.
Salesforce-native User-friendly UI, Enterprises
DevOps platform integrates with Licensing cost, needing
Copado integrating Git, CI/CD, Salesforce, strong learning curve structured
release management, governance, audit for setup. DevOps with
and compliance. trails. compliance.

At Vertex Systems, a requirement states:


If a Case is created with Priority = High, → auto-create a task with subject "Immediate Action
Required".

Otherwise, → auto-create a task with subject "Regular Case Handling".

How would you implement this logic?


Option 1: Record-Triggered Flow (Recommended)
1. Create a Record-Triggered Flow on the Case object.
2. Set the trigger to run after record creation.
3. Add a Decision element:
o If Priority = High → Outcome 1.
o Else → Outcome 2.
4. Add a Create Records element:
o For Outcome 1 → Create Task with Subject = Immediate Action Required.
o For Outcome 2 → Create Task with Subject = Regular Case Handling.
5. Set Task fields:
o WhatId = [Link] (relates task to case).
o OwnerId = [Link] (assigns task to case owner).
o Status = Not Started.
👉 This is admin-friendly, easy to maintain, and doesn’t require code.
Option 2: Apex Trigger (Developer Approach)
trigger AutoCreateTaskOnCase on Case (after insert) {
List<Task> tasksToInsert = new List<Task>();

for (Case c : [Link]) {


Task t = new Task();
[Link] = [Link]; // Link task to case
[Link] = [Link]; // Assign to case owner
[Link] = 'Not Started';
[Link] = 'Normal';

if ([Link] == 'High') {
[Link] = 'Immediate Action Required';
} else {
[Link] = 'Regular Case Handling';
}

[Link](t);
}

if (![Link]()) {
insert tasksToInsert;
}
}
Wipro
Message Copilot
Smart
Q1. Check for Opportunity in Salesforce Account
Answer (SOQL):
apex
List<Account> accList = [
SELECT Id, Name, (SELECT Id, Name, StageName FROM Opportunities)
FROM Account
];
👉 Retrieves Accounts and their related Opportunities.
Q2. Fetch Leads in a Salesforce Org
Answer (SOQL):
apex
List<Lead> leadList = [
SELECT Id, FirstName, LastName, Company, Status
FROM Lead
];
👉 Fetches basic Lead details.
Q3. Fetch Stage Fields from Opportunity in Sales
Answer (SOQL):
apex
List<Opportunity> oppList = [
SELECT Id, Name, StageName, CloseDate, Amount
FROM Opportunity
];
👉 Retrieves Opportunity stage and key fields.
Q4. Return Contact Records from a Salesforce Org
Answer (SOQL):
apex
List<Contact> contactList = [
SELECT Id, FirstName, LastName, Email, Phone, [Link]
FROM Contact
];
👉 Returns Contacts with related Account info.
Q5. Retrieve Opportunities with a Specific Stage
Answer (SOQL):
apex
List<Opportunity> closedWonOpps = [
SELECT Id, Name, StageName, Amount
FROM Opportunity
WHERE StageName = 'Closed Won'
];
👉 Filters Opportunities by stage (example: Closed Won).
✅ Summary:
 Use parent-to-child subqueries for Accounts → Opportunities.
 Use dot notation for child-to-parent (Contact → Account).
 Apply WHERE clause for filtering (StageName).
 These queries are bulk-safe and can be wrapped in Apex methods for LWC or Flows.
1. With Sharing vs Without Sharing in Apex
 With Sharing: Enforces the current user’s sharing rules (respect org-wide defaults,
role hierarchy, sharing rules).
 Without Sharing: Ignores sharing rules, runs in system context.
 Best Practice: Use with sharing for business logic that should respect user
permissions; use without sharing for admin/system processes.
⚡ 2. Usage of @wire, @track, @api in LWC
 @wire: Connects LWC to Salesforce data (Apex methods or LDS). Reactive, auto-
refreshes.
 @track: Marks private reactive properties (needed in older LWC versions; now most
objects are reactive by default).
 @api: Exposes public properties/methods to parent components.
🔄 3. Record-Triggered Flow to Update Related Records
 Trigger: On Case creation/update.
 Decision: Check condition (e.g., Priority = High).
 Action: Update related records (e.g., create Task, update Account field). 👉
Declarative alternative to triggers, easier to maintain.
📊 4. SOQL Joins & Semi-Join
 Child-to-Parent: Dot notation (SELECT Id, [Link] FROM Contact).
 Parent-to-Child: Subquery (SELECT Id, (SELECT LastName FROM Contacts)
FROM Account).
 Semi-Join: Filter records based on related object (SELECT Id FROM Account
WHERE Id IN (SELECT AccountId FROM Opportunity WHERE StageName='Closed
Won')). 👉 Semi-joins are powerful for filtering without retrieving full child records.
🧩 5. Ensuring Data Consistency in Triggers
 Always bulkify (handle multiple records).
 Use [Link] and [Link] to compare values.
 Avoid SOQL/DML inside loops.
 Use helper classes for logic separation.
🔐 6. Secure API Authentication in Salesforce
 Use OAuth 2.0 for external integrations.
 Options: JWT Bearer Flow, Web Server Flow, Username-Password Flow.
 Best practice: Store secrets securely, use Named Credentials, enforce TLS.
🕒 7. Before vs After Trigger
 Before Trigger: Modify field values before saving (validation, default values).
 After Trigger: Access record Ids, perform related record inserts/updates. 👉
Example: Before → prevent Email change; After → create Task after Case insert.
📦 8. Bulkification Best Practices
 Use Sets/Maps to collect IDs.
 Query once outside loops.
 Perform DML in bulk.
 Always test with >200 records to ensure scalability.
📑 9. Pagination in LWC for >2,000 Records
 SOQL has a 2,000 record limit in UI.
 Use OFFSET or StandardSetController for pagination.
 In LWC: implement “Next” and “Previous” buttons, fetch records in chunks (e.g., 50
per page).
📏 10. Governor Limits: Synchronous vs Asynchronous Apex
 Synchronous Apex:
o SOQL queries: 100
o DML statements: 150
o Heap size: 6 MB
o CPU time: 10,000 ms
 Asynchronous Apex (Future, Batch, Queueable):
o SOQL queries: 200
o DML statements: 10,000
o Heap size: 12 MB
o CPU time: 60,000 ms 👉 Async Apex is used for long-running, bulk jobs.

---

🛠 Real-Time Scenario – Auto-Renewal Opportunity Creation


Requirement:
Whenever an Opportunity is marked Closed-Won, create a Renewal Opportunity with:
✅ Name → Renewal - [Old Opp Name]
✅ Close Date → First day of next quarter 📅
✅ Account → Same as old Opportunity 🏦

trigger RenewalOpportunityTrigger on Opportunity (after update) {


List<Opportunity> renewalOpps = new List<Opportunity>();

for (Opportunity opp : [Link]) {


Opportunity oldOpp = [Link]([Link]);

// Check if Opportunity just moved to Closed Won


if ([Link] == 'Closed Won' && [Link] != 'Closed Won') {

// Calculate first day of next quarter


Date today = [Link]();
Integer currentMonth = [Link]();
Integer nextQuarterMonth;

if (currentMonth <= 3) {
nextQuarterMonth = 4; // April
} else if (currentMonth <= 6) {
nextQuarterMonth = 7; // July
} else if (currentMonth <= 9) {
nextQuarterMonth = 10; // October
} else {
nextQuarterMonth = 1; // January next year
today = [Link]([Link]() + 1, 1, 1);
}
Date nextQuarterStart = [Link]([Link](), nextQuarterMonth, 1);

// Create Renewal Opportunity


Opportunity renewal = new Opportunity();
[Link] = 'Renewal - ' + [Link];
[Link] = [Link];
[Link] = nextQuarterStart;
[Link] = 'Prospecting'; // default stage for new opp
[Link] = [Link];

[Link](renewal);
}
}

if (![Link]()) {
insert renewalOpps;
}
}

Trigger or Record-Triggered Flow on Opportunity

Logic to calculate next quarter’s first day

Clone required fields & set new values

Ensure bulk handling for multiple Opportunities at once

trigger RenewalOpportunityTrigger on Opportunity (after update) {


List<Opportunity> renewalOpps = new List<Opportunity>();

for (Opportunity opp : [Link]) {


Opportunity oldOpp = [Link]([Link]);

// Only act when Stage changes to Closed Won


if ([Link] == 'Closed Won' && [Link] != 'Closed Won') {
// Calculate first day of next quarter
Date today = [Link]();
Integer currentMonth = [Link]();
Integer year = [Link]();
Integer nextQuarterMonth;

if (currentMonth <= 3) {
nextQuarterMonth = 4; // April
} else if (currentMonth <= 6) {
nextQuarterMonth = 7; // July
} else if (currentMonth <= 9) {
nextQuarterMonth = 10; // October
} else {
nextQuarterMonth = 1; // January next year
year = year + 1;
}

Date nextQuarterStart = [Link](year, nextQuarterMonth, 1);

// Clone required fields & set new values


Opportunity renewal = new Opportunity();
[Link] = 'Renewal - ' + [Link];
[Link] = [Link];
[Link] = nextQuarterStart;
[Link] = 'Prospecting'; // default stage for new opp
[Link] = [Link];
[Link] = [Link]; // example of cloning a field

[Link](renewal);
}
}

if (![Link]()) {
insert renewalOpps;
}
}
---
 Bulkified: Handles multiple Opportunities in one transaction.
 Logic: Compares [Link] vs [Link] to detect Stage change.
 Next Quarter Calculation: Dynamically finds the first day of the next quarter.
 Cloning Fields: Copies key fields (Name, Account, Amount, Owner) and sets new
values.
Alternative: Record-Triggered Flow
 Trigger: On Opportunity update.
 Condition: StageName = Closed Won.
 Assignment: Calculate next quarter start date (using formula resource).
 Action: Create new Opportunity record with required fields.

Wipro Salesforce Developer Imocha technical assessment question

Challange :
A developer at SkyNet Global must check if an Account’s Annual Revenue > 1,000,000.

If yes → create a task with subject "VIP Account Review",


Else → create a task with subject "Standard Account Review".
trigger AccountRevenueTaskTrigger on Account (after insert, after update) {
List<Task> tasksToInsert = new List<Task>();

for (Account acc : [Link]) {


// Check if Annual Revenue is populated
if ([Link] != null) {
Task t = new Task();
[Link] = [Link]; // Link task to Account
[Link] = [Link]; // Assign task to Account owner
[Link] = 'Not Started';
[Link] = 'Normal';

if ([Link] > 1000000) {


[Link] = 'VIP Account Review';
} else {
[Link] = 'Standard Account Review';
}
[Link](t);
}
}

if (![Link]()) {
insert tasksToInsert;
}
}
Use Apex

Core Salesforce Assessment Topics


 Apex & Triggers: Bulkification, before/after triggers, and Governor Limits.
 LWC: Usage of @wire, @track, and @api.
 Data Modeling & Querying: SOQL joins (semi-joins) and data consistency.
 Automation: Implementing record-triggered flows.
 Scenario: Creating a renewal opportunity upon "Closed-Won" status, with specific naming
and date requirements.
 Technical: Explaining the difference between with sharing and without sharing.
Difference Between With Sharing & Without Sharing in Apex
 With Sharing
o Enforces the current user’s sharing rules (OWD, role hierarchy, sharing
rules).
o Ensures Apex code respects the same visibility the user has in the UI.
o Example: If a user doesn’t have access to certain Accounts, queries in a with
sharing class won’t return them.
 Without Sharing
o Ignores sharing rules, runs in system context.
o Still respects object-level and field-level security, but bypasses record-level
sharing.
o Example: Admin processes that need to update all records regardless of
user’s access.
👉 Best Practice: Default to with sharing for business logic; use without sharing only when
system-level access is required.

 Technical: Implementing pagination for large datasets (over 2,000 records) in LWC.
 @AuraEnabled(cacheable=true)
 public static List<Account> getAccounts(Integer pageSize, Integer pageNumber) {
 Integer offsetSize = (pageNumber - 1) * pageSize;
 return [
 SELECT Id, Name, Industry
 FROM Account
 ORDER BY Name
 LIMIT :pageSize OFFSET :offsetSize
 ];
 }
 import { LightningElement, wire, track } from 'lwc';
 import getAccounts from '@salesforce/apex/[Link]';

 export default class AccountPagination extends LightningElement {
 @track pageNumber = 1;
 @track pageSize = 50;
 @track accounts;

 @wire(getAccounts, { pageSize: '$pageSize', pageNumber: '$pageNumber' })
 accounts;

 handleNext() {
 [Link]++;
 }

 handlePrev() {
 if([Link] > 1) {
 [Link]--;
 }
 }
 }
 <template>
 <lightning-card title="Accounts Pagination">
 <template for:each={[Link]} for:item="acc">
 <p key={[Link]}>{[Link]} - {[Link]}</p>
 </template>
 <lightning-button label="Previous" onclick={handlePrev}></lightning-button>
 <lightning-button label="Next" onclick={handleNext}></lightning-button>
 </lightning-card>
 </template>
Pagination in LWC → use Apex with LIMIT + OFFSET, wire results, and build
navigation buttons.
 Technical: Securing external API authentication.
To secure external API authentication in Salesforce, always use OAuth 2.0 flows (JWT,
Web Server, or Named Credentials) combined with TLS encryption, never hardcode
secrets, and rely on Salesforce’s built-in tools like Named Credentials or External
Credentials for safe storage and automatic token refresh.
Best Practices for Securing External API Authentication
1. Use OAuth 2.0 Flows
 JWT Bearer Flow: Best for server-to-server integrations without user interaction.
 Web Server Flow: Ideal for integrations requiring user consent.
 Username-Password Flow: Avoid unless absolutely necessary (less secure). 👉
OAuth ensures token-based authentication instead of static credentials.
2. Named Credentials & External Credentials
 Named Credentials: Store endpoint URL, authentication protocol, and credentials
securely in Salesforce.
 External Credentials (newer feature): Decouple secrets from Named Credentials,
allowing flexible reuse and rotation. 👉 Prevents hardcoding usernames/passwords in
Apex code.
3. Transport Layer Security (TLS)
 Salesforce enforces TLS 1.2+ for all API traffic.
 Ensure external APIs also support strong ciphers (≥128-bit keys).
4. Token Management
 Use refresh tokens or JWT assertions to avoid expired sessions.
 Automate token renewal with Named Credentials.
 Never store tokens in custom settings or plain text fields.
5. Principle of Least Privilege
 Create dedicated integration users with minimal permissions.
 Restrict API access to only required objects/fields.
 Monitor usage with Event Monitoring.
6. Audit & Monitoring
 Enable API usage logs and monitor suspicious activity.
 Use Shield Event Monitoring for advanced tracking.
 Rotate credentials regularly.
⚠️Risks & How to Avoid Them
 Hardcoding credentials → Use Named Credentials instead.
 Mixed DML with User creation → Split into async transactions.
 Expired tokens → Automate refresh with OAuth flows.
 Over-permissioned integration users → Apply least privilege principle.
✅ Summary
 Always use OAuth 2.0 for secure authentication.
 Store secrets in Named Credentials/External Credentials, not Apex code.
 Enforce TLS and monitor API usage.
 Automate token refresh to avoid downtime.

Aptitude test
Q6. Which tool prevents record save? 👉
B) Validation Rule (Workflows/Flows run after save; Validation stops save).
Q7. What controls field-level security? 👉
B) Profile (and Permission Sets). Roles/Queues/Groups don’t control FLS.
Q8. Best automation for multi-step logic? 👉 B) Flow (Workflows are single-step, PB is
legacy, Flows handle complex branching).
Q9. Sharing Rule is used for? 👉 B) Extend access (Sharing rules only open up access,
never restrict).
Q10. Which sandbox contains full data? 👉 Full Sandbox.
Q11. How to auto assign leads? 👉 Lead Assignment Rules.
Q12. Permission Set vs Profile — main difference? 👉 Profile = baseline access;
Permission Set = add-on access (cannot reduce).
Q13. How to send email when Opportunity Closed Won? 👉 Workflow/Process
Builder/Flow with criteria StageName = Closed Won.
Q14. What is Roll-up Summary? 👉 Field on parent (Master) that aggregates child records
(SUM, COUNT, MIN, MAX).
Q15. Can Flow update parent record? 👉 Yes, record-triggered Flow can update parent via
Update Records element.
💻 SECTION 3: DEVELOPMENT
Q16. Trigger execution order? 👉 A) Before → After.
Q17. Max SOQL queries in sync? 👉 100 per transaction.
Q18. What is Bulkification? 👉 Writing code to handle many records at once (use
collections, avoid loops with DML/SOQL).
Q19. Can we call future from trigger? 👉 Yes, but with limits (max 50 calls).
Q20. Can we call future from batch? 👉 No, not allowed.
Q21. What is better than @future? 👉 Queueable Apex (chaining, complex jobs).
Q22. What causes Mixed DML error? 👉 Performing setup object DML (User, Profile) +
non-setup object DML (Account, Contact) in same transaction. Split the operations Use
@future, Queueable Apex, or Platform Events to split the operations. Perform non-setup
object DML first, then enqueue async job for setup object DML
Q23. Can we use DML inside loop? 👉 No, violates bulkification best practice.
Q24. What is [Link]? 👉 Context variable: list of new versions of records in
insert/update.
Q25. Queueable advantage? 👉 Supports complex jobs, chaining, larger limits vs @future.
🔥 SECTION 4: SCENARIO + CODING
Q26. When Lead created → create Task 👉 Record-triggered Flow or After Insert Trigger.
Q27. Prevent Account deletion 👉 Before Delete Trigger with addError().
Q28. Update Account when Contact updated 👉 After Update Trigger on Contact, update
parent Account.
Q29. Avoid duplicate Contacts 👉 Duplicate Rules + Matching Rules.
Q30. Create Community user on Contact insert — Issue? 👉 Mixed DML error (Contact +
User creation together).
Q31. Logic to collect Account names in Set
apex
Set<String> accNames = new Set<String>();
for (Account acc : [SELECT Name FROM Account]) {
[Link]([Link]);
}
Q32. Bulk-safe trigger best practice 👉 Use collections, one SOQL/DML outside loops,
handle [Link] as a set.
Q33. Parent → Child LWC communication 👉 Pass data via @api properties.
Q34. Child → Parent communication 👉 Use Custom Events ([Link](new
CustomEvent('eventname'))).
Q35. API failure handling (real-time system) 👉 Use try-catch, log errors, retry logic,
platform events, fallback response.

You might also like