Platform App Builder Flashcards

(261 cards)

1
Q

A company needs to update 10,000 Opportunity records nightly based on complex logic involving multiple related objects. Can this be achieved declaratively? If not, provide an Apex solution and explain why programmatic customization is required.

A

Declarative tools like Flow or Process Builder are limited by governor limits (e.g., 2,000 records per batch in Flow). For 10,000 records with complex logic, Apex is required for efficient bulk processing.

public class OpportunityBatch implements Database.Batchable<SObject> {
public Database.QueryLocator start(Database.BatchableContext bc) {
return Database.getQueryLocator('SELECT Id, Amount, Account.Industry FROM Opportunity WHERE LastModifiedDate = TODAY');
}
public void execute(Database.BatchableContext bc, List<Opportunity> scope) {
for (Opportunity opp : scope) {
if (opp.Account.Industry == 'Tech' && opp.Amount > 100000) {
opp.StageName = 'Closed Won';
}
}
update scope;
}
public void finish(Database.BatchableContext bc) {}
}</Opportunity></SObject>

As a CTA, you’re tasked with designing a nightly sync for a client processing 50,000 Opportunities. The logic involves cross-object calculations and external system updates. Propose a solution, justifying why declarative tools are insufficient and how Apex ensures scalability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A client requires a validation rule that prevents Opportunity closure unless all related Tasks are completed and the Account has a specific custom field value. Can this be done declaratively? If not, provide an Apex trigger.

A

Declarative validation rules cannot enforce complex cross-object logic involving multiple related records. An Apex trigger is needed.

trigger OpportunityTrigger on Opportunity (before update) {
for (Opportunity opp : Trigger.new) {
if (opp.StageName == ‘Closed Won’) {
List<Task> tasks = [SELECT Id, Status FROM Task WHERE WhatId = :opp.Id AND Status != 'Completed'];
Account acc = [SELECT CustomField\_\_c FROM Account WHERE Id = :opp.AccountId];
if (!tasks.isEmpty() || acc.CustomField\_\_c != 'Approved') {
opp.addError('Cannot close Opportunity until all Tasks are completed and Account is Approved.');
}
}
}
}</Task>

CTA Case Study: A global firm needs Opportunity validation across 10 regions, each with unique rules based on local regulations. Design a solution, explaining why Apex is preferred over validation rules and how you’d ensure maintainability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A client wants a custom Opportunity page with dynamic fields based on the user’s profile. Can this be achieved declaratively? If not, propose a programmatic solution.

A

Declarative tools (e.g., Dynamic Forms) have limited support for profile-based field rendering. A Lightning Web Component (LWC) is needed for full control.

public with sharing class OpportunityController {
@AuraEnabled(cacheable=true)
public static List<String> getFieldsForProfile(Id recordId) {
String profileName = [SELECT Name FROM Profile WHERE Id = :UserInfo.getProfileId()].Name;
List<String> fields = new List<String>{'Name', 'Amount'};
if (profileName == 'Sales Manager') {
fields.add('CloseDate');
}
return fields;
}
}</String></String></String>

CTA Case Study: A CTA must design a dynamic UI for a multi-national company with 50 profiles and varying field requirements. Justify using LWC over Dynamic Forms, addressing performance and scalability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A client needs to sync Salesforce Accounts with an external ERP system in real-time. Is this possible declaratively? If not, provide an Apex callout solution.

A

Declarative tools (e.g., External Services) are limited for complex, real-time integrations. Apex HTTP callouts are required.

public class ERPSync {
@future(callout=true)
public static void syncAccount(String accountId) {
Http http = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint(‘https://erp.example.com/api/accounts’);
req.setMethod(‘POST’);
req.setBody(‘{“accountId”: “’ + accountId + ‘”}’);
HttpResponse res = http.send(req);
if (res.getStatusCode() != 200) {
// Log error
}
}
}

A client requires bi-directional ERP sync with 100,000 records daily. Propose a solution, explaining why Apex and Platform Events are needed over declarative tools like Salesforce Connect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

A client wants to send custom email notifications to Opportunity owners when the Amount exceeds $1M, including dynamic content from related records. Can this be done declaratively? If not, provide an Apex solution.

A

Declarative email alerts lack dynamic content control. Apex is needed for custom email logic.

public class OpportunityNotification {
public static void sendHighValueNotification(List<Opportunity> opps) {
List<Messaging.SingleEmailMessage> emails = new List<Messaging.SingleEmailMessage>();
for (Opportunity opp : opps) {
if (opp.Amount > 1000000) {
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
email.setToAddresses(new List<String>{opp.Owner.Email});
email.setSubject('High Value Opportunity: ' + opp.Name);
email.setPlainTextBody('Account: ' + opp.Account.Name + '\nAmount: ' + opp.Amount);
emails.add(email);
}
}
Messaging.sendEmail(emails);
}
}</String></Messaging.SingleEmailMessage></Messaging.SingleEmailMessage></Opportunity>

CTA Case Study: Design a notification system for a client with 1,000 users, requiring localized email templates and audit logging. Justify Apex over Flow-based email alerts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A client needs a report that aggregates Opportunity data with custom weighted scoring based on multiple fields. Can this be done declaratively? If not, provide an Apex solution.

A

Declarative reports cannot handle complex weighted scoring. Apex is needed for custom calculations.

public class OpportunityScoring {
public static void calculateScores(List<Opportunity> opps) {
for (Opportunity opp : opps) {
Decimal score = (opp.Amount * 0.5) + (opp.Probability * 0.3) + (opp.CloseDate.daysBetween(Date.today()) * 0.2);
opp.CustomScore\_\_c = score;
}
update opps;
}
}</Opportunity>

CTA Case Study: A CTA must design a scoring system for a client with 10M Opportunities, integrated with Tableau. Explain why Apex and a custom object are preferred over report formulas.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A client needs to dynamically share Opportunity records with a partner portal based on custom criteria. Can this be done declaratively? If not, provide an Apex solution.

A

Declarative sharing rules cannot handle dynamic, criteria-based portal sharing. Apex is required.

public class OpportunitySharing {
public static void shareWithPartner(List<Opportunity> opps) {
List<OpportunityShare> shares = new List<OpportunityShare>();
for (Opportunity opp : opps) {
if (opp.Partner_Involved\_\_c) {
OpportunityShare share = new OpportunityShare();
share.OpportunityId = opp.Id;
share.UserOrGroupId = [SELECT Id FROM Group WHERE Name = 'Partner Portal'].Id;
share.OpportunityAccessLevel = 'Edit';
shares.add(share);
}
}
insert shares;
}
}</OpportunityShare></OpportunityShare></Opportunity>

CTA Case Study: A global firm needs to share records with 500 partners, with audit trails and revocation logic. Justify Apex over manual sharing rules, addressing security concerns.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

A client requires an approval process where approvers are dynamically selected based on Opportunity Amount and Region. Can this be done declaratively? If not, provide an Apex solution.

A

Declarative approval processes lack dynamic approver logic. Apex is needed.

public class DynamicApproval {
public static void submitForApproval(List<Opportunity> opps) {
for (Opportunity opp : opps) {
Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest();
req.setObjectId(opp.Id);
String approverId = opp.Amount > 500000 ? [SELECT Id FROM User WHERE Region\_\_c = :opp.Region\_\_c AND Role = 'VP'].Id : opp.OwnerId;
req.setNextApproverIds(new List<Id>{approverId});
Approval.process(req);
}
}
}</Id></Opportunity>

CTA Case Study: Design an approval system for a client with 10,000 Opportunities monthly, requiring multi-step approvals and escalations. Explain why Apex is needed over declarative approvals.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A client needs to transform Opportunity data in real-time (e.g., currency conversion) before display. Can this be done declaratively? If not, provide an Apex solution.

A

Declarative tools cannot handle real-time transformations. Apex and LWC are needed.

public class CurrencyConverter {
@AuraEnabled
public static Decimal convertAmount(Decimal amount, String currencyCode) {
Decimal rate = [SELECT ConversionRate FROM CurrencyType WHERE IsoCode = :currencyCode].ConversionRate;
return amount * rate;
}
}

CTA Case Study: A CTA must design a real-time dashboard for a client with multi-currency operations. Justify using Apex and LWC over formula fields, addressing performance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A client needs to schedule follow-up Tasks for Opportunities based on a custom algorithm. Can this be done declaratively? If not, provide an Apex solution.

A

Declarative tools cannot handle complex scheduling algorithms. Apex is required.

public class TaskScheduler {
public static void createFollowUpTasks(List<Opportunity> opps) {
List<Task> tasks = new List<Task>();
for (Opportunity opp : opps) {
Task t = new Task();
t.WhatId = opp.Id;
t.Subject = 'Follow Up: ' + opp.Name;
t.ActivityDate = opp.CloseDate.addDays(opp.Amount > 100000 ? 7 : 14);
t.OwnerId = opp.OwnerId;
tasks.add(t);
}
insert tasks;
}
}</Task></Task></Opportunity>

CTA Case Study: A client needs a scheduling system for 1M Opportunities, with dynamic rules based on industry and region. Propose a solution, justifying Apex over Flow-based scheduling.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

A company manually enters contact data from web forms into Salesforce, leading to errors. How can AppExchange address this? Provide an Apex alternative.

A

AppExchange offers apps like FormAssembly for automated web form integration. These apps map form data to Salesforce objects, reducing errors. Apex can achieve similar automation via a custom web service.

@RestResource(urlMapping=’/WebForm/*’)
global class WebFormService {
@HttpPost
global static String createContact(String firstName, String lastName, String email) {
Contact c = new Contact(FirstName = firstName, LastName = lastName, Email = email);
insert c;
return c.Id;
}
}

CTA Case Study: A global retailer with 1M daily form submissions needs to automate data entry across 50 regions. Propose an AppExchange solution like FormAssembly versus a custom Apex service, justifying scalability, maintenance, and cost considerations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A sales team struggles with duplicate Leads from marketing campaigns. How can AppExchange help? Provide an Apex alternative.

A

Apps like DupeBlocker prevent duplicates in real-time across Lead sources. Apex can enforce deduplication via a trigger.

trigger LeadDeduplication on Lead (before insert) {
for (Lead newLead : Trigger.new) {
List<Lead> duplicates = [SELECT Id FROM Lead WHERE Email = :newLead.Email LIMIT 1];
if (!duplicates.isEmpty()) {
newLead.addError('Duplicate Lead detected with email: ' + newLead.Email);
}
}
}</Lead>

CTA Case Study: A financial firm with 10M Leads needs deduplication across Sales Cloud and Pardot. Design a solution using DupeBlocker versus Apex, addressing governor limits and integration complexity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

A marketing team needs to automate personalized campaigns. How can AppExchange assist? Provide an Apex alternative for custom campaign logic.

A

Apps like Marketo or HubSpot on AppExchange automate campaigns and track engagement. Apex can trigger custom campaign actions.

public class CampaignAutomation {
public static void sendCampaignEmail(List<Lead> leads) {
List<Messaging.SingleEmailMessage> emails = new List<Messaging.SingleEmailMessage>();
for (Lead l : leads) {
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
email.setToAddresses(new List<String>{l.Email});
email.setSubject('Personalized Offer for ' + l.FirstName);
email.setPlainTextBody('Dear ' + l.FirstName + ', check our latest offer!');
emails.add(email);
}
Messaging.sendEmail(emails);
}
}</String></Messaging.SingleEmailMessage></Messaging.SingleEmailMessage></Lead>

CTA Case Study: A B2B company with 500,000 Leads requires multi-channel campaign automation. Compare Marketo on AppExchange with a custom Apex/LWC solution, evaluating time-to-market and scalability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

A company lacks native Salesforce accounting features. How can AppExchange address this? Provide an Apex integration example.

A

Apps like Accounting Seed provide native accounting solutions. Apex can integrate with external accounting systems via callouts.

public class AccountingSync {
@future(callout=true)
public static void syncInvoice(String invoiceId) {
Http http = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint(‘https://accounting.example.com/api/invoices’);
req.setMethod(‘POST’);
req.setBody(‘{“invoiceId”: “’ + invoiceId + ‘”}’);
HttpResponse res = http.send(req);
if (res.getStatusCode() != 200) {
// Log error
}
}
}

CTA Case Study: A manufacturing firm with $500M revenue needs accounting integration for 100,000 invoices. Propose Accounting Seed versus a custom Apex integration, addressing security and compliance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

A client needs complex dashboards beyond Salesforce Reports. How can AppExchange help? Provide an Apex data aggregation example.

A

Tableau CRM or other analytics apps on AppExchange offer advanced dashboards. Apex can aggregate data for custom reports.

public class OpportunityAnalytics {
public static Map<String, Decimal> getIndustryTotals() {
Map<String, Decimal> totals = new Map<String, Decimal>();
for (AggregateResult ar : [SELECT Account.Industry, SUM(Amount) total FROM Opportunity GROUP BY Account.Industry]) {
totals.put((String)ar.get(‘Industry’), (Decimal)ar.get(‘total’));
}
return totals;
}
}

CTA Case Study: A healthcare provider with 10M patient records needs predictive analytics. Design a solution using Tableau CRM versus Apex with LWC, considering performance and user adoption.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

A support team needs to streamline case management. How can AppExchange assist? Provide an Apex automation example.

A

Apps like Service Cloud or Zendesk enhance case management. Apex can automate case assignments.

trigger CaseAssignment on Case (before insert) {
Group supportQueue = [SELECT Id FROM Group WHERE Type = ‘Queue’ AND Name = ‘Support Queue’ LIMIT 1];
for (Case c : Trigger.new) {
if (c.Priority == ‘High’) {
c.OwnerId = supportQueue.Id;
}
}
}

CTA Case Study: A telecom with 1M monthly cases needs omni-channel support. Compare Service Cloud on AppExchange with a custom Apex/Flow solution, addressing scalability and maintenance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

A healthcare client needs HIPAA-compliant patient portals. How can AppExchange help? Provide an Apex portal example.

A

Bolt Solutions on AppExchange offer pre-built healthcare portals. Apex can build custom portals with security controls.

public class PatientPortalController {
@AuraEnabled
public static List<Health_Record__c> getPatientRecords(Id patientId) {
return [SELECT Id, Diagnosis__c FROM Health_Record__c WHERE Patient__c = :patientId WITH SECURITY_ENFORCED];
}
}

CTA Case Study: A hospital network with 500,000 patients needs a HIPAA-compliant portal. Propose a Bolt Solution versus a custom Apex/LWC portal, evaluating compliance and deployment speed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

A team needs project management within Salesforce. How can AppExchange address this? Provide an Apex task scheduler.

A

Apps like Smartsheet or Monday.com integrate project management. Apex can schedule project tasks.

public class ProjectTaskScheduler {
public static void createTasks(List<Project__c> projects) {
List<Task> tasks = new List<Task>();
for (Project\_\_c p : projects) {
Task t = new Task(WhatId = p.Id, Subject = 'Milestone Review', ActivityDate = p.End_Date\_\_c);
tasks.add(t);
}
insert tasks;
}
}</Task></Task>

CTA Case Study: A consulting firm with 10,000 projects needs integrated project tracking. Compare Smartsheet on AppExchange with a custom Apex solution, addressing user experience and cost.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

A sales team needs Outlook integration for email and calendar sync. How can AppExchange help? Provide an Apex email handler.

A

Salesforce Outlook Integration apps sync emails and calendars. Apex can process inbound emails.

global class EmailHandler implements Messaging.InboundEmailHandler {
global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope env) {
Messaging.InboundEmailResult result = new Messaging.InboundEmailResult();
Contact c = [SELECT Id FROM Contact WHERE Email = :email.fromAddress LIMIT 1];
Task t = new Task(WhoId = c.Id, Subject = ‘Email: ‘ + email.subject, Description = email.plainTextBody);
insert t;
result.success = true;
return result;
}
}

CTA Case Study: A global sales team with 5,000 users needs Outlook sync across regions. Propose Salesforce Outlook Integration versus a custom Apex email service, evaluating integration complexity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

A client needs enhanced data security for GDPR compliance. How can AppExchange assist? Provide an Apex security example.

A

Apps like Data Privacy Manager enforce compliance. Apex can enforce field-level security programmatically.

public class DataSecurity {
public static void restrictAccess(List<Contact> contacts) {
for (Contact c : contacts) {
if (!Schema.sObjectType.Contact.fields.Sensitive_Data\_\_c.isAccessible()) {
c.addError('Access to Sensitive Data is restricted.');
}
}
}
}</Contact>

CTA Case Study: A European bank with 2M customer records needs GDPR-compliant data masking. Design a solution using Data Privacy Manager versus Apex with custom objects, addressing regulatory audits and scalability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How can an app builder restrict the Marketing team from creating or editing Campaign records while allowing read-only access? Provide an Apex alternative for dynamic access checks.

A

Use Profiles to set object-level permissions: set Campaign object permissions to “Read” only for the Marketing profile. Apex can enforce dynamic access checks.

public class CampaignAccess {
@AuraEnabled
public static Boolean canEditCampaign(Id campaignId) {
return Schema.sObjectType.Campaign.isUpdateable();
}
}

CTA Case Study: A global firm with 10,000 users needs to restrict Campaign access for 5 regional Marketing teams, each with unique permissions. Design a solution using Profiles and Permission Sets, justifying scalability and maintenance over Apex-based access control.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

A client wants to hide the Opportunity Amount field from Sales Reps but allow Managers to edit it. How can this be achieved? Provide an Apex validation example.

A

Use Field-Level Security (FLS) to set the Amount field to “Read-Only” for the Sales Rep profile and “Edit” for the Manager profile. Apex can validate FLS programmatically.

public class OpportunitySecurity {
public static void enforceFLS(List<Opportunity> opps) {
if (!Schema.sObjectType.Opportunity.fields.Amount.isUpdateable()) {
for (Opportunity opp : opps) {
opp.addError('You lack permission to edit the Amount field.');
}
}
}
}</Opportunity>

CTA Case Study: A financial institution with 50,000 Opportunities needs FLS for 20 sensitive fields across 10 profiles. Propose a solution using FLS and Permission Sets, addressing audit requirements and performance impacts versus Apex enforcement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

How can an app builder ensure Accounts are private except for the owner and their role hierarchy? Provide an Apex sharing example.

A

Set the Organization-Wide Default (OWD) for Accounts to “Private.” Use role hierarchy to extend access. Apex can create manual sharing records.

public class AccountSharing {
public static void shareWithManager(List<Account> accounts) {
List<AccountShare> shares = new List<AccountShare>();
for (Account acc : accounts) {
AccountShare share = new AccountShare();
share.AccountId = acc.Id;
share.UserOrGroupId = acc.Owner.ManagerId;
share.AccountAccessLevel = 'Edit';
shares.add(share);
}
insert shares;
}
}</AccountShare></AccountShare></Account>

CTA Case Study: A healthcare provider with 1M Accounts needs a private sharing model with exceptions for cross-department collaboration. Design a solution using OWD and Sharing Rules, evaluating Apex sharing for dynamic needs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

A client needs to share Opportunities with Amount > $1M with the Finance team. How can this be done declaratively? Provide an Apex alternative.

A

Create a criteria-based Sharing Rule on Opportunity to share records where Amount > $1M with the Finance public group. Apex can implement custom sharing logic.

public class OpportunitySharing {
public static void shareHighValueOpps(List<Opportunity> opps) {
List<OpportunityShare> shares = new List<OpportunityShare>();
Id financeGroupId = [SELECT Id FROM Group WHERE Name = 'Finance Team'].Id;
for (Opportunity opp : opps) {
if (opp.Amount > 1000000) {
OpportunityShare share = new OpportunityShare();
share.OpportunityId = opp.Id;
share.UserOrGroupId = financeGroupId;
share.OpportunityAccessLevel = 'Read';
shares.add(share);
}
}
insert shares;
}
}</OpportunityShare></OpportunityShare></Opportunity>

CTA Case Study: A tech firm with 100,000 Opportunities needs dynamic sharing for high-value deals across 20 teams. Compare Sharing Rules with Apex-managed sharing, addressing governor limits and flexibility.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
How can an app builder grant temporary edit access to Cases for a specific project team without modifying profiles? Provide an Apex access check.
Create a Permission Set with "Edit" access to the Case object and assign it to project team members. Apex can verify permissions dynamically. public class CaseAccess { @AuraEnabled public static Boolean hasCaseEditAccess() { return Schema.sObjectType.Case.isUpdateable(); } } CTA Case Study: A retailer with 5,000 users needs to grant temporary access to 10 objects for a 6-month project. Design a solution using Permission Sets, justifying over Profile changes or Apex, considering user management and cleanup.
26
A sales manager needs to share a specific Account with a consultant temporarily. How can this be achieved? Provide an Apex manual sharing example.
Use Manual Sharing to grant the consultant access to the Account record via the Sharing button. Apex can automate manual sharing. public class ManualSharing { public static void shareAccount(Id accountId, Id userId) { AccountShare share = new AccountShare(); share.AccountId = accountId; share.UserOrGroupId = userId; share.AccountAccessLevel = 'Edit'; insert share; } } CTA Case Study: A consulting firm with 50,000 Accounts needs to share records with external partners for 100 projects. Propose a solution using Manual Sharing and Flows versus Apex, addressing security and audit trails.
27
How can an app builder ensure Regional Managers see all Accounts owned by their Sales Reps? Provide an Apex validation for role-based access.
Configure the Role Hierarchy to place Regional Managers above Sales Reps, with OWD set to "Private" for Accounts. Apex can enforce role-based checks. public class AccountAccess { public static void validateRoleAccess(List accounts) { Id userRoleId = UserInfo.getUserRoleId(); Role__c managerRole = [SELECT Id FROM Role__c WHERE Name = 'Regional Manager']; if (userRoleId != managerRole.Id) { for (Account acc : accounts) { acc.addError('Only Regional Managers can modify this Account.'); } } } } CTA Case Study: A global enterprise with 20 regions and 10,000 Accounts needs a flexible role hierarchy. Design a solution, comparing Role Hierarchy with Apex-based access, addressing scalability and role changes.
28
A client wants to prevent Sales Reps from editing a Lookup field on Opportunity linking to a sensitive custom object. How can this be done? Provide an Apex FLS check.
Use FLS to set the Lookup field to "Read-Only" for the Sales Rep profile. Apex can enforce FLS programmatically. public class OpportunityLookupSecurity { public static void restrictLookupEdit(List opps) { if (!Schema.sObjectType.Opportunity.fields.Sensitive_Lookup__c.isUpdateable()) { for (Opportunity opp : opps) { opp.addError('You cannot edit the Sensitive Lookup field.'); } } } } CTA Case Study: A bank with 500,000 Opportunities needs to restrict 5 Lookup fields across 15 profiles. Propose a solution using FLS and Permission Sets, evaluating Apex for dynamic restrictions and compliance needs.
29
How can an app builder share all Opportunities in a specific region with a cross-functional team? Provide an Apex sharing solution.
Create a Public Group for the cross-functional team and a Sharing Rule to grant access to Opportunities where Region__c matches. Apex can automate group sharing. public class RegionSharing { public static void shareWithRegionTeam(List opps) { List shares = new List(); Id teamGroupId = [SELECT Id FROM Group WHERE Name = 'Region Team'].Id; for (Opportunity opp : opps) { if (opp.Region__c == 'EMEA') { OpportunityShare share = new OpportunityShare(); share.OpportunityId = opp.Id; share.UserOrGroupId = teamGroupId; share.OpportunityAccessLevel = 'Edit'; shares.add(share); } } insert shares; } } CTA Case Study: A logistics firm with 200,000 Opportunities needs region-based sharing for 50 teams. Design a solution using Public Groups and Sharing Rules, comparing with Apex for dynamic team changes.
30
A client needs to bundle multiple Permission Sets for a temporary audit team with access to 5 objects. How can this be achieved? Provide an Apex access verification.
Create a Permission Set Group combining Permission Sets for the 5 objects and assign it to the audit team. Apex can verify access dynamically. public class AuditAccess { @AuraEnabled public static Map checkObjectAccess() { Map accessMap = new Map(); accessMap.put('Account', Schema.sObjectType.Account.isAccessible()); accessMap.put('Opportunity', Schema.sObjectType.Opportunity.isAccessible()); return accessMap; } } CTA Case Study: A government agency with 10,000 users needs temporary access for 100 auditors across 20 objects. Propose a solution using Permission Set Groups, justifying over Apex or Profile changes, addressing cleanup and security.
31
A company requires Accounts to be private, accessible only by owners, except Regional Managers who need read access to all Accounts in their region. What sharing solution is best? Provide an Apex alternative.
Set OWD to Private for Accounts and use Role Hierarchy to grant Regional Managers read access. Alternatively, use Apex for dynamic sharing. public class AccountRegionSharing { public static void shareWithRegionalManager(List accounts) { List shares = new List(); for (Account acc : accounts) { Id managerId = [SELECT Id FROM User WHERE Region__c = :acc.Region__c AND UserRole.Name = 'Regional Manager' LIMIT 1]?.Id; if (managerId != null) { AccountShare share = new AccountShare(AccountId = acc.Id, UserOrGroupId = managerId, AccountAccessLevel = 'Read'); shares.add(share); } } insert shares; } } CTA Case Study: A global retailer with 1M Accounts across 50 regions needs a private sharing model with regional oversight. Design a solution using OWD and Role Hierarchy versus Apex, justifying scalability and maintenance for frequent role changes.
32
A business requires Opportunities with Amount > $500K to be shared with the Finance team for read-only access. What sharing solution fits? Provide an Apex implementation.
Use a Criteria-Based Sharing Rule to share Opportunities where Amount > $500K with the Finance Public Group. Apex can automate this sharing. public class OpportunityValueSharing { public static void shareHighValueOpps(List opps) { List shares = new List(); Id financeGroupId = [SELECT Id FROM Group WHERE Name = 'Finance Team' LIMIT 1].Id; for (Opportunity opp : opps) { if (opp.Amount > 500000) { OpportunityShare share = new OpportunityShare(OpportunityId = opp.Id, UserOrGroupId = financeGroupId, OpportunityAccessLevel = 'Read'); shares.add(share); } } insert shares; } } CTA Case Study: A tech firm with 200,000 Opportunities needs to share high-value deals with multiple departments dynamically. Propose Sharing Rules versus Apex, addressing governor limits and audit requirements for a 10,000-user org.
33
A support team requires cross-functional collaboration on high-priority Cases, with edit access for specific team members. What sharing solution is appropriate? Provide an Apex team-sharing example.
Use Case Teams to assign edit access to cross-functional members. Apex can manage team assignments programmatically. public class CaseTeamSharing { public static void addCaseTeamMembers(List cases) { List members = new List(); Id teamRoleId = [SELECT Id FROM CaseTeamRole WHERE Name = 'Support Specialist' LIMIT 1].Id; for (Case c : cases) { if (c.Priority == 'High') { CaseTeamMember member = new CaseTeamMember(ParentId = c.Id, MemberId = c.OwnerId, TeamRoleId = teamRoleId); members.add(member); } } insert members; } } CTA Case Study: A telecom with 1M monthly Cases needs flexible team-based access for 100 support teams. Design a solution using Case Teams versus Apex, evaluating performance and user experience for a global org.
34
A project team needs temporary edit access to specific Accounts for a 3-month audit. What sharing solution is best? Provide an Apex manual sharing solution.
Use Manual Sharing to grant temporary edit access, or assign a Permission Set with edit access. Apex can automate manual sharing. public class ProjectSharing { public static void grantTemporaryAccess(List accounts, Id userId) { List shares = new List(); for (Account acc : accounts) { AccountShare share = new AccountShare(AccountId = acc.Id, UserOrGroupId = userId, AccountAccessLevel = 'Edit'); shares.add(share); } insert shares; } } CTA Case Study: A government agency with 50,000 Accounts needs temporary access for 200 auditors across 10 projects. Propose Manual Sharing with Flows versus Apex, addressing cleanup and security for a 5,000-user org.
35
A company needs to share specific Opportunities with external partners via a Partner Community. What sharing solution fits? Provide an Apex sharing solution.
Use Sharing Sets or Manual Sharing for Partner Community users. Apex can manage partner sharing dynamically. public class PartnerOpportunitySharing { public static void shareWithPartners(List opps) { List shares = new List(); Id partnerGroupId = [SELECT Id FROM Group WHERE Name = 'Partner Community' LIMIT 1].Id; for (Opportunity opp : opps) { if (opp.Partner_Involved__c) { OpportunityShare share = new OpportunityShare(OpportunityId = opp.Id, UserOrGroupId = partnerGroupId, OpportunityAccessLevel = 'Edit'); shares.add(share); } } insert shares; } } A manufacturing firm with 100,000 Opportunities needs to share deals with 500 partners securely. Design a solution using Sharing Sets versus Apex, addressing scalability and external user licensing costs.
36
A business requires Accounts to be shared with sales teams based on geographic territory. What sharing solution is appropriate? Provide an Apex alternative.
Use Enterprise Territory Management to assign Accounts to territory-based teams. Apex can implement custom territory sharing. public class TerritorySharing { public static void shareByTerritory(List accounts) { List shares = new List(); for (Account acc : accounts) { Id territoryGroupId = [SELECT Id FROM Group WHERE Name = :acc.Territory__c LIMIT 1]?.Id; if (territoryGroupId != null) { AccountShare share = new AccountShare(AccountId = acc.Id, UserOrGroupId = territoryGroupId, AccountAccessLevel = 'Edit'); shares.add(share); } } insert shares; } } A logistics company with 500,000 Accounts across 100 territories needs dynamic sharing. Propose Territory Management versus Apex, evaluating configuration complexity and performance for a 2,000-user org.
37
A marketing team needs read access to Opportunities owned by the Sales team for campaign planning. What sharing solution fits? Provide an Apex solution.
Use a Criteria-Based Sharing Rule to share Opportunities with the Marketing Public Group. Apex can handle complex sharing logic. public class CrossDeptSharing { public static void shareWithMarketing(List opps) { List shares = new List(); Id marketingGroupId = [SELECT Id FROM Group WHERE Name = 'Marketing Team' LIMIT 1].Id; for (Opportunity opp : opps) { OpportunityShare share = new OpportunityShare(OpportunityId = opp.Id, UserOrGroupId = marketingGroupId, OpportunityAccessLevel = 'Read'); shares.add(share); } insert shares; } } CTA Case Study: A media company with 300,000 Opportunities needs cross-department sharing for 20 teams. Design a solution using Sharing Rules versus Apex, addressing maintenance and audit trails for a 15,000-user org.
38
Executives need read-only access to all Cases to monitor customer satisfaction. What sharing solution is best? Provide an Apex alternative.
Set OWD to Private for Cases and use Role Hierarchy to grant executives read access. Apex can enforce executive sharing. public class ExecutiveCaseSharing { public static void shareWithExecutives(List cases) { List shares = new List(); Id execGroupId = [SELECT Id FROM Group WHERE Name = 'Executives' LIMIT 1].Id; for (Case c : cases) { CaseShare share = new CaseShare(CaseId = c.Id, UserOrGroupId = execGroupId, CaseAccessLevel = 'Read'); shares.add(share); } insert shares; } } CTA Case Study: A healthcare provider with 2M Cases needs executive oversight across 10 regions. Propose Role Hierarchy versus Apex, justifying performance and security for a 7,000-user org.
39
A project-based organization needs to share Accounts with dynamic teams formed for each project. What sharing solution is appropriate? Provide an Apex solution.
Use Account Teams to assign project-specific access. Apex can manage dynamic team sharing. public class DynamicTeamSharing { public static void addAccountTeam(List accounts, Id projectTeamId) { List members = new List(); for (Account acc : accounts) { AccountTeamMember member = new AccountTeamMember(AccountId = acc.Id, UserId = projectTeamId, AccountAccessLevel = 'Edit'); members.add(member); } insert members; } } CTA Case Study: A consulting firm with 50,000 Accounts and 200 project teams needs flexible sharing. Design a solution using Account Teams versus Apex, addressing team turnover and scalability.
40
Question: A bank requires sensitive Accounts to be accessible only to Compliance Officers, regardless of ownership. What sharing solution fits? Provide an Apex implementation.
Use a Criteria-Based Sharing Rule to share Accounts marked as sensitive with the Compliance Public Group. Apex can enforce compliance sharing. public class ComplianceSharing { public static void shareSensitiveAccounts(List accounts) { List shares = new List(); Id complianceGroupId = [SELECT Id FROM Group WHERE Name = 'Compliance Officers' LIMIT 1].Id; for (Account acc : accounts) { if (acc.Sensitive__c) { AccountShare share = new AccountShare(AccountId = acc.Id, UserOrGroupId = complianceGroupId, AccountAccessLevel = 'Edit'); shares.add(share); } } insert shares; } } CTA Case Study: A bank with 500,000 Accounts needs GDPR-compliant sharing for 10,000 sensitive records. Propose Sharing Rules versus Apex, evaluating regulatory audit needs and performance for a 3,000-user org.
41
What are the key features of a Tabular Report in Salesforce, and when should it be used? Provide an Apex alternative for data retrieval.
Tabular Reports display data in a spreadsheet-like format with rows and columns, ideal for simple lists (e.g., all Opportunities). Features include filters, exportability, and column customization, but no grouping or charts. Use for data exports or quick record lists. public class OpportunityList { @AuraEnabled(cacheable=true) public static List getOpportunities() { return [SELECT Name, Amount, StageName FROM Opportunity WHERE StageName = 'Closed Won' LIMIT 100]; } } CTA Case Study: A sales org with 1M Opportunities needs a daily export of closed deals for external analysis. Design a solution using Tabular Reports versus an Apex REST service, justifying scalability, performance, and data volume handling for a 5,000-user org.
42
How can Summary Reports enhance data analysis, and what grouping features are available? Provide an Apex equivalent for grouped data.
Summary Reports allow grouping by fields (e.g., Opportunity Stage) with subtotals, averages, or counts. Features include multiple grouping levels, summary calculations, and chart support. Use for hierarchical data like sales by region. public class OpportunitySummary { @AuraEnabled public static Map getStageTotals() { Map totals = new Map(); for (AggregateResult ar : [SELECT StageName, SUM(Amount) total FROM Opportunity GROUP BY StageName]) { totals.put((String)ar.get('StageName'), (Decimal)ar.get('total')); } return totals; } } CTA Case Study: A global firm with 500,000 Opportunities needs to analyze sales by region and owner. Propose a Summary Report versus Apex with LWC, addressing user adoption and real-time updates for a 10,000-user org.
43
What capabilities does a Matrix Report offer, and when is it most effective? Provide an Apex solution for matrix data.
Matrix Reports group data by rows and columns (e.g., rows by Close Month, columns by Opportunity Type), supporting dashboards, charts, and formulas. Use for multi-dimensional analysis. public class OpportunityMatrix { @AuraEnabled public static Map> getMatrixData() { Map> matrix = new Map>(); for (AggregateResult ar : [SELECT Close_Month__c, Type, SUM(Amount) total FROM Opportunity GROUP BY Close_Month__c, Type]) { String month = (String)ar.get('Close_Month__c'); String type = (String)ar.get('Type'); if (!matrix.containsKey(month)) matrix.put(month, new Map()); matrix.get(month).put(type, (Decimal)ar.get('total')); } return matrix; } } CTA Case Study: A retailer with 2M Opportunities needs a report comparing sales by product type and quarter. Design a Matrix Report versus Apex-driven dashboard, evaluating visualization and maintenance for a 3,000-user org.
44
What are the features of Joined Reports, and how do they support complex analysis? Provide an Apex alternative.
Joined Reports combine multiple report blocks (up to 5) with different report types, allowing a 360-degree view (e.g., Opportunities and Activities). Features include customizable filters per block but no dashboard support. Use for cross-object analysis. public class JoinedData { @AuraEnabled public static Map> getJoinedData() { Map> data = new Map>(); data.put('Opportunities', [SELECT Id, Name, Amount FROM Opportunity LIMIT 50]); data.put('Tasks', [SELECT Id, Subject, WhatId FROM Task WHERE WhatId IN :data.get('Opportunities') LIMIT 50]); return data; } } CTA Case Study: A healthcare provider with 1M Cases needs to combine Case and Patient data in one view. Propose a Joined Report versus Apex with LWC, addressing data complexity and performance for a 7,000-user org.
45
What are the capabilities of Custom Report Types, and when are they necessary? Provide an Apex data model example.
Custom Report Types define object relationships (up to 4 objects) and fields for reporting, supporting lookups and complex relationships. Use when standard report types lack required fields or objects. public class CustomReportData { @AuraEnabled public static List getAccountWithContacts() { return [SELECT Name, (SELECT LastName FROM Contacts) FROM Account WHERE Industry = 'Tech' LIMIT 100]; } } CTA Case Study: A consulting firm with 500,000 Accounts needs to report on Accounts, Contacts, and custom Project objects. Design a Custom Report Type versus Apex solution, justifying flexibility and admin effort for a 2,000-user org.
46
How do Cross Filters enhance reporting, and what are their key features? Provide an Apex equivalent for exception reporting.
Cross Filters allow filtering records with or without related records (e.g., Accounts without Activities). Features include sub-filters for precision. Use for exception reports. public class AccountWithoutActivities { @AuraEnabled public static List getAccountsNoActivity() { return [SELECT Id, Name FROM Account WHERE Id NOT IN (SELECT WhatId FROM Task WHERE CreatedDate = LAST_WEEK) LIMIT 100]; } } CTA Case Study: A bank with 1M Accounts needs to identify Accounts without recent interactions. Propose Cross Filters versus Apex, addressing scalability and real-time needs for a 4,000-user org.
47
What are the capabilities of Summary Formulas in reports, and when are they used? Provide an Apex alternative for calculations.
Summary Formulas perform calculations at summary levels (e.g., percentage of total pipeline). Features include complex math and conditional logic. Use for aggregated metrics. public class PipelineContribution { @AuraEnabled public static Map getPipelineShare() { Map shares = new Map(); Decimal total = [SELECT SUM(Amount) total FROM Opportunity][0].get('total'); for (AggregateResult ar : [SELECT Type, SUM(Amount) amt FROM Opportunity GROUP BY Type]) { shares.put((String)ar.get('Type'), ((Decimal)ar.get('amt') / total) * 100); } return shares; } } CTA Case Study: A tech firm with 300,000 Opportunities needs to calculate pipeline contribution by product. Design a Summary Formula versus Apex solution, evaluating accuracy and user access for a 6,000-user org.
48
What types of components can be added to Salesforce Dashboards, and what customization options exist? Provide an Apex data feed example.
Dashboard components include charts (pie, bar), tables, gauges, and metrics, sourced from reports (except Joined Reports). Customization includes filters, drag-and-drop layout, and rich text widgets. public class DashboardData { @AuraEnabled public static List getSalesByRegion() { return [SELECT Region__c, SUM(Amount) total FROM Opportunity GROUP BY Region__c LIMIT 10]; } } CTA Case Study: A logistics company with 500,000 Opportunities needs a real-time sales dashboard for 50 regions. Propose a Dashboard with components versus Apex-driven LWC, addressing visualization and mobile access for a 3,000-user org.
49
What are the features of Dynamic Dashboards, and how do they enhance user experience? Provide an Apex equivalent for role-based data.
Dynamic Dashboards display data based on the running user’s role or profile, reducing the need for multiple dashboards. Features include up to 100 components and role-based previews. public class DynamicData { @AuraEnabled public static List getUserOpportunities() { Id userId = UserInfo.getUserId(); return [SELECT Name, Amount FROM Opportunity WHERE OwnerId = :userId LIMIT 50]; } } CTA Case Study: A retail chain with 10,000 users needs personalized dashboards for 100 store managers. Design a Dynamic Dashboard versus Apex with LWC, justifying security and scalability for a global org.
50
What options are available for scheduling and sharing reports, and how do folder access levels work? Provide an Apex email solution.
Answer: Reports can be scheduled for automatic email delivery with customizable frequency and recipients. Folder access levels include Viewer (view only), Editor (modify), and Manager (full control). public class ReportEmailer { public static void sendReport(List opps) { Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); email.setToAddresses(new List{'manager@example.com'}); email.setSubject('Weekly Opportunity Report'); String body = 'Top Opportunities:\n'; for (Opportunity opp : opps) { body += opp.Name + ': $' + opp.Amount + '\n'; } email.setPlainTextBody(body); Messaging.sendEmail(new List{email}); } } CTA Case Study: A financial firm with 200,000 Opportunities needs weekly reports emailed to 500 stakeholders. Propose a scheduled report versus Apex email service, addressing customization and compliance for a 4,000-user org.
51
A sales team needs to create a Task from any screen in the Salesforce mobile app to log customer calls. What solution optimizes this? Provide an Apex action alternative.
Create a Global Quick Action (e.g., "Log Call") to create a Task, available across all objects in the mobile app. Add it to the Global Publisher Layout. Apex can provide a custom action for complex logic. public class LogCallAction { @InvocableMethod(label='Log Call' description='Logs a call as a Task') public static void logCall(List recordIds) { List tasks = new List(); for (Id recordId : recordIds) { tasks.add(new Task(Subject = 'Mobile Call Log', WhatId = recordId, ActivityDate = Date.today())); } insert tasks; } } CTA Case Study: A global sales org with 10,000 users needs a unified call logging system across 50 objects. Design a solution using Global Quick Actions versus Apex with LWC, justifying mobile usability, scalability, and offline support.
52
A field sales team needs to update Opportunity Stage directly from the mobile app with predefined values. What’s the best solution? Provide an Apex custom action.
Create an Object-Specific Quick Action on Opportunity to update the Stage field with a picklist. Add it to the Opportunity Page Layout and mobile Lightning page. Apex can handle custom stage transitions. public class UpdateOppStage { @InvocableMethod(label='Update Stage' description='Updates Opportunity Stage') public static void updateStage(List oppIds) { List opps = [SELECT Id, StageName FROM Opportunity WHERE Id IN :oppIds]; for (Opportunity opp : opps) { opp.StageName = 'Negotiation/Review'; } update opps; } } CTA Case Study: A manufacturing firm with 200,000 Opportunities needs mobile stage updates for 5,000 field reps. Propose Object-Specific Actions versus Apex, addressing performance, validation rules, and mobile navigation for a 7,000-user org.
53
A service team needs to view key Case details (Case Number, Priority, Status) on the mobile app’s record highlights. How can this be achieved? Provide an Apex data retrieval alternative.
Configure a Compact Layout for the Case object with Case Number, Priority, and Status, and assign it to the Case record type or profile. Apex can fetch key fields for custom mobile UI. public class CaseHighlights { @AuraEnabled(cacheable=true) public static Case getCaseDetails(Id caseId) { return [SELECT CaseNumber, Priority, Status FROM Case WHERE Id = :caseId LIMIT 1]; } } CTA Case Study: A telecom with 1M Cases needs optimized mobile views for 3,000 agents. Design a solution using Compact Layouts versus Apex with LWC, evaluating load times, offline access, and user adoption for a global org.
54
A sales team needs a mobile-optimized Opportunity page with key fields and actions at the top. What’s the best approach? Provide an Apex component controller.
Create a Lightning Record Page for Opportunity, optimized for mobile, using the Lightning App Builder. Prioritize fields and actions in a single-column layout. Apex can support custom components. public class OpportunityMobileController { @AuraEnabled(cacheable=true) public static Opportunity getKeyFields(Id oppId) { return [SELECT Name, Amount, CloseDate FROM Opportunity WHERE Id = :oppId LIMIT 1]; } } CTA Case Study: A retail chain with 500,000 Opportunities needs mobile-optimized pages for 4,000 reps. Propose Lightning Pages versus Apex-driven LWC pages, addressing customization, performance, and scalability for a 6,000-user org.
55
A support team needs Case actions to appear only when Status is "Open" in the mobile app. How can this be implemented? Provide an Apex dynamic action alternative.
Use Dynamic Actions on the Case Lightning Record Page to show actions (e.g., "Escalate") based on Status = "Open." Apex can enforce dynamic logic programmatically. public class CaseDynamicAction { @AuraEnabled public static Boolean canEscalate(Id caseId) { Case c = [SELECT Status FROM Case WHERE Id = :caseId LIMIT 1]; return c.Status == 'Open'; } } CTA Case Study: A healthcare provider with 2M Cases needs dynamic mobile actions for 5,000 agents. Design a solution using Dynamic Actions versus Apex with LWC, justifying flexibility, user experience, and maintenance for a 10,000-user org.
56
A field team needs to create Notes from any mobile screen for quick customer feedback. What solution optimizes this? Provide an Apex note creation alternative.
Create a Global Quick Action to create a Note, added to the Global Publisher Layout. Ensure Notes are enabled for mobile. Apex can handle custom note creation. public class CreateNote { @InvocableMethod(label='Create Note' description='Creates a Note') public static void createNote(List recordIds) { List notes = new List(); for (Id recordId : recordIds) { ContentNote note = new ContentNote(Title = 'Mobile Feedback', Content = Blob.valueOf('Customer feedback')); notes.add(note); } insert notes; } } CTA Case Study: A logistics firm with 300,000 records needs a mobile note-taking system for 2,000 drivers. Propose Global Actions versus Apex, addressing offline capabilities and data volume for a 4,000-user org.
57
A sales team needs to create Contacts from Account records in the mobile app with prefilled fields. What’s the best solution? Provide an Apex create action.
Create an Object-Specific Quick Action on Account to create a Contact with prefilled fields (e.g., AccountId). Add to the mobile Lightning page. Apex can automate creation. public class CreateContact { @InvocableMethod(label='Create Contact' description='Creates a Contact from Account') public static void createContact(List accountIds) { List contacts = new List(); for (Id accId : accountIds) { contacts.add(new Contact(AccountId = accId, LastName = 'New Contact')); } insert contacts; } } CTA Case Study: A B2B firm with 100,000 Accounts needs mobile Contact creation for 3,000 reps. Design a solution using Quick Actions versus Apex, evaluating prefill accuracy and user training for a 5,000-user org.
58
A field team needs a mobile view of recent Opportunities on the Home page. How can this be achieved? Provide an Apex data feed for a custom component.
Add a Mobile Card Component to the Mobile Home Page via Lightning App Builder, displaying a report or list view of recent Opportunities. Apex can feed data to a custom LWC. public class RecentOpportunities { @AuraEnabled(cacheable=true) public static List getRecentOpps() { return [SELECT Name, Amount, CloseDate FROM Opportunity ORDER BY CreatedDate DESC LIMIT 5]; } } CTA Case Study: A tech firm with 400,000 Opportunities needs a mobile Home page for 6,000 users. Propose Mobile Card Components versus Apex with LWC, addressing performance, customization, and offline access for a global org.
59
A service team needs to update Case Priority from the mobile app with a single tap. What’s the best approach? Provide an Apex update action.
Create an Object-Specific Quick Action on Case to update Priority with a picklist. Add to the mobile Lightning page. Apex can handle complex updates. public class UpdateCasePriority { @InvocableMethod(label='Update Priority' description='Updates Case Priority') public static void updatePriority(List caseIds) { List cases = [SELECT Id, Priority FROM Case WHERE Id IN :caseIds]; for (Case c : cases) { c.Priority = 'High'; } update cases; } } CTA Case Study: A utility company with 1.5M Cases needs mobile priority updates for 4,000 agents. Design a solution using Quick Actions versus Apex, justifying validation enforcement and mobile performance for an 8,000-user org.
60
A field sales team needs to log Tasks offline in the mobile app. How can this be optimized? Provide an Apex sync solution for online updates.
Use Salesforce Mobile App’s offline capabilities with Global Quick Actions for Task creation, syncing when online. Apex can handle custom sync logic. public class OfflineTaskSync { @InvocableMethod(label='Sync Tasks' description='Syncs offline Tasks') public static void syncTasks(List taskIds) { List tasks = [SELECT Id, Subject, Status FROM Task WHERE Id IN :taskIds]; for (Task t : tasks) { t.Status = 'Completed'; } update tasks; } } CTA Case Study: A mining company with 200,000 Tasks needs offline mobile support for 2,000 remote workers. Propose offline Quick Actions versus Apex with LWC, addressing sync reliability, data conflicts, and security for a 3,000-user org.
61
How can an app builder enable Chatter feed tracking for specific Opportunity fields to enhance sales collaboration? Provide an Apex solution for custom feed posts.
Enable Chatter feed tracking for the Opportunity object and select fields like StageName and Amount in Setup. This posts updates to the record feed when these fields change. Apex can create custom feed posts for complex updates. public class OpportunityFeed { public static void postStageUpdate(List opps) { List posts = new List(); for (Opportunity opp : opps) { FeedItem post = new FeedItem(); post.ParentId = opp.Id; post.Body = 'Opportunity stage updated to ' + opp.StageName; post.Type = 'TextPost'; posts.add(post); } insert posts; } } CTA Case Study: A global sales org with 500,000 Opportunities needs to track stage changes across 10 regions for real-time collaboration. Design a solution using feed tracking versus Apex-driven posts, justifying scalability, user engagement, and mobile access for a 7,000-user org.
62
How can Chatter Groups be customized to support project teams, and what are key use cases? Provide an Apex solution for group notifications.
Create Chatter Groups (public, private, or unlisted) with custom settings like announcements and file sharing. Use cases include project collaboration, knowledge sharing, and cross-department coordination. Apex can automate group notifications. public class GroupNotification { public static void notifyGroup(String groupId, String message) { FeedItem post = new FeedItem(); post.ParentId = groupId; post.Body = message; post.Type = 'TextPost'; insert post; } } CTA Case Study: A consulting firm with 1,000 project teams needs Chatter Groups for secure collaboration across 50 clients. Propose a group-based solution versus Apex with custom objects, addressing security, scalability, and external user access for a 5,000-user org.
63
How can custom Chatter Actions enhance record-level collaboration on Cases? Provide an Apex-backed custom action.
Create Object-Specific Chatter Actions (e.g., "Request Expert") on the Case object to post to the feed or trigger processes. Use cases include escalating issues or requesting input. Apex can power complex actions. public class CaseExpertRequest { @InvocableMethod(label='Request Expert' description='Posts expert request to Case feed') public static void requestExpert(List caseIds) { List posts = new List(); for (Id caseId : caseIds) { FeedItem post = new FeedItem(ParentId = caseId, Body = 'Expert needed for case resolution!', Type = 'TextPost'); posts.add(post); } insert posts; } } CTA Case Study: A telecom with 2M Cases needs a mobile-friendly escalation process via Chatter. Design a solution using custom Chatter Actions versus Apex with Flows, evaluating usability, automation, and performance for a 10,000-user org.
64
How can Process Builder integrate with Chatter to automate collaboration on high-value Opportunities? Provide an Apex alternative.
Use Process Builder to post to the Opportunity feed or a Chatter Group when criteria (e.g., Amount > $1M) are met. Use cases include alerting teams or logging milestones. Apex offers programmatic control. public class HighValueOppAlert { public static void postHighValueAlert(List opps) { List posts = new List(); for (Opportunity opp : opps) { if (opp.Amount > 1000000) { FeedItem post = new FeedItem(ParentId = opp.Id, Body = 'High-value Opportunity: $' + opp.Amount, Type = 'TextPost'); posts.add(post); } } insert posts; } } CTA Case Study: A financial firm with 300,000 Opportunities needs automated alerts for deals over $1M. Propose a Process Builder solution versus Apex, addressing governor limits, auditability, and mobile notifications for a 6,000-user org.
65
How can Chatter Topics be customized to organize discussions around product launches? Provide an Apex solution for topic assignment.
Enable Topics in Setup and assign them manually or via automation to categorize posts (e.g., #NewProduct). Use cases include knowledge management and trend analysis. Apex can automate topic assignments. public class TopicAssignment { public static void assignProductTopic(List posts) { List assignments = new List(); Id topicId = [SELECT Id FROM Topic WHERE Name = 'NewProduct' LIMIT 1].Id; for (FeedItem post : posts) { if (post.Body.contains('launch')) { assignments.add(new TopicAssignment(TopicId = topicId, EntityId = post.Id)); } } insert assignments; } } CTA Case Study: A tech company launching 100 products annually needs to organize Chatter discussions for 5,000 employees. Design a Topics-based solution versus Apex with custom metadata, justifying searchability and scalability for a global org.
66
How can Publisher Actions in Chatter streamline task creation from Account feeds? Provide an Apex-backed action.
Create an Object-Specific Publisher Action on Account to create a Task from the Chatter feed. Use cases include quick follow-ups or action assignments. Apex can enhance action logic. public class CreateTaskFromFeed { @InvocableMethod(label='Create Task' description='Creates Task from Account feed') public static void createTask(List accountIds) { List tasks = new List(); for (Id accId : accountIds) { tasks.add(new Task(WhatId = accId, Subject = 'Follow Up', ActivityDate = Date.today().addDays(3))); } insert tasks; } } CTA Case Study: A retail chain with 200,000 Accounts needs mobile task creation for 4,000 reps. Propose Publisher Actions versus Apex with LWC, addressing usability, offline support, and performance for a 5,000-user org.
67
How can Chatter Feed Components be customized in Lightning Pages to enhance mobile collaboration? Provide an Apex data feed.
Add the Chatter Feed Component to a Lightning Record Page, customizing visibility or filters. Use cases include mobile record collaboration. Apex can feed custom data to a component. public class CustomFeedData { @AuraEnabled(cacheable=true) public static List getRecentPosts(Id recordId) { return [SELECT Id, Body, CreatedBy.Name FROM FeedItem WHERE ParentId = :recordId ORDER BY CreatedDate DESC LIMIT 10]; } } CTA Case Study: A logistics firm with 500,000 records needs mobile Chatter feeds for 3,000 drivers. Design a Lightning Page solution versus Apex-driven LWC feeds, evaluating load times, customization, and offline access for a 4,000-user org.
68
How can Chatter be customized for external users in Communities to collaborate on Cases? Provide an Apex solution for external posts.
Enable Chatter in Experience Cloud, allowing external users to post in groups or record feeds with sharing controls. Use cases include partner or customer collaboration. Apex can manage external posts. public class ExternalCasePost { public static void postToCommunity(List cases) { List posts = new List(); for (Case c : cases) { FeedItem post = new FeedItem(ParentId = c.Id, Body = 'Update for external review: ' + c.Subject, Visibility = 'AllUsers'); posts.add(post); } insert posts; } } CTA Case Study: A healthcare provider with 1M Cases needs secure Chatter collaboration with 10,000 external partners. Propose a Community-based solution versus Apex, addressing licensing, security, and scalability for a 7,000-user org.
69
How can Chatter Recommendations be customized to suggest relevant groups or users? Provide an Apex recommendation engine.
Configure Recommendation Strategies in Setup to suggest groups or users based on record or user activity. Use cases include onboarding or team alignment. Apex can drive custom recommendations. public class GroupRecommendation { @AuraEnabled public static List suggestGroups(Id userId) { return [SELECT Id, Name FROM CollaborationGroup WHERE Industry__c = :[SELECT Industry FROM User WHERE Id = :userId].Industry LIMIT 5]; } } CTA Case Study: A tech firm with 5,000 employees needs personalized group suggestions for 200 teams. Design a Recommendation Strategy versus Apex with LWC, justifying accuracy, adoption, and performance for a global org.
70
How can Chatter Polls be used to gather team feedback, and what customizations are available? Provide an Apex poll creation solution.
Create Polls in Chatter feeds or groups to collect feedback with customizable options. Use cases include team surveys or decision-making. Apex can automate poll creation. public class CreatePoll { public static void createFeedbackPoll(String groupId) { FeedItem poll = new FeedItem(); poll.ParentId = groupId; poll.Type = 'QuestionPost'; poll.Body = 'How effective is our new process?'; poll.FeedPollChoices = new List{ new FeedPollChoice(ChoiceBody = 'Very Effective'), new FeedPollChoice(ChoiceBody = 'Needs Improvement') }; insert poll; } } CTA Case Study: A bank with 10,000 employees needs to collect feedback via Chatter Polls for 50 initiatives. Propose a Polls-based solution versus Apex-driven surveys, addressing response tracking, analytics, and mobile usability for a 3,000-user org.
71
A company needs to track customer support Cases with associated customer Contacts and their Accounts. Cases should roll up metrics (e.g., total cases) to Accounts. What data model is best? Provide an Apex validation.
Use standard Case, Contact, and Account objects. Create a Master-Detail relationship from Case to Account for roll-up summaries. Lookup from Case to Contact for flexibility. public class CaseValidation { public static void validateCase(List cases) { for (Case c : cases) { if (c.AccountId == null) { c.addError('Case must be associated with an Account.'); } } } } CTA Case Study: A telecom with 5M Cases annually needs a scalable case management system for 10,000 agents. Design a data model using standard objects versus custom objects, justifying roll-up capabilities, reporting, and performance for a 15,000-user org.
72
A consulting firm needs to track Projects, associated Tasks, and assigned Employees. Tasks should be tied to one Project, and Employees can work on multiple Tasks. What data model fits? Provide an Apex task counter.
Create custom objects: Project__c (master), Task__c (detail via Master-Detail to Project__c), and Employee__c. Use a Junction Object (Task_Assignment__c) for many-to-many between Task__c and Employee__c. public class TaskCounter { public static void updateTaskCount(List projects) { for (Project__c proj : [SELECT Id, (SELECT Id FROM Tasks__r) FROM Project__c WHERE Id IN :projects]) { proj.Task_Count__c = proj.Tasks__r.size(); update proj; } } } CTA Case Study: A firm with 10,000 Projects and 50,000 Tasks needs a project management system for 2,000 employees. Propose a custom object model versus AppExchange apps, addressing scalability, data volume, and mobile access for a 3,000-user org.
73
An e-commerce company needs to track Orders, Products, and Order Line Items. Each Order can have multiple Products, and Products can be in multiple Orders. What data model is appropriate? Provide an Apex price calculator.
Use standard Order and Product2 objects. Create a Junction Object (OrderItem) with Master-Detail to Order and Lookup to Product2 for many-to-many relationships. public class OrderPriceCalculator { public static void calculateTotalPrice(List items) { for (OrderItem item : items) { Product2 prod = [SELECT UnitPrice FROM Product2 WHERE Id = :item.Product2Id]; item.TotalPrice = prod.UnitPrice * item.Quantity; } update items; } } CTA Case Study: A retailer with 1M Orders annually needs an order management system for 5,000 users. Design a data model using standard objects versus custom objects, evaluating integration with external ERP systems and reporting needs for a global org.
74
A company hosts Events and needs to track Attendees (Contacts) with registration details. Each Event can have multiple Attendees, and Contacts can attend multiple Events. What data model is best? Provide an Apex registration validator.
Use standard Contact object and a custom Event__c object. Create a Junction Object (Registration__c) with Lookup relationships to Event__c and Contact for many-to-many. public class RegistrationValidator { public static void preventDuplicateRegistration(List registrations) { for (Registration__c reg : registrations) { List existing = [SELECT Id FROM Registration__c WHERE Event__c = :reg.Event__c AND Contact__c = :reg.Contact__c]; if (!existing.isEmpty()) { reg.addError('Contact already registered for this Event.'); } } } } CTA Case Study: An event management firm with 10,000 Events annually needs a registration system for 500,000 Attendees. Propose a data model versus AppExchange solutions, addressing data integrity, scalability, and external integrations for a 2,000-user org.
75
A manufacturing company needs to track Assets, their Maintenance Records, and Technicians. Each Asset has multiple Maintenance Records, and Technicians can service multiple Assets. What data model fits? Provide an Apex maintenance scheduler.
Use standard Asset object and custom objects: Maintenance_Record__c (Master-Detail to Asset) and Technician__c. Create a Junction Object (Maintenance_Assignment__c) for many-to-many between Maintenance_Record__c and Technician__c. public class MaintenanceScheduler { public static void scheduleMaintenance(List assets) { List records = new List(); for (Asset a : assets) { records.add(new Maintenance_Record__c(Asset__c = a.Id, Scheduled_Date__c = Date.today().addMonths(6))); } insert records; } } CTA Case Study: A manufacturer with 100,000 Assets needs a maintenance tracking system for 1,000 technicians. Design a data model using standard and custom objects, justifying field types, automation, and mobile support for a 4,000-user org.
76
A hospital needs to track Patients, their Appointments, and Doctors. Each Patient can have multiple Appointments, and Doctors can handle multiple Appointments. What data model is appropriate? Provide an Apex appointment counter.
Use standard Contact for Patients and custom objects: Appointment__c (Lookup to Contact) and Doctor__c. Create a Junction Object (Appointment_Assignment__c) for many-to-many between Appointment__c and Doctor__c. public class AppointmentCounter { public static void updateAppointmentCount(List patients) { for (Contact p : [SELECT Id, (SELECT Id FROM Appointments__r) FROM Contact WHERE Id IN :patients]) { p.Appointment_Count__c = p.Appointments__r.size(); update p; } } } A hospital network with 1M Patients needs a HIPAA-compliant patient record system for 10,000 staff. Propose a data model versus Health Cloud, addressing security, reporting, and scalability for a 12,000-user org.
77
A warehouse needs to track Inventory Items, Warehouses, and Stock Levels. Each Item can be in multiple Warehouses, and Warehouses can store multiple Items. What data model is best? Provide an Apex stock updater.
Create custom objects: Item__c, Warehouse__c, and a Junction Object (Stock_Level__c) with Master-Detail to Item__c and Warehouse__c for many-to-many relationships. public class StockUpdater { public static void updateStock(List stocks) { for (Stock_Level__c stock : stocks) { if (stock.Quantity__c < 0) { stock.addError('Stock quantity cannot be negative.'); } } } } CTA Case Study: A logistics firm with 500,000 Items across 100 Warehouses needs an inventory system for 3,000 users. Design a data model versus AppExchange apps, evaluating real-time updates, integrations, and performance for a global org.
78
A company needs to track Employees, Training Courses, and Certifications. Employees can earn multiple Certifications, and Courses can lead to multiple Certifications. What data model fits? Provide an Apex certification tracker.
Use standard User for Employees and custom objects: Course__c, Certification__c. Create a Junction Object (Employee_Certification__c) for many-to-many between User and Certification__c, and Lookup from Certification__c to Course__c. public class CertificationTracker { public static void trackCertifications(List certs) { for (Employee_Certification__c cert : certs) { Certification__c c = [SELECT Expiry_Date__c FROM Certification__c WHERE Id = :cert.Certification__c]; if (c.Expiry_Date__c < Date.today()) { cert.addError('Certification is expired.'); } } } } CTA Case Study: A tech firm with 20,000 Employees and 1,000 Courses needs a training system for compliance. Propose a data model versus custom objects with Learning Management apps, addressing reporting, scalability, and user access for a 5,000-user org.
79
A company needs to access external ERP Product data in Salesforce without duplicating records. Products are linked to Opportunities. What data model is appropriate? Provide an Apex external data query.
Use Salesforce Connect with External Objects (e.g., External_Product__x) to access ERP data via OData. Create a Lookup from Opportunity to External_Product__x. public class ExternalProductQuery { @AuraEnabled public static List getProducts() { return [SELECT ExternalId, Name, Price__c FROM External_Product__x WHERE Available__c = true LIMIT 100]; } } CTA Case Study: A retailer with 1M Opportunities and 500,000 external Products needs real-time ERP integration. Propose a Salesforce Connect model versus custom objects with Apex callouts, justifying performance, cost, and security for a 6,000-user org.
80
A company needs to track Partners, their Contracts, and related Opportunities. Each Partner can have multiple Contracts, and Contracts can link to multiple Opportunities. What data model is best? Provide an Apex contract validator.
Use standard Account for Partners, custom Contract__c (Lookup to Account), and standard Opportunity. Create a Junction Object (Contract_Opportunity__c) for many-to-many between Contract__c and Opportunity. public class ContractValidator { public static void validateContract(List contracts) { for (Contract__c c : contracts) { if (c.Start_Date__c > c.End_Date__c) { c.addError('Contract start date cannot be after end date.'); } } } } CTA Case Study: A tech firm with 10,000 Partners and 100,000 Opportunities needs a PRM system for 2,000 users. Design a data model versus Partner Community solutions, addressing sharing, scalability, and external access for a 4,000-user org.
81
A company needs to assign Cases to Accounts but allow Cases to exist without an Account. How does a Lookup relationship support this, and what are the implications? Provide an Apex data retrieval snippet.
A Lookup relationship from Case to Account allows optional association (no dependency). Record Access: Independent ownership; sharing determined by OWD and manual rules. User Interface: Displays as a related list on Account; editable lookup field on Case. Reporting: Supports standard report types but no roll-up summaries. public class CaseAccountQuery { @AuraEnabled(cacheable=true) public static List getCasesByAccount(Id accountId) { return [SELECT Id, CaseNumber, Account.Name FROM Case WHERE AccountId = :accountId LIMIT 100]; } } CTA Case Study: A telecom with 2M Cases needs flexible Case-to-Account assignments across 50 regions. Design a Lookup-based model versus Master-Detail, justifying impacts on sharing, UI flexibility, and reporting scalability for a 10,000-user org.
82
An e-commerce company tracks Orders and Order Line Items, where Line Items depend on Orders. How does a Master-Detail relationship fit, and what are the implications? Provide an Apex roll-up trigger.
A Master-Detail relationship from OrderItem__c to Order__c enforces dependency. Record Access: Line Items inherit Order’s sharing and ownership; deleted if Order is deleted. User Interface: Line Items appear in a related list; restricted field edits. Reporting: Enables roll-up summaries (e.g., total amount) and custom report types. trigger OrderTotal on OrderItem__c (after insert, after update, after delete) { Set orderIds = new Set(); if (Trigger.isInsert || Trigger.isUpdate) { for (OrderItem__c item : Trigger.new) orderIds.add(item.Order__c); } else { for (OrderItem__c item : Trigger.old) orderIds.add(item.Order__c); } List orders = [SELECT Id, Total_Amount__c, (SELECT TotalPrice__c FROM OrderItems__r) FROM Order__c WHERE Id IN :orderIds]; for (Order__c ord : orders) { ord.Total_Amount__c = 0; for (OrderItem__c item : ord.OrderItems__r) ord.Total_Amount__c += item.TotalPrice__c; update orders; } } CTA Case Study: A retailer with 1M Orders needs a robust order management system for 5,000 users. Propose a Master-Detail model versus Lookup, evaluating ownership, UI constraints, and reporting needs for a global org.
83
A firm assigns Employees to multiple Projects, and Projects have multiple Employees. How does a Many-to-Many relationship work, and what are the implications? Provide an Apex assignment validator.
Create a Junction Object (Project_Assignment__c) with two Master-Detail relationships to Project__c and Employee__c. Record Access: Junction inherits sharing from both masters; complex sharing rules needed. User Interface: Related lists on both objects; custom UI for assignments. Reporting: Requires custom report types to join Project, Employee, and Junction data. public class AssignmentValidator { public static void preventDuplicateAssignment(List assignments) { for (Project_Assignment__c pa : assignments) { List existing = [SELECT Id FROM Project_Assignment__c WHERE Project__c = :pa.Project__c AND Employee__c = :pa.Employee__c]; if (!existing.isEmpty()) { pa.addError('Employee already assigned to this Project.'); } } } } CTA Case Study: A consulting firm with 10,000 Projects and 2,000 Employees needs a scalable assignment system. Design a Many-to-Many model versus custom objects, addressing sharing complexity, UI usability, and reporting for a 3,000-user org.
84
A company tracks Employee reporting structures (e.g., Manager to Employee). How does a Hierarchical relationship support this, and what are the implications? Provide an Apex hierarchy query.
Use a Hierarchical relationship on User (e.g., Manager field) for self-referential linking. Record Access: No direct impact; sharing controlled by Role Hierarchy. User Interface: Displays as a lookup field; limited to User object. Reporting: Limited to User-based reports; no roll-up summaries. public class EmployeeHierarchy { @AuraEnabled(cacheable=true) public static List getTeamMembers(Id managerId) { return [SELECT Id, Name FROM User WHERE ManagerId = :managerId LIMIT 50]; } } CTA Case Study: A corporation with 20,000 Employees needs a reporting structure for performance reviews. Propose a Hierarchical model versus custom objects, justifying UI simplicity, access control, and reporting limitations for a 5,000-user org.
85
A company integrates external ERP Products with Opportunities in Salesforce. How does an External Lookup relationship help, and what are the implications? Provide an Apex external data query.
An External Lookup from Opportunity to External_Product__x (via Salesforce Connect) links to external ERP data. Record Access: No ownership; access controlled by external system and user permissions. User Interface: Appears as a lookup field; read-only unless configured otherwise. Reporting: Limited to custom report types; no roll-up summaries. public class ExternalProductQuery { @AuraEnabled(cacheable=true) public static List getExternalProducts() { return [SELECT ExternalId, Name__c, Price__c FROM External_Product__x WHERE Available__c = true LIMIT 50]; } } CTA Case Study: A retailer with 1M Opportunities and 500,000 external Products needs real-time ERP integration. Design an External Lookup model versus custom objects, evaluating performance, UI integration, and reporting for a 6,000-user org.
86
A company links Opportunities to Partner Accounts using an external ID. How does an Indirect Lookup relationship work, and what are the implications? Provide an Apex data linker.
An Indirect Lookup from Opportunity to Account uses a custom field (e.g., Partner_Code__c) matching an external ID on Account. Record Access: Independent sharing; no ownership dependency. User Interface: Displays as a lookup field; requires external ID mapping. Reporting: Supports custom report types but no roll-up summaries. public class PartnerLinker { public static void linkPartners(List opps) { for (Opportunity opp : opps) { Account partner = [SELECT Id FROM Account WHERE Partner_Code__c = :opp.Partner_Code__c LIMIT 1]; opp.Partner_Account__c = partner?.Id; } update opps; } } CTA Case Study: A tech firm with 100,000 Opportunities and 10,000 Partners needs a partner linking system. Propose an Indirect Lookup versus Lookup, justifying data integrity, UI setup, and reporting for a 4,000-user org.
87
A company tracks Contracts linked to Accounts, with Contracts able to exist independently. How does a Lookup relationship support this, and what are the implications? Provide an Apex contract query.
A Lookup from Contract__c to Account allows independent existence. Record Access: Separate ownership; sharing via OWD or rules. User Interface: Related list on Account; editable lookup on Contract__c. Reporting: Custom report types; no roll-up summaries. public class ContractQuery { @AuraEnabled(cacheable=true) public static List getContractsByAccount(Id accountId) { return [SELECT Id, Name, Start_Date__c FROM Contract__c WHERE Account__c = :accountId LIMIT 50]; } } CTA Case Study: A legal firm with 50,000 Contracts needs a flexible contract system for 2,000 users. Design a Lookup-based model versus Master-Detail, evaluating sharing flexibility, UI design, and reporting for a 3,000-user org.
88
A company tracks Assets and their Maintenance Records, where Records depend on Assets. How does a Master-Detail relationship fit, and what are the implications? Provide an Apex roll-up calculator.
A Master-Detail from Maintenance_Record__c to Asset enforces dependency. Record Access: Records inherit Asset’s sharing; deleted with Asset. User Interface: Related list on Asset; restricted field edits. Reporting: Roll-up summaries for metrics like total maintenance cost. trigger MaintenanceCostRollup on Maintenance_Record__c (after insert, after update, after delete) { Set assetIds = new Set(); if (Trigger.isInsert || Trigger.isUpdate) { for (Maintenance_Record__c rec : Trigger.new) assetIds.add(rec.Asset__c); } else { for (Maintenance_Record__c rec : Trigger.old) assetIds.add(rec.Asset__c); } List assets = [SELECT Id, Total_Maintenance_Cost__c, (SELECT Cost__c FROM Maintenance_Records__r) FROM Asset WHERE Id IN :assetIds]; for (Asset a : assets) { a.Total_Maintenance_Cost__c = 0; for (Maintenance_Record__c rec : a.Maintenance_Records__r) a.Total_Maintenance_Cost__c += rec.Cost__c; update assets; } } CTA Case Study: A manufacturer with 200,000 Assets needs a maintenance tracking system for 1,000 technicians. Propose a Master-Detail versus Lookup, addressing ownership, UI constraints, and reporting for a 5,000-user org.
89
A training company tracks Students and Courses, with Students attending multiple Courses and Courses having multiple Students. How does a Many-to-Many relationship work, and what are the implications? Provide an Apex enrollment manager.
Create a Junction Object (Enrollment__c) with two Master-Detail relationships to Student__c and Course__c. Record Access: Junction inherits sharing from both masters; requires careful sharing rules. User Interface: Related lists on Student__c and Course__c; custom enrollment UI. Reporting: Custom report types for joined data analysis. public class EnrollmentManager { public static void manageEnrollments(List enrollments) { for (Enrollment__c e : enrollments) { Integer count = [SELECT COUNT() FROM Enrollment__c WHERE Course__c = :e.Course__c]; if (count >= 30) { e.addError('Course is at full capacity.'); } } } } CTA Case Study: An education provider with 50,000 Students and 1,000 Courses needs an enrollment system. Design a Many-to-Many model versus custom objects, justifying sharing, UI usability, and reporting for a 2,000-user org.
90
A company links external survey data to Accounts in Salesforce. How does an External Lookup relationship support this, and what are the implications? Provide an Apex survey data fetcher.
An External Lookup from Feedback__c to Account__x (via Salesforce Connect) links to external survey data. Record Access: No ownership; access via external system permissions. User Interface: Lookup field on Feedback__c; read-only unless configured. Reporting: Custom report types; no roll-up summaries. public class SurveyDataFetcher { @AuraEnabled(cacheable=true) public static List getSurveyedAccounts() { return [SELECT ExternalId, Name__c, Survey_Score__c FROM Account__x WHERE Surveyed__c = true LIMIT 50]; } } CTA Case Study: A service firm with 300,000 Accounts needs to integrate external survey data for 5,000 users. Propose an External Lookup versus custom objects with Apex callouts, evaluating performance, UI integration, and reporting for a 4,000-user org.
91
A company needs to store unique Customer IDs on Accounts. What considerations apply when selecting a Text data type, and what happens if changed to Number? Provide an Apex validation snippet.
Text Selection Considerations: Text supports alphanumeric IDs, allows duplicates unless unique, and is suitable for external system keys. No numerical operations. Change to Number Implications: Loses non-numeric data, breaks integrations, and affects filters/reports. Data validation needed before conversion. public class CustomerIDValidator { public static void validateCustomerID(List accounts) { for (Account acc : accounts) { if (acc.Customer_ID__c != null && !Pattern.matches('[A-Za-z0-9]{8}', acc.Customer_ID__c)) { acc.addError('Customer ID must be 8 alphanumeric characters.'); } } } } CTA Case Study: A retailer with 1M Accounts needs to standardize Customer IDs for 5,000 users. Design a solution using Text versus Auto Number, justifying data integrity, integration, and reporting impacts for a global org.
92
A sales team needs to track Opportunity Stages with predefined values. What considerations apply when selecting a Picklist, and what happens if changed to Text? Provide an Apex picklist handler.
Picklist Selection Considerations: Enforces controlled values, supports reporting (grouping), and integrates with automation. Requires maintenance for value changes. Change to Text Implications: Loses value restrictions, breaks validation rules, and affects reports/dashboards. Data cleanup required. public class StageHandler { @AuraEnabled(cacheable=true) public static List getValidStages() { List stages = new List(); for (Schema.PicklistEntry pe : Opportunity.StageName.getDescribe().getPicklistValues()) { if (pe.isActive()) stages.add(pe.getValue()); } return stages; } } CTA Case Study: A tech firm with 500,000 Opportunities needs a consistent Stage field for 3,000 reps. Propose Picklist versus Text, evaluating governance, UI usability, and reporting accuracy for a 7,000-user org.
93
An e-commerce company tracks Order Quantities. What considerations apply when selecting a Number data type, and what happens if changed to Currency? Provide an Apex quantity calculator.
Number Selection Considerations: Supports integers/decimals, enables math operations, and suits reporting. No currency formatting. Change to Currency Implications: Adds currency formatting, aligns with multi-currency, but may require data migration for existing values. public class QuantityCalculator { public static void calculateTotalQuantity(List orders) { for (Order__c ord : orders) { if (ord.Quantity__c < 0) { ord.addError('Quantity cannot be negative.'); } ord.Total_Items__c = ord.Quantity__c * ord.Units_Per_Item__c; } } } CTA Case Study: A retailer with 2M Orders needs a reliable Quantity field for 4,000 users. Design a solution using Number versus Currency, addressing calculations, multi-currency support, and performance for a global org.
94
A company tracks Contract Start Dates. What considerations apply when selecting a Date data type, and what happens if changed to Date/Time? Provide an Apex date validator.
Date Selection Considerations: Stores dates without time, supports date math, and is ideal for reporting. Simple UI input. Change to Date/Time Implications: Adds time component, may break existing logic/reports, and requires data migration to set time values. public class ContractDateValidator { public static void validateStartDate(List contracts) { for (Contract__c c : contracts) { if (c.Start_Date__c > c.End_Date__c) { c.addError('Start Date cannot be after End Date.'); } } } } CTA Case Study: A legal firm with 100,000 Contracts needs accurate Start Dates for 2,000 users. Propose Date versus Date/Time, justifying UI simplicity, reporting needs, and automation impacts for a 3,000-user org.
95
A sales team needs a calculated Opportunity Score based on Amount and Probability. What considerations apply when selecting a Formula data type, and what happens if changed to Number? Provide an Apex formula alternative.
Formula Selection Considerations: Auto-calculates values, read-only, and supports reporting. No storage used. Change to Number Implications: Requires manual updates, consumes storage, and breaks automation relying on dynamic calculations. public class OpportunityScore { public static void calculateScore(List opps) { for (Opportunity opp : opps) { opp.Score__c = (opp.Amount * opp.Probability) / 100; } update opps; } } CTA Case Study: A tech firm with 300,000 Opportunities needs dynamic scoring for 5,000 reps. Design a Formula versus Number with Apex, evaluating maintenance, performance, and dashboard integration for a 6,000-user org.
96
A company tracks Approval Status on Cases. What considerations apply when selecting a Checkbox data type, and what happens if changed to Picklist? Provide an Apex status checker.
Checkbox Selection Considerations: Simple true/false values, ideal for binary states, and supports filters/reports. Minimal storage. Change to Picklist Implications: Allows multiple values, requires data migration, and may complicate automation/UI. public class ApprovalChecker { public static void checkApproval(List cases) { for (Case c : cases) { if (c.Is_Approved__c && c.Status != 'Closed') { c.addError('Approved Cases must be Closed.'); } } } } CTA Case Study: A healthcare provider with 1M Cases needs a reliable Approval Status for 4,000 agents. Propose Checkbox versus Picklist, addressing UI clarity, reporting simplicity, and automation for an 8,000-user org.
97
A retailer needs to store formatted Product Descriptions. What considerations apply when selecting a Rich Text Area, and what happens if changed to Text Area? Provide an Apex formatting validator.
Rich Text Selection Considerations: Supports HTML formatting, images, and styling, ideal for rich content. Larger storage (32KB). Change to Text Area Implications: Loses formatting, reduces storage (4KB), and affects UI display/reports. public class DescriptionValidator { public static void validateDescription(List products) { for (Product__c p : products) { if (p.Description__c != null && p.Description__c.length() > 32000) { p.addError('Description exceeds maximum length.'); } } } } CTA Case Study: A retailer with 500,000 Products needs rich Descriptions for 3,000 users. Design a Rich Text versus Text Area solution, justifying UI presentation, storage, and mobile display for a global org.
98
A support team needs unique Case Numbers. What considerations apply when selecting an Auto Number data type, and what happens if changed to Text? Provide an Apex number generator alternative.
Auto Number Selection Considerations: Generates sequential, read-only numbers, ensures uniqueness, and supports reporting. No manual input. Change to Text Implications: Allows manual entry, risks duplicates, and breaks sequential logic. public class CaseNumberGenerator { public static void generateCaseNumber(List cases) { Integer seq = [SELECT COUNT() FROM Case] + 1; for (Case c : cases) { c.Custom_Case_Number__c = 'CASE-' + String.valueOf(seq++).leftPad(6, '0'); } } } CTA Case Study: A telecom with 2M Cases needs unique identifiers for 5,000 agents. Propose Auto Number versus Text with Apex, evaluating uniqueness, UI consistency, and reporting for a 10,000-user org.
99
A sales team tracks Discount Rates on Opportunities. What considerations apply when selecting a Percent data type, and what happens if changed to Number? Provide an Apex discount calculator.
Percent Selection Considerations: Formats as percentage, supports calculations, and is intuitive for reporting. Fixed decimal places. Change to Number Implications: Loses percent formatting, requires UI adjustments, and may confuse users. public class DiscountCalculator { public static void applyDiscount(List opps) { for (Opportunity opp : opps) { if (opp.Discount_Rate__c > 100 || opp.Discount_Rate__c < 0) { opp.addError('Discount Rate must be between 0 and 100.'); } opp.Discounted_Amount__c = opp.Amount * (1 - opp.Discount_Rate__c / 100); } } } CTA Case Study: A B2B firm with 400,000 Opportunities needs accurate Discount Rates for 4,000 reps. Design a Percent versus Number solution, justifying UI clarity, calculation accuracy, and reporting for a 5,000-user org.
100
A retailer tracks Store Locations with latitude and longitude. What considerations apply when selecting a Geolocation data type, and what happens if changed to Text? Provide an Apex distance calculator.
Geolocation Selection Considerations: Stores coordinates, supports distance calculations, and enhances mapping. High storage cost. Change to Text Implications: Loses calculation capabilities, breaks integrations, and requires manual parsing. public class LocationDistance { public static void calculateDistance(List stores) { for (Store__c store : stores) { Location loc1 = Location.newInstance(store.Location__latitude__s, store.Location__longitude__s); Location loc2 = Location.newInstance(37.7749, -122.4194); // Reference point store.Distance_to_HQ__c = loc1.getDistance(loc2, 'km'); } } } CTA Case Study: A retail chain with 10,000 Stores needs precise Location tracking for 2,000 users. Propose Geolocation versus Text, addressing mapping integrations, storage costs, and reporting for a 3,000-user org.
101
How can Schema Builder be used to create a custom object for tracking Projects, and what are key considerations? Provide an Apex snippet for object data retrieval.
Schema Builder allows creation of custom objects (e.g., Project__c) with fields and relationships via a drag-and-drop interface. Considerations: Ensure naming conventions, avoid exceeding object limits (500 custom objects), and verify permissions for visibility. No direct support for triggers or validation rules. public class ProjectRetriever { @AuraEnabled(cacheable=true) public static List getProjects() { return [SELECT Id, Name, Start_Date__c FROM Project__c LIMIT 100]; } } CTA Case Study: A consulting firm with 10,000 Projects needs a custom object for tracking. Design a Schema Builder solution versus Setup menu creation, justifying ease of use, governance, and scalability for a 5,000-user org.
102
How does Schema Builder support adding fields to a Case object, and what considerations apply when selecting data types? Provide an Apex field validator.
Capabilities: Add fields (e.g., Text, Picklist, Number) to standard/custom objects with options for required, unique, or external ID settings. Considerations: Choose appropriate data types for reporting/UI; avoid changing types post-data entry to prevent data loss; limited support for advanced field settings (e.g., formulas). public class CaseFieldValidator { public static void validatePriority(List cases) { for (Case c : cases) { if (c.Custom_Priority__c == null) { c.addError('Custom Priority is required.'); } } } } CTA Case Study: A telecom with 2M Cases needs to add 10 custom fields for analytics. Propose a Schema Builder solution versus Setup menu, evaluating data integrity, UI impact, and reporting for a 7,000-user org.
103
How does Schema Builder help visualize relationships for an Order management system, and what are the considerations? Provide an Apex relationship query.
Displays Lookup and Master-Detail relationships as lines between objects (e.g., Order__c to Account), showing cardinality. Considerations: Complex schemas can be cluttered; no direct editing of relationship properties (e.g., sharing rules); ensure relationship types align with access/reporting needs. public class OrderAccountQuery { @AuraEnabled(cacheable=true) public static List getOrdersByAccount(Id accountId) { return [SELECT Id, Name, Account__r.Name FROM Order__c WHERE Account__c = :accountId LIMIT 50]; } } CTA Case Study: A retailer with 1M Orders needs to visualize relationships for 5 objects. Design a Schema Builder approach versus ERD tools, addressing clarity, maintenance, and collaboration for a 6,000-user org.
104
How can Schema Builder create a Master-Detail relationship for Maintenance Records tied to Assets, and what are the considerations? Provide an Apex roll-up trigger.
Create Master-Detail relationships (e.g., Maintenance_Record__c to Asset) with cascading delete and roll-up summary support. Considerations: Master-Detail locks detail records to master’s sharing/ownership; cannot convert to Lookup post-data entry; impacts governor limits. trigger MaintenanceRollup on Maintenance_Record__c (after insert, after update, after delete) { Set assetIds = new Set(); if (Trigger.isInsert || Trigger.isUpdate) { for (Maintenance_Record__c rec : Trigger.new) assetIds.add(rec.Asset__c); } else { for (Maintenance_Record__c rec : Trigger.old) assetIds.add(rec.Asset__c); } List assets = [SELECT Id, Total_Cost__c, (SELECT Cost__c FROM Maintenance_Records__r) FROM Asset WHERE Id IN :assetIds]; for (Asset a : assets) { a.Total_Cost__c = 0; for (Maintenance_Record__c rec : a.Maintenance_Records__r) a.Total_Cost__c += rec.Cost__c; } update assets; } CTA Case Study: A manufacturer with 200,000 Assets needs a maintenance system for 1,000 technicians. Propose a Master-Detail in Schema Builder versus Lookup, justifying sharing, reporting, and performance for a 4,000-user org.
105
How can Schema Builder create a Lookup relationship for Contracts to Accounts, and what considerations apply? Provide an Apex data linker.
Capabilities: Create Lookup relationships (e.g., Contract__c to Account) for optional, independent linking. Considerations: No cascading delete; separate sharing/ownership; no roll-up summaries; suitable for flexible associations. public class ContractLinker { public static void linkContracts(List contracts) { for (Contract__c c : contracts) { if (c.Account__c == null) { c.Account__c = [SELECT Id FROM Account WHERE Name = :c.Account_Name__c LIMIT 1]?.Id; } } } } CTA Case Study: A legal firm with 50,000 Contracts needs flexible Account linking for 2,000 users. Design a Lookup in Schema Builder versus Master-Detail, evaluating UI flexibility, sharing, and reporting for a 3,000-user org.
106
How can Schema Builder create a Many-to-Many relationship for Employees and Projects, and what are the considerations? Provide an Apex assignment validator.
Create a Junction Object (e.g., Project_Assignment__c) with two Master-Detail or Lookup relationships to Employee__c and Project__c. Considerations: Complex sharing rules needed; impacts storage; requires custom report types for analysis. public class AssignmentValidator { public static void preventDuplicateAssignment(List assignments) { for (Project_Assignment__c pa : assignments) { List existing = [SELECT Id FROM Project_Assignment__c WHERE Project__c = :pa.Project__c AND Employee__c = :pa.Employee__c]; if (!existing.isEmpty()) { pa.addError('Employee already assigned to this Project.'); } } } } CTA Case Study: A consulting firm with 10,000 Projects and 2,000 Employees needs a scalable assignment system. Propose a Many-to-Many model in Schema Builder, justifying sharing complexity, UI design, and reporting for a 5,000-user org.
107
How does Schema Builder support External Objects for ERP integration, and what are the considerations? Provide an Apex external data query.
Displays External Objects (e.g., External_Product__x) and relationships via Salesforce Connect. Considerations: Read-only in Schema Builder; no field creation; performance depends on external system; limited reporting capabilities. public class ExternalProductQuery { @AuraEnabled(cacheable=true) public static List getExternalProducts() { return [SELECT ExternalId, Name__c, Price__c FROM External_Product__x WHERE Available__c = true LIMIT 50]; } } CTA Case Study: A retailer with 1M Opportunities and 500,000 external Products needs ERP integration. Design an External Object model in Schema Builder versus custom objects, evaluating performance, UI integration, and reporting for a 6,000-user org.
108
How can Schema Builder be used to delete unused custom objects, and what are the considerations? Provide an Apex data backup snippet.
Capabilities: Allows deletion of custom objects via right-click. Considerations: Irreversible after 15-day recycle bin period; impacts related data, reports, and automation; requires backup before deletion. public class ObjectBackup { public static void backupRecords(String objectName) { List records = Database.query('SELECT Id, Name FROM ' + objectName + ' LIMIT 1000'); String csv = 'Id,Name\n'; for (SObject rec : records) csv += rec.get('Id') + ',' + rec.get('Name') + '\n'; // Save to file or external system } } CTA Case Study: A company with 200 unused custom objects needs cleanup for 4,000 users. Propose a Schema Builder deletion process versus Setup menu, addressing data loss risks, governance, and audit trails for a 5,000-user org.
109
How can Schema Builder modify multiple fields across objects, and what are the considerations? Provide an Apex field updater.
Capabilities: Edit field properties (e.g., labels, required status) across objects in one interface. Considerations: No bulk field creation; changes impact existing data, automation, and reports; limited to simple field properties. public class FieldUpdater { public static void updateFieldValues(List records, String fieldName, Object newValue) { for (SObject rec : records) { rec.put(fieldName, newValue); } update records; } } CTA Case Study: A financial firm with 50 custom objects needs to update 100 fields for compliance. Design a Schema Builder approach versus Setup with Apex, justifying efficiency, data integrity, and reporting impacts for a 3,000-user org.
110
What are the limitations of Schema Builder for complex data models, and how can they be addressed? Provide an Apex metadata query for schema inspection.
Limitations: No support for triggers, validation rules, or complex permissions; cluttered for large schemas; no versioning. Considerations: Use alongside Setup for advanced configurations; document changes externally. Workaround: Use Apex or third-party tools for metadata management. public class SchemaInspector { @AuraEnabled(cacheable=true) public static List getCustomObjects() { List objects = new List(); for (Schema.SObjectType obj : Schema.getGlobalDescribe().values()) { if (obj.getDescribe().isCustom()) objects.add(obj.getDescribe().getName()); } return objects; } } CTA Case Study: A tech firm with 300 custom objects needs a scalable data model for 10,000 users. Propose a Schema Builder strategy versus metadata tools, addressing visualization, governance, and performance for a global org.
111
A company needs to import 10,000 Contacts from a CSV file. What are the capabilities and considerations of using the Data Import Wizard? Provide an Apex alternative for validation.
Capabilities: Data Import Wizard supports up to 50,000 records, maps CSV fields to Salesforce fields, and handles standard/custom objects with deduplication options. Considerations: Limited to 50,000 records; requires clean data; no automation; impacts validation rules/triggers. Apex Alternative: Custom validation for data quality. public class ContactImportValidator { public static void validateContacts(List contacts) { for (Contact c : contacts) { if (c.Email != null && !Pattern.matches('[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}', c.Email)) { c.addError('Invalid email format.'); } } } } CTA Case Study: A nonprofit with 100,000 Contacts needs to import donor data monthly for 2,000 users. Design a solution using Data Import Wizard versus Apex with Data Loader, justifying scalability, data integrity, and user training for a 3,000-user org.
112
A sales team needs to import 500,000 Opportunities annually. What are the capabilities and considerations of using Data Loader? Provide an Apex batch import snippet.
Capabilities: Data Loader handles millions of records, supports insert/update/upsert/delete, and integrates with external IDs for relationships. Considerations: Requires desktop installation; complex for non-technical users; governor limits apply; error handling needed. public class OpportunityBatchImport implements Database.Batchable { private List opps; public OpportunityBatchImport(List opps) { this.opps = opps; } public Iterable start(Database.BatchableContext bc) { return opps; } public void execute(Database.BatchableContext bc, List scope) { insert scope; } public void finish(Database.BatchableContext bc) {} } CTA Case Study: A tech firm with 1M Opportunities needs to import data quarterly for 5,000 reps. Propose Data Loader versus Apex batch jobs, evaluating performance, error handling, and automation for a 7,000-user org.
113
A company needs to export all Account data weekly for backups. What are the capabilities and considerations of the Weekly Data Export Service? Provide an Apex export alternative.
Capabilities: Weekly Data Export Service generates CSV backups of all objects (standard/custom) via email or FTP. Considerations: Scheduled weekly/monthly; large data volumes may require splitting; no real-time export; storage limits apply. public class AccountExporter { public static void exportAccounts() { List accounts = [SELECT Id, Name, Industry FROM Account LIMIT 10000]; String csv = 'Id,Name,Industry\n'; for (Account a : accounts) { csv += a.Id + ',' + a.Name + ',' + a.Industry + '\n'; } // Save to external storage or email } } CTA Case Study: A financial firm with 500,000 Accounts needs daily backups for compliance. Design a solution using Weekly Export versus Apex with external storage, addressing security, data volume, and audit requirements for a 4,000-user org.
114
A retailer needs to access real-time Product data from an ERP without storing it in Salesforce. What are the capabilities and considerations of Salesforce Connect? Provide an Apex external query.
Salesforce Connect uses External Objects to access OData-compliant external data in real-time, supporting lookups and reporting. Considerations: Performance depends on external system; no data storage in Salesforce; licensing costs; limited write-back support. public class ExternalProductQuery { @AuraEnabled(cacheable=true) public static List getProducts() { return [SELECT ExternalId, Name__c, Price__c FROM External_Product__x WHERE Available__c = true LIMIT 50]; } } CTA Case Study: A retailer with 1M Opportunities and 500,000 external Products needs ERP integration. Propose Salesforce Connect versus custom objects with Apex callouts, justifying performance, cost, and reporting for a 6,000-user org.
115
A company imports Orders linked to Accounts using Account IDs from an external system. What are the capabilities and considerations of using External IDs? Provide an Apex upsert snippet.
Capabilities: External ID fields allow upsert operations to link records via unique external keys, simplifying relationship imports. Considerations: Requires unique, indexed fields; data mismatches can cause errors; impacts performance for large datasets. public class OrderUpsert { public static void upsertOrders(List orders) { for (Order__c ord : orders) { ord.Account__c = [SELECT Id FROM Account WHERE External_ID__c = :ord.Account_External_ID__c LIMIT 1]?.Id; } upsert orders External_ID__c; } } CTA Case Study: A manufacturer with 200,000 Orders needs to import data linked to 50,000 Accounts. Design a solution using External IDs with Data Loader versus Apex, addressing data integrity, performance, and automation for a 5,000-user org.
116
A company needs to delete 100,000 outdated Leads. What are the capabilities and considerations of using Data Loader for deletion? Provide an Apex deletion snippet.
Capabilities: Data Loader supports bulk deletion by ID, with hard/soft delete options and export of deleted records. Considerations: Irreversible hard deletes; impacts related records; requires careful filtering; governor limits apply. public class LeadDeletionBatch implements Database.Batchable { public Database.QueryLocator start(Database.BatchableContext bc) { return Database.getQueryLocator('SELECT Id FROM Lead WHERE CreatedDate < LAST_N_YEARS:2'); } public void execute(Database.BatchableContext bc, List scope) { delete scope; } public void finish(Database.BatchableContext bc) {} } CTA Case Study: A marketing firm with 1M Leads needs to purge old data for 3,000 users. Propose Data Loader versus Apex batch deletion, evaluating compliance, performance, and audit trails for a 4,000-user org.
117
A company needs to automate monthly CSV imports for 5,000 Cases. What are the capabilities and considerations of using Flow for imports? Provide an Apex import automation snippet.
Capabilities: Flow can trigger file imports from external storage (e.g., Files) and map data to objects using custom logic. Considerations: Limited to smaller datasets; requires Flow design; impacts governor limits; error handling needed. public class CaseImportAutomation { @InvocableMethod(label='Import Cases' description='Imports Cases from CSV') public static void importCases(List csvData) { List cases = new List(); for (String row : csvData) { List fields = row.split(','); cases.add(new Case(Subject = fields[0], Priority = fields[1])); } insert cases; } } CTA Case Study: A healthcare provider with 100,000 Cases needs automated imports for 2,000 agents. Design a Flow-based solution versus Apex with scheduled jobs, justifying automation, error handling, and scalability for a 3,000-user org.
118
A company needs to export Opportunity data to Tableau for advanced analytics. What are the capabilities and considerations of exporting data? Provide an Apex export snippet.
Capabilities: Export via Reports, Data Loader, or API to CSV/JSON for BI tools; supports incremental exports. Considerations: Large datasets require batching; data security must be ensured; external tool compatibility needed. public class OpportunityExporter { public static void exportToTableau() { List opps = [SELECT Id, Name, Amount FROM Opportunity WHERE CreatedDate = THIS_YEAR LIMIT 10000]; String jsonData = JSON.serialize(opps); // Send to Tableau via HTTP callout } } CTA Case Study: A tech firm with 500,000 Opportunities needs Tableau integration for 4,000 users. Propose a Report-based export versus Apex with API, addressing real-time needs, security, and performance for a 6,000-user org.
119
A company needs to query external HR data in Salesforce without importing it. What are the capabilities and considerations of OData with Salesforce Connect? Provide an Apex query snippet.
Capabilities: OData enables real-time access to external data as External Objects, supporting read/write (if allowed) and relationships. Considerations: Performance relies on external system; no local storage; licensing costs; limited offline support. public class HRDataQuery { @AuraEnabled(cacheable=true) public static List getEmployees() { return [SELECT ExternalId, Name__c, Department__c FROM Employee__x WHERE Active__c = true LIMIT 50]; } } CTA Case Study: A corporation with 50,000 external Employee records needs HR integration for 5,000 users. Design an OData-based solution versus custom objects with Apex, justifying latency, cost, and reporting for a 7,000-user org.
120
A company imports 50,000 Accounts but faces errors due to duplicates. What are the capabilities and considerations for error handling? Provide an Apex error logger.
Capabilities: Data Import Wizard/Data Loader provide error logs (CSV); deduplication rules catch duplicates; Flows can handle errors declaratively. Considerations: Large error logs require analysis; automation reduces manual effort; custom logging enhances traceability. public class ImportErrorLogger { public static void logErrors(List results, List accounts) { List logs = new List(); for (Integer i = 0; i < results.size(); i++) { if (!results[i].isSuccess()) { logs.add(new Error_Log__c( Object_Name__c = 'Account', Record_Data__c = JSON.serialize(accounts[i]), Error_Message__c = results[i].getErrors()[0].getMessage() )); } } insert logs; } } CTA Case Study: A bank with 200,000 Accounts needs robust import error handling for 3,000 users. Propose a Data Loader with deduplication versus Apex with custom logging, addressing traceability, user experience, and compliance for a 4,000-user org.
121
A sales team needs a field on Opportunity to indicate if a discount is applied (Amount < Original_Amount__c). How can a formula field meet this requirement? Provide an Apex alternative.
Create a Formula Field (Text) named Discount_Applied__c: IF(Amount < Original_Amount__c, "Discounted", "Full Price"). Capabilities: Displays dynamic status; supports reporting; no storage used. Considerations: Read-only; limited to 5,000 characters; impacts compile size. public class DiscountCalculator { public static void calculateDiscountStatus(List opps) { for (Opportunity opp : opps) { opp.Discount_Status__c = opp.Amount < opp.Original_Amount__c ? 'Discounted' : 'Full Price'; } update opps; } } CTA Case Study: A retail firm with 1M Opportunities needs to track discounts for 5,000 reps. Design a formula field solution versus Apex, justifying performance, reporting, and maintenance for a 7,000-user org.
122
A support team needs a Case field to flag high-priority cases open for over 7 days. How can a formula field address this? Provide an Apex validation snippet.
Create a Formula Field (Checkbox) named Needs_Escalation__c: IF(AND(Priority = 'High', TODAY() - CreatedDate > 7), TRUE, FALSE). Capabilities: Auto-updates; supports filters/dashboards. Considerations: Date calculations are timezone-sensitive; cannot trigger automation directly. public class CaseEscalationValidator { public static void validateEscalation(List cases) { for (Case c : cases) { if (c.Priority == 'High' && Date.today().daysBetween(c.CreatedDate) > 7) { c.Escalation_Flag__c = true; } } } } CTA Case Study: A telecom with 2M Cases needs escalation tracking for 4,000 agents. Propose a formula field versus Apex with Flow, evaluating real-time updates, scalability, and automation for a 6,000-user org.
123
A company needs to categorize Accounts by AnnualRevenue into tiers (Low, Medium, High). How can a formula field meet this? Provide an Apex tier calculator.
Create a Formula Field (Text) named Revenue_Tier__c: CASE(AnnualRevenue, 0, "Low", 100000, "Medium", 1000000, "High", "Unknown"). Capabilities: Simplifies reporting; dynamic categorization. Considerations: CASE limits (30 pairs); cannot reference related objects directly. public class RevenueTierCalculator { public static void assignTiers(List accounts) { for (Account acc : accounts) { if (acc.AnnualRevenue == null) acc.Revenue_Tier__c = 'Unknown'; else if (acc.AnnualRevenue < 100000) acc.Revenue_Tier__c = 'Low'; else if (acc.AnnualRevenue < 1000000) acc.Revenue_Tier__c = 'Medium'; else acc.Revenue_Tier__c = 'High'; } update accounts; } } CTA Case Study: A financial firm with 500,000 Accounts needs revenue tiering for 3,000 users. Design a formula field versus Apex solution, addressing governance, UI display, and dashboard integration for a 5,000-user org.
124
A legal team needs a Contract field to show if renewal is due within 30 days. How can a formula field address this? Provide an Apex renewal checker.
Create a Formula Field (Text) named Renewal_Status__c: IF(End_Date__c - TODAY() <= 30 && End_Date__c >= TODAY(), "Due Soon", "Not Due"). Capabilities: Real-time alerts; supports list views. Considerations: Date precision varies by timezone; cannot trigger emails directly. public class RenewalChecker { public static void checkRenewals(List contracts) { for (Contract__c c : contracts) { c.Renewal_Status__c = (c.End_Date__c.daysBetween(Date.today()) <= 30 && c.End_Date__c >= Date.today()) ? 'Due Soon' : 'Not Due'; } update contracts; } } CTA Case Study: A law firm with 100,000 Contracts needs renewal tracking for 2,000 users. Propose a formula field versus Apex with Flow, justifying automation integration, performance, and mobile access for a 4,000-user org.
125
A sales team needs a field to calculate Opportunity weighted value (Amount * Probability). How can a formula field meet this? Provide an Apex calculation snippet.
Create a Formula Field (Currency) named Weighted_Value__c: Amount * Probability / 100. Capabilities: Auto-calculates; supports roll-up summaries; currency-aware. Considerations: Limited to simple math; impacts compile size for complex formulas. public class WeightedValueCalculator { public static void calculateWeightedValue(List opps) { for (Opportunity opp : opps) { opp.Weighted_Value__c = opp.Amount * (opp.Probability / 100); } update opps; } } CTA Case Study: A tech firm with 300,000 Opportunities needs weighted values for 5,000 reps. Design a formula field versus Apex solution, evaluating reporting accuracy, performance, and multi-currency support for a 6,000-user org.
126
A support team needs a Case field to indicate if resolution time meets SLA (within 24 hours). How can a formula field address this? Provide an Apex SLA validator.
Create a Formula Field (Checkbox) named SLA_Compliant__c: IF(ClosedDate - CreatedDate <= 1, TRUE, FALSE). Capabilities: Dynamic compliance check; supports dashboards. Considerations: Timezone affects calculations; cannot reference complex logic. public class SLAValidator { public static void validateSLA(List cases) { for (Case c : cases) { if (c.ClosedDate != null) { c.SLA_Compliant__c = c.ClosedDate.daysBetween(c.CreatedDate) <= 1; } } } } CTA Case Study: A healthcare provider with 1M Cases needs SLA tracking for 4,000 agents. Propose a formula field versus Apex with Flow, addressing real-time reporting, scalability, and compliance for an 8,000-user org.
127
A company needs an Account field to score health based on recent activity (e.g., no Cases in 30 days = Good). How can a formula field meet this? Provide an Apex score calculator.
Create a Formula Field (Text) named Health_Score__c: IF(Case.Last_Created_Date__c < TODAY() - 30 || Case.Last_Created_Date__c = NULL, "Good", "At Risk"). Capabilities: Cross-object references; supports list views. Considerations: Limited to one cross-object level; performance impact with large data. public class HealthScoreCalculator { public static void calculateHealth(List accounts) { for (Account acc : [SELECT Id, (SELECT CreatedDate FROM Cases ORDER BY CreatedDate DESC LIMIT 1) FROM Account WHERE Id IN :accounts]) { acc.Health_Score__c = (acc.Cases.isEmpty() || acc.Cases[0].CreatedDate < Date.today().addDays(-30)) ? 'Good' : 'At Risk'; } update accounts; } } CTA Case Study: A SaaS company with 200,000 Accounts needs health scoring for 3,000 users. Design a formula field versus Apex solution, justifying cross-object performance, UI display, and analytics for a 5,000-user org.
128
A retailer needs a Product field to calculate profit margin ((Sale_Price__c - Cost__c) / Sale_Price__c). How can a formula field address this? Provide an Apex margin calculator.
Create a Formula Field (Percent) named Profit_Margin__c: ((Sale_Price__c - Cost__c) / Sale_Price__c) * 100. Capabilities: Precise calculations; formatting as percentage. Considerations: Handles division by zero; impacts compile size for complex logic. public class ProfitMarginCalculator { public static void calculateMargin(List products) { for (Product__c p : products) { if (p.Sale_Price__c != 0) { p.Profit_Margin__c = ((p.Sale_Price__c - p.Cost__c) / p.Sale_Price__c) * 100; } else { p.Profit_Margin__c = 0; } } update products; } } CTA Case Study: A retailer with 500,000 Products needs profit margin tracking for 2,000 users. Propose a formula field versus Apex, evaluating calculation accuracy, reporting, and performance for a 4,000-user org.
129
A company needs a User field to display tenure in years based on Hire Date. How can a formula field meet this? Provide an Apex tenure calculator.
Create a Formula Field (Number) named Tenure_Years__c: YEAR(TODAY()) - YEAR(Hire_Date__c) - IF(MONTH(TODAY()) < MONTH(Hire_Date__c) || (MONTH(TODAY()) = MONTH(Hire_Date__c) && DAY(TODAY()) < DAY(Hire_Date__c)), 1, 0). Capabilities: Dynamic date math; reporting-friendly. Considerations: Complex logic increases compile size; timezone-sensitive. public class TenureCalculator { public static void calculateTenure(List users) { for (User u : users) { if (u.Hire_Date__c != null) { Date today = Date.today(); Integer years = today.year() - u.Hire_Date__c.year(); if (today.month() < u.Hire_Date__c.month() || (today.month() == u.Hire_Date__c.month() && today.day() < u.Hire_Date__c.day())) { years--; } u.Tenure_Years__c = years; } } update users; } } CTA Case Study: A corporation with 10,000 Users needs tenure tracking for HR analytics. Design a formula field versus Apex solution, addressing performance, reporting integration, and governance for a 3,000-user org.
130
A logistics firm needs an Order field to show fulfillment status based on Shipped_Date__c and Delivery_Date__c. How can a formula field address this? Provide an Apex status updater.
Create a Formula Field (Text) named Fulfillment_Status__c: IF(ISBLANK(Delivery_Date__c), IF(ISBLANK(Shipped_Date__c), "Pending", "In Transit"), "Delivered"). Capabilities: Conditional logic; supports dashboards. Considerations: Limited to simple conditions; cannot trigger automation. public class FulfillmentStatusUpdater { public static void updateStatus(List orders) { for (Order__c ord : orders) { if (ord.Delivery_Date__c != null) ord.Fulfillment_Status__c = 'Delivered'; else if (ord.Shipped_Date__c != null) ord.Fulfillment_Status__c = 'In Transit'; else ord.Fulfillment_Status__c = 'Pending'; } update orders; } } CTA Case Study: A logistics firm with 1M Orders needs fulfillment tracking for 3,000 users. Propose a formula field versus Apex with Flow, justifying real-time updates, mobile usability, and scalability for a 5,000-user org.
131
A company needs to display the total Amount of all related Opportunities on an Account. How can a roll-up summary field meet this requirement, and what are the implications? Provide an Apex alternative.
Capabilities: Create a roll-up summary field (SUM) on Account (Total_Opportunity_Amount__c) to sum Opportunity.Amount. Use Cases: Financial reporting, account health dashboards. Implications: Requires Master-Detail relationship; recalculates on child updates; impacts performance with large datasets. public class AccountOpportunityRollup { public static void calculateTotalAmount(List opps) { Set accountIds = new Set(); for (Opportunity opp : opps) accountIds.add(opp.AccountId); List accounts = [SELECT Id, Total_Opportunity_Amount__c, (SELECT Amount FROM Opportunities) FROM Account WHERE Id IN :accountIds]; for (Account acc : accounts) { acc.Total_Opportunity_Amount__c = 0; for (Opportunity opp : acc.Opportunities) acc.Total_Opportunity_Amount__c += opp.Amount; } update accounts; } } CTA Case Study: A sales org with 1M Accounts and 5M Opportunities needs total deal values for 10,000 reps. Design a roll-up summary versus Apex solution, justifying performance, scalability, and reporting for a global org.
132
A support team needs to track the number of open Cases per Account. How can a roll-up summary field address this, and what are the implications? Provide an Apex counter.
Capabilities: Create a roll-up summary field (COUNT) on Account (Open_Cases__c) to count Cases where Status != 'Closed'. Use Cases: Customer support metrics, SLA monitoring. Implications: Master-Detail required; filter limitations; performance impact with frequent updates. public class CaseCounter { public static void countOpenCases(List cases) { Set accountIds = new Set(); for (Case c : cases) accountIds.add(c.AccountId); List accounts = [SELECT Id, Open_Cases__c, (SELECT Id FROM Cases WHERE Status != 'Closed') FROM Account WHERE Id IN :accountIds]; for (Account acc : accounts) { acc.Open_Cases__c = acc.Cases.size(); } update accounts; } } CTA Case Study: A telecom with 2M Accounts and 10M Cases needs open case tracking for 5,000 agents. Propose a roll-up summary versus Apex with Flow, evaluating real-time updates, data model constraints, and dashboards for a 7,000-user org.
133
A retailer needs to display the most recent Order date on an Account. How can a roll-up summary field meet this, and what are the implications? Provide an Apex date tracker.
Capabilities: Create a roll-up summary field (MAX) on Account (Latest_Order_Date__c) to capture the latest Order__c.Order_Date__c. Use Cases: Customer activity tracking, marketing campaigns. Implications: Master-Detail only; limited to date/number fields; impacts performance for large child datasets. public class LatestOrderDate { public static void updateLatestDate(List orders) { Set accountIds = new Set(); for (Order__c ord : orders) accountIds.add(ord.Account__c); List accounts = [SELECT Id, Latest_Order_Date__c, (SELECT Order_Date__c FROM Orders__r ORDER BY Order_Date__c DESC) FROM Account WHERE Id IN :accountIds]; for (Account acc : accounts) { acc.Latest_Order_Date__c = acc.Orders__r.isEmpty() ? null : acc.Orders__r[0].Order_Date__c; } update accounts; } } CTA Case Study: A retailer with 500,000 Accounts and 3M Orders needs recent activity tracking for 4,000 users. Design a roll-up summary versus Apex solution, justifying UI display, performance, and reporting for a 6,000-user org.
134
A company needs to show the smallest Contract value per Account. How can a roll-up summary field address this, and what are the implications? Provide an Apex min value calculator.
Capabilities: Create a roll-up summary field (MIN) on Account (Min_Contract_Value__c) to capture the lowest Contract__c.Value__c. Use Cases: Risk assessment, pricing analysis. Implications: Requires Master-Detail; limited to number/currency fields; recalculation delays possible. public class MinContractValue { public static void calculateMinValue(List contracts) { Set accountIds = new Set(); for (Contract__c c : contracts) accountIds.add(c.Account__c); List accounts = [SELECT Id, Min_Contract_Value__c, (SELECT Value__c FROM Contracts__r) FROM Account WHERE Id IN :accountIds]; for (Account acc : accounts) { Decimal minVal = null; for (Contract__c c : acc.Contracts__r) minVal = minVal == null ? c.Value__c : Math.min(minVal, c.Value__c); acc.Min_Contract_Value__c = minVal; } update accounts; } } CTA Case Study: A legal firm with 100,000 Accounts and 200,000 Contracts needs minimum value tracking for 2,000 users. Propose a roll-up summary versus Apex, evaluating data model, performance, and analytics for a 3,000-user org.
135
A manufacturer needs to track total Maintenance Costs per Asset. How can a roll-up summary field meet this, and what are the implications? Provide an Apex cost aggregator.
Capabilities: Create a roll-up summary field (SUM) on Asset (Total_Maintenance_Cost__c) to sum Maintenance_Record__c.Cost__c. Use Cases: Asset management, budgeting. Implications: Master-Detail required; impacts storage; performance hit with frequent updates. public class MaintenanceCostRollup { public static void aggregateCosts(List records) { Set assetIds = new Set(); for (Maintenance_Record__c rec : records) assetIds.add(rec.Asset__c); List assets = [SELECT Id, Total_Maintenance_Cost__c, (SELECT Cost__c FROM Maintenance_Records__r) FROM Asset WHERE Id IN :assetIds]; for (Asset a : assets) { a.Total_Maintenance_Cost__c = 0; for (Maintenance_Record__c rec : a.Maintenance_Records__r) a.Total_Maintenance_Cost__c += rec.Cost__c; } update assets; } } CTA Case Study: A manufacturer with 200,000 Assets and 1M Maintenance Records needs cost tracking for 1,000 technicians. Design a roll-up summary versus Apex solution, addressing scalability, reporting, and mobile access for a 4,000-user org.
136
A firm needs to count active Projects per Employee. How can a roll-up summary field address this, and what are the implications? Provide an Apex project counter.
Create a roll-up summary field (COUNT) on Employee__c (Active_Projects__c) to count Project_Assignment__c records where Project__c.Status__c = 'Active'. Use Cases: Resource allocation, performance metrics. Implications: Requires Junction Object with Master-Detail; filter complexity; performance impact. public class ProjectCounter { public static void countActiveProjects(List assignments) { Set employeeIds = new Set(); for (Project_Assignment__c pa : assignments) employeeIds.add(pa.Employee__c); List employees = [SELECT Id, Active_Projects__c, (SELECT Id FROM Project_Assignments__r WHERE Project__r.Status__c = 'Active') FROM Employee__c WHERE Id IN :employeeIds]; for (Employee__c emp : employees) { emp.Active_Projects__c = emp.Project_Assignments__r.size(); } update employees; } } CTA Case Study: A consulting firm with 10,000 Employees and 50,000 Projects needs resource tracking for 2,000 users. Propose a roll-up summary versus Apex, justifying data model complexity, performance, and reporting for a 5,000-user org.
137
A support team needs the earliest Case creation date per Account. How can a roll-up summary field meet this, and what are the implications? Provide an Apex date tracker.
Create a roll-up summary field (MIN) on Account (Earliest_Case_Date__c) to capture the earliest Case.CreatedDate. Use Cases: Customer engagement tracking, SLA analysis. Implications: Master-Detail required; limited to date fields; performance impact with large datasets. public class EarliestCaseDate { public static void updateEarliestDate(List cases) { Set accountIds = new Set(); for (Case c : cases) accountIds.add(c.AccountId); List accounts = [SELECT Id, Earliest_Case_Date__c, (SELECT CreatedDate FROM Cases ORDER BY CreatedDate ASC LIMIT 1) FROM Account WHERE Id IN :accountIds]; for (Account acc : accounts) { acc.Earliest_Case_Date__c = acc.Cases.isEmpty() ? null : acc.Cases[0].CreatedDate; } update accounts; } } CTA Case Study: A healthcare provider with 1M Accounts and 5M Cases needs engagement tracking for 3,000 agents. Design a roll-up summary versus Apex solution, evaluating UI display, performance, and analytics for a 6,000-user org.
138
A company needs to sum Order revenues linked to Opportunities. How can a roll-up summary field address this, and what are the implications? Provide an Apex revenue aggregator.
Capabilities: Create a roll-up summary field (SUM) on Opportunity (Total_Order_Revenue__c) to sum Order__c.Revenue__c. Use Cases: Pipeline analysis, forecasting. Implications: Master-Detail required; impacts compile size; performance hit with frequent updates. public class OrderRevenueRollup { public static void aggregateRevenue(List orders) { Set oppIds = new Set(); for (Order__c ord : orders) oppIds.add(ord.Opportunity__c); List opps = [SELECT Id, Total_Order_Revenue__c, (SELECT Revenue__c FROM Orders__r) FROM Opportunity WHERE Id IN :oppIds]; for (Opportunity opp : opps) { opp.Total_Order_Revenue__c = 0; for (Order__c ord : opp.Orders__r) opp.Total_Order_Revenue__c += ord.Revenue__c; } update opps; } } CTA Case Study: A B2B firm with 300,000 Opportunities and 1M Orders needs revenue tracking for 4,000 reps. Propose a roll-up summary versus Apex, addressing data model, reporting, and scalability for a 5,000-user org.
139
A company needs to track the highest Employee salary per Department. How can a roll-up summary field meet this, and what are the implications? Provide an Apex salary calculator.
Capabilities: Create a roll-up summary field (MAX) on Department__c (Max_Salary__c) to capture the highest Employee__c.Salary__c. Use Cases: Budget planning, HR analytics. Implications: Master-Detail required; limited to number fields; performance impact with large child records. public class MaxSalaryCalculator { public static void calculateMaxSalary(List employees) { Set deptIds = new Set(); for (Employee__c emp : employees) deptIds.add(emp.Department__c); List depts = [SELECT Id, Max_Salary__c, (SELECT Salary__c FROM Employees__r) FROM Department__c WHERE Id IN :deptIds]; for (Department__c dept : depts) { Decimal maxSal = null; for (Employee__c emp : dept.Employees__r) maxSal = maxSal == null ? emp.Salary__c : Math.max(maxSal, emp.Salary__c); dept.Max_Salary__c = maxSal; } update depts; } } CTA Case Study: A corporation with 50,000 Employees across 1,000 Departments needs salary tracking for 2,000 HR users. Design a roll-up summary versus Apex solution, justifying performance, reporting, and data model for a 3,000-user org.
140
A firm needs to count completed Tasks per Project. How can a roll-up summary field address this, and what are the implications? Provide an Apex task counter.
Capabilities: Create a roll-up summary field (COUNT) on Project__c (Completed_Tasks__c) to count Task__c records where Status__c = 'Completed'. Use Cases: Project progress tracking, reporting. Implications: Master-Detail required; filter limitations; impacts performance with frequent updates. public class TaskCounter { public static void countCompletedTasks(List tasks) { Set projectIds = new Set(); for (Task__c t : tasks) projectIds.add(t.Project__c); List projects = [SELECT Id, Completed_Tasks__c, (SELECT Id FROM Tasks__r WHERE Status__c = 'Completed') FROM Project__c WHERE Id IN :projectIds]; for (Project__c proj : projects) { proj.Completed_Tasks__c = proj.Tasks__r.size(); } update projects; } } CTA Case Study: A consulting firm with 20,000 Projects and 100,000 Tasks needs progress tracking for 1,500 users. Propose a roll-up summary versus Apex with Flow, evaluating automation, performance, and dashboard integration for a 4,000-user org.
141
A sales team requires that Opportunity Amounts be greater than $1,000 for "Closed Won" deals. How can a validation rule enforce this, and what are the considerations? Provide an Apex alternative.
Create a Validation Rule on Opportunity: AND(StageName = "Closed Won", Amount < 1000). Error Message: "Closed Won Opportunities must have an Amount greater than $1,000." Capabilities: Prevents invalid data saves; user-friendly error messages. Considerations: Impacts UI; cannot reference related objects extensively; test for edge cases. public class OpportunityAmountValidator { public static void validateAmount(List opps) { for (Opportunity opp : opps) { if (opp.StageName == 'Closed Won' && opp.Amount < 1000) { opp.addError('Closed Won Opportunities must have an Amount greater than $1,000.'); } } } } CTA Case Study: A tech firm with 1M Opportunities needs to enforce Amount rules for 5,000 reps. Design a validation rule versus Apex solution, justifying data integrity, performance, and user experience for a 7,000-user org.
142
A support team requires a Description for High Priority Cases. How can a validation rule meet this requirement, and what are the considerations? Provide an Apex validation.
Create a Validation Rule on Case: AND(Priority = "High", ISBLANK(Description)). Error Message: "High Priority Cases require a Description." Capabilities: Enforces mandatory fields; supports conditional logic. Considerations: Clear error messaging; impacts save performance; limited to single-object logic. public class CaseDescriptionValidator { public static void validateDescription(List cases) { for (Case c : cases) { if (c.Priority == 'High' && String.isBlank(c.Description)) { c.addError('High Priority Cases require a Description.'); } } } } CTA Case Study: A telecom with 2M Cases needs Description enforcement for 4,000 agents. Propose a validation rule versus Apex trigger, evaluating scalability, maintainability, and error handling for a 6,000-user org.
143
A company requires a Billing Address for Accounts with AnnualRevenue over $500,000. How can a validation rule address this, and what are the considerations? Provide an Apex alternative.
Create a Validation Rule on Account: AND(AnnualRevenue > 500000, OR(ISBLANK(BillingStreet), ISBLANK(BillingCity))). Error Message: "Accounts with AnnualRevenue over $500,000 must have a Billing Address." Capabilities: Ensures data completeness; supports reporting. Considerations: Multi-field checks; user training for errors; no cross-object validation. public class AccountAddressValidator { public static void validateBillingAddress(List accounts) { for (Account acc : accounts) { if (acc.AnnualRevenue > 500000 && (String.isBlank(acc.BillingStreet) || String.isBlank(acc.BillingCity))) { acc.addError('Accounts with AnnualRevenue over $500,000 must have a Billing Address.'); } } } } CTA Case Study: A financial firm with 500,000 Accounts needs address validation for 3,000 users. Design a validation rule versus Apex solution, justifying data quality, UI impact, and reporting for a 5,000-user org.
144
A legal team requires that Contract End Dates be after Start Dates. How can a validation rule enforce this, and what are the considerations? Provide an Apex date validator.
Create a Validation Rule on Contract__c: End_Date__c <= Start_Date__c. Error Message: "End Date must be after Start Date." Capabilities: Enforces date logic; prevents invalid saves. Considerations: Timezone sensitivity; clear error messages; impacts save time. public class ContractDateValidator { public static void validateDates(List contracts) { for (Contract__c c : contracts) { if (c.End_Date__c <= c.Start_Date__c) { c.addError('End Date must be after Start Date.'); } } } } CTA Case Study: A law firm with 100,000 Contracts needs date validation for 2,000 users. Propose a validation rule versus Apex trigger, evaluating performance, error messaging, and automation integration for a 4,000-user org.
145
A retailer requires that Order Item Quantities be between 1 and 100. How can a validation rule meet this, and what are the considerations? Provide an Apex quantity validator.
Create a Validation Rule on OrderItem__c: OR(Quantity__c < 1, Quantity__c > 100). Error Message: "Quantity must be between 1 and 100." Capabilities: Enforces numerical ranges; supports reporting. Considerations: User-friendly errors; impacts save performance; no dynamic ranges. public class QuantityValidator { public static void validateQuantity(List items) { for (OrderItem__c item : items) { if (item.Quantity__c < 1 || item.Quantity__c > 100) { item.addError('Quantity must be between 1 and 100.'); } } } } CTA Case Study: A retailer with 1M Order Items needs quantity controls for 3,000 users. Design a validation rule versus Apex solution, justifying scalability, UI usability, and integration with inventory for a 5,000-user org.
146
A company requires that Employee Certifications have an Expiry Date in the future. How can a validation rule enforce this, and what are the considerations? Provide an Apex expiry checker.
Create a Validation Rule on Certification__c: Expiry_Date__c <= TODAY(). Error Message: "Certification Expiry Date must be in the future." Capabilities: Ensures future dates; supports compliance. Considerations: Timezone issues; no cross-object logic; clear error messaging. public class CertificationExpiryValidator { public static void validateExpiry(List certs) { for (Certification__c c : certs) { if (c.Expiry_Date__c <= Date.today()) { c.addError('Certification Expiry Date must be in the future.'); } } } } CTA Case Study: A tech firm with 50,000 Certifications needs expiry validation for 2,000 HR users. Propose a validation rule versus Apex trigger, evaluating compliance, performance, and reporting for a 3,000-user org.
147
A marketing team requires that Leads have a valid Source (e.g., Web, Email, Event). How can a validation rule address this, and what are the considerations? Provide an Apex source validator.
Create a Validation Rule on Lead: NOT(ISPICKVAL(Source, "Web") || ISPICKVAL(Source, "Email") || ISPICKVAL(Source, "Event")). Error Message: "Lead Source must be Web, Email, or Event." Capabilities: Enforces picklist values; supports reporting. Considerations: Picklist maintenance; impacts save time; clear errors needed. public class LeadSourceValidator { public static void validateSource(List leads) { Set validSources = new Set{'Web', 'Email', 'Event'}; for (Lead l : leads) { if (!validSources.contains(l.Source)) { l.addError('Lead Source must be Web, Email, or Event.'); } } } } CTA Case Study: A marketing firm with 1M Leads needs source validation for 3,000 users. Design a validation rule versus Apex solution, justifying data quality, UI impact, and analytics integration for a 4,000-user org.
148
A firm requires that Project Budgets not exceed $1M unless approved. How can a validation rule enforce this, and what are the considerations? Provide an Apex budget validator.
Create a Validation Rule on Project__c: AND(Budget__c > 1000000, NOT(Is_Approved__c)). Error Message: "Budgets over $1M require approval." Capabilities: Conditional logic; prevents invalid saves. Considerations: Impacts automation; clear error messaging; no complex cross-object checks. public class ProjectBudgetValidator { public static void validateBudget(List projects) { for (Project__c p : projects) { if (p.Budget__c > 1000000 && !p.Is_Approved__c) { p.addError('Budgets over $1M require approval.'); } } } } CTA Case Study: A consulting firm with 20,000 Projects needs budget controls for 1,500 users. Propose a validation rule versus Apex trigger, evaluating scalability, approval process integration, and reporting for a 3,000-user org.
149
A logistics firm requires that Order Shipping Dates be within 30 days of creation. How can a validation rule meet this, and what are the considerations? Provide an Apex date validator.
Create a Validation Rule on Order__c: OR(Shipping_Date__c < CreatedDate, Shipping_Date__c > CreatedDate + 30). Error Message: "Shipping Date must be within 30 days of creation." Capabilities: Enforces date ranges; supports compliance. Considerations: Timezone sensitivity; impacts save performance; clear errors needed. public class ShippingDateValidator { public static void validateShippingDate(List orders) { for (Order__c ord : orders) { if (ord.Shipping_Date__c < ord.CreatedDate || ord.Shipping_Date__c > ord.CreatedDate.addDays(30)) { ord.addError('Shipping Date must be within 30 days of creation.'); } } } } CTA Case Study: A logistics firm with 1M Orders needs shipping date controls for 3,000 users. Design a validation rule versus Apex solution, justifying performance, UI usability, and integration with logistics systems for a 5,000-user org.
150
A company requires that Employees have either a Phone or Email. How can a validation rule enforce this, and what are the considerations? Provide an Apex contact validator.
Create a Validation Rule on Employee__c: AND(ISBLANK(Phone__c), ISBLANK(Email__c)). Error Message: "Employee must have either a Phone or Email." Capabilities: Ensures data completeness; supports OR logic. Considerations: User-friendly errors; impacts save time; no cross-object validation. public class EmployeeContactValidator { public static void validateContactInfo(List employees) { for (Employee__c emp : employees) { if (String.isBlank(emp.Phone__c) && String.isBlank(emp.Email__c)) { emp.addError('Employee must have either a Phone or Email.'); } } } } CTA Case Study: A corporation with 50,000 Employees needs contact validation for 2,000 HR users. Propose a validation rule versus Apex trigger, addressing data quality, reporting, and scalability for a 3,000-user org.
151
A sales team requires approval for Opportunities with Amounts over $500,000. How can an approval process meet this, and what are key capabilities and considerations? Provide an Apex submission snippet.
Capabilities: Create an approval process on Opportunity with entry criteria (Amount > 500,000), specifying approvers (e.g., Manager), email alerts, and field updates (e.g., Status__c to 'In Approval'). Use Cases: Deal validation, financial oversight. Considerations: User training for submission/approval; performance impact with many approvers; limited dynamic routing. public class OpportunityApproval { @InvocableMethod(label='Submit for Approval' description='Submits Opportunity for approval') public static void submitForApproval(List oppIds) { for (Id oppId : oppIds) { Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest(); req.setObjectId(oppId); Approval.process(req); } } } CTA Case Study: A tech firm with 1M Opportunities needs approval for high-value deals across 5,000 reps. Design an approval process versus Apex with Flow, justifying scalability, user experience, and audit trails for a 7,000-user org.
152
A support team needs manager approval for escalating high-priority Cases. How can an approval process address this, and what are the considerations? Provide an Apex approval validator.
Capabilities: Create an approval process on Case with entry criteria (Priority = 'High'), assigning the submitter’s manager as approver, with email alerts and field updates (e.g., Escalated__c = true). Use Cases: SLA enforcement, issue prioritization. Considerations: Manager hierarchy maintenance; performance with frequent submissions; clear error messages. public class CaseApprovalValidator { public static void validateApproval(List cases) { for (Case c : cases) { if (c.Priority == 'High' && !Approval.isLocked(c.Id)) { c.addError('High-priority Cases must be submitted for approval.'); } } } } CTA Case Study: A telecom with 2M Cases needs escalation approvals for 4,000 agents. Propose an approval process versus Apex trigger, evaluating performance, automation integration, and mobile usability for a 6,000-user org.
153
A legal team requires multi-step approval for Contract renewals based on value. How can an approval process meet this, and what are the considerations? Provide an Apex multi-step submission.
Capabilities: Create an approval process on Contract__c with entry criteria (Value__c > 100,000), multiple steps (e.g., Manager, then VP), and conditional field updates. Use Cases: Contract compliance, financial control. Considerations: Complex setup for multi-step; impacts save time; limited dynamic approver logic. public class ContractApproval { @InvocableMethod(label='Submit Contract for Approval' description='Submits Contract for multi-step approval') public static void submitContract(List contractIds) { for (Id contractId : contractIds) { Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest(); req.setObjectId(contractId); req.setNextApproverIds(new List{[SELECT ManagerId FROM User WHERE Id = :UserInfo.getUserId()].ManagerId}); Approval.process(req); } } } CTA Case Study: A law firm with 100,000 Contracts needs multi-step approvals for 2,000 users. Design an approval process versus Apex with Flow, addressing scalability, auditability, and user training for a 4,000-user org.
154
A finance team needs approval for Expense Reports over $1,000. How can an approval process address this, and what are the considerations? Provide an Apex approval status updater.
Capabilities: Create an approval process on Expense_Report__c with entry criteria (Amount__c > 1000), specifying approvers, email notifications, and field updates (e.g., Status__c). Use Cases: Expense control, budget compliance. Considerations: Clear approval paths; performance with high volume; user notifications. public class ExpenseApprovalUpdater { public static void updateApprovalStatus(List reports) { for (Expense_Report__c report : reports) { if (Approval.isLocked(report.Id)) { report.Status__c = 'In Approval'; } else if (report.Approval_Status__c == 'Approved') { report.Status__c = 'Approved'; } } update reports; } } CTA Case Study: A corporation with 50,000 Expense Reports needs approvals for 3,000 users. Propose an approval process versus Apex solution, justifying performance, reporting integration, and mobile access for a 5,000-user org.
155
A firm requires approval for Project Budgets exceeding $500,000. How can an approval process meet this, and what are the considerations? Provide an Apex budget validator.
Capabilities: Create an approval process on Project__c with entry criteria (Budget__c > 500,000), dynamic approver assignment, and field updates (e.g., Budget_Approved__c). Use Cases: Budget oversight, resource allocation. Considerations: Dynamic routing limitations; impacts save performance; user training needed. public class ProjectBudgetValidator { public static void validateBudgetApproval(List projects) { for (Project__c p : projects) { if (p.Budget__c > 500000 && !Approval.isLocked(p.Id)) { p.addError('Budgets over $500,000 must be submitted for approval.'); } } } } CTA Case Study: A consulting firm with 20,000 Projects needs budget approvals for 1,500 users. Design an approval process versus Apex trigger, evaluating scalability, automation, and audit trails for a 3,000-user org.
156
An HR team needs approval for Employee Time-Off Requests. How can an approval process address this, and what are the considerations? Provide an Apex request submitter.
Capabilities: Create an approval process on Time_Off_Request__c with entry criteria (e.g., Days_Requested__c > 5), assigning HR as approver, with email alerts. Use Cases: Leave management, compliance. Considerations: Approval queue management; impacts user experience; limited conditional logic. public class TimeOffSubmitter { @InvocableMethod(label='Submit Time-Off Request' description='Submits Time-Off Request for approval') public static void submitRequest(List requestIds) { for (Id reqId : requestIds) { Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest(); req.setObjectId(reqId); Approval.process(req); } } } CTA Case Study: A corporation with 50,000 Employees needs time-off approvals for 2,000 HR users. Propose an approval process versus Apex with Flow, addressing user experience, scalability, and mobile access for a 4,000-user org.
157
A sales team needs approval for Opportunity Discounts over 20%. How can an approval process meet this, and what are the considerations? Provide an Apex discount validator.
Capabilities: Create an approval process on Opportunity with entry criteria (Discount__c > 20), specifying Sales Manager as approver, with field updates (e.g., Discount_Approved__c). Use Cases: Pricing control, revenue protection. Considerations: Dynamic approver limitations; performance with frequent submissions; clear notifications. public class DiscountValidator { public static void validateDiscount(List opps) { for (Opportunity opp : opps) { if (opp.Discount__c > 20 && !Approval.isLocked(opp.Id)) { opp.addError('Discounts over 20% require approval.'); } } } } CTA Case Study: A retailer with 500,000 Opportunities needs discount approvals for 4,000 reps. Design an approval process versus Apex solution, justifying performance, reporting, and user training for a 6,000-user org.
158
A procurement team needs multi-step approval for Vendor Contracts based on value. How can an approval process address this, and what are the considerations? Provide an Apex multi-step handler.
Answer: Capabilities: Create an approval process on Vendor_Contract__c with entry criteria (Value__c > 50,000), multiple steps (e.g., Manager, then Finance), and automated actions. Use Cases: Vendor management, compliance. Considerations: Complex setup; performance impact; limited dynamic routing. public class VendorContractApproval { @InvocableMethod(label='Submit Vendor Contract' description='Submits Vendor Contract for approval') public static void submitContract(List contractIds) { for (Id contractId : contractIds) { Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest(); req.setObjectId(contractId); req.setNextApproverIds(new List{[SELECT Id FROM User WHERE Title = 'Finance Director' LIMIT 1].Id}); Approval.process(req); } } } CTA Case Study: A manufacturer with 100,000 Vendor Contracts needs multi-step approvals for 2,000 users. Propose an approval process versus Apex with Flow, evaluating auditability, scalability, and integration for a 5,000-user org.
159
A marketing team needs approval for Campaign Budgets over $100,000. How can an approval process meet this, and what are the considerations? Provide an Apex budget submitter.
Capabilities: Create an approval process on Campaign with entry criteria (BudgetedCost > 100,000), assigning Marketing Director as approver, with email alerts. Use Cases: Marketing spend control, ROI tracking. Considerations: Approval bottlenecks; impacts save time; clear user guidance. public class CampaignBudgetSubmitter { @InvocableMethod(label='Submit Campaign Budget' description='Submits Campaign for approval') public static void submitCampaign(List campaignIds) { for (Id campId : campaignIds) { Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest(); req.setObjectId(campId); Approval.process(req); } } } CTA Case Study: A marketing firm with 10,000 Campaigns needs budget approvals for 1,500 users. Design an approval process versus Apex solution, addressing performance, reporting integration, and user experience for a 3,000-user org.
160
A maintenance team needs approval for high-cost Asset repairs. How can an approval process address this, and what are the considerations? Provide an Apex approval status checker.
Capabilities: Create an approval process on Maintenance_Record__c with entry criteria (Cost__c > 10,000), assigning Manager as approver, with field updates (e.g., Approved__c). Use Cases: Cost control, asset management. Considerations: Performance with high volume; user notifications; limited dynamic logic. public class MaintenanceApprovalChecker { public static void checkApprovalStatus(List records) { for (Maintenance_Record__c rec : records) { if (rec.Cost__c > 10000 && !Approval.isLocked(rec.Id)) { rec.addError('Repairs over $10,000 must be submitted for approval.'); } } } } CTA Case Study: A manufacturer with 200,000 Maintenance Records needs repair approvals for 1,000 technicians. Propose an approval process versus Apex with Flow, justifying scalability, mobile usability, and audit trails for a 4,000-user org.
161
A sales team needs to automatically update Opportunity Stage to "Negotiation" when Amount exceeds $100,000. What tool meets this requirement, and why? Provide an Apex alternative.
Tool: Flow (Record-Triggered) to update Opportunity Stage based on Amount > 100,000. Reason: Declarative, scalable, and supports simple field updates. Considerations: Governor limits; user training; limited complex logic. Apex Alternative: Trigger for custom logic. trigger OpportunityStageUpdate on Opportunity (before update) { for (Opportunity opp : Trigger.new) { if (opp.Amount > 100000) { opp.StageName = 'Negotiation'; } } } CTA Case Study: A tech firm with 1M Opportunities needs automated stage updates for 5,000 reps. Design a Flow-based solution versus Apex trigger, justifying scalability, performance, and maintenance for a 7,000-user org.
162
A support team requires a Reason field for closed Cases. What tool enforces this, and why? Provide an Apex validation snippet.
Answer: Tool: Validation Rule on Case: AND(Status = "Closed", ISBLANK(Reason)). Reason: Ensures data integrity declaratively; user-friendly errors. Considerations: Clear error messaging; impacts save time; no cross-object logic. public class CaseReasonValidator { public static void validateReason(List cases) { for (Case c : cases) { if (c.Status == 'Closed' && String.isBlank(c.Reason)) { c.addError('Closed Cases require a Reason.'); } } } } CTA Case Study: A telecom with 2M Cases needs mandatory field enforcement for 4,000 agents. Propose a Validation Rule versus Apex trigger, evaluating data quality, performance, and user experience for a 6,000-user org.
163
A sales manager needs a dashboard showing Opportunity metrics by region. What tool meets this requirement, and why? Provide an Apex data feed snippet.
Tool: Lightning Dashboard Builder with reports grouped by Region__c. Reason: Declarative; supports charts, tables, and filters; mobile-friendly. Considerations: Report limits (2,000 rows); data refresh delays; user access control. public class RegionMetrics { @AuraEnabled(cacheable=true) public static Map getRegionTotals() { Map totals = new Map(); for (AggregateResult ar : [SELECT Region__c, SUM(Amount) total FROM Opportunity GROUP BY Region__c]) { totals.put((String)ar.get('Region__c'), (Decimal)ar.get('total')); } return totals; } } CTA Case Study: A retailer with 500,000 Opportunities needs regional dashboards for 3,000 users. Design a Dashboard versus Apex with LWC, justifying visualization, performance, and scalability for a 5,000-user org.
164
A legal team needs manager approval for Contracts over $50,000. What tool meets this, and why? Provide an Apex approval submitter.
Tool: Approval Process on Contract__c with entry criteria (Value__c > 50000), assigning Manager as approver. Reason: Declarative; supports multi-step approvals, email alerts. Considerations: Limited dynamic routing; performance with high volume; user training. public class ContractApprovalSubmitter { @InvocableMethod(label='Submit Contract' description='Submits Contract for approval') public static void submitContract(List contractIds) { for (Id contractId : contractIds) { Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest(); req.setObjectId(contractId); Approval.process(req); } } } CTA Case Study: A law firm with 100,000 Contracts needs approvals for 2,000 users. Propose an Approval Process versus Apex with Flow, evaluating auditability, scalability, and user experience for a 4,000-user org.
165
A marketing team needs a Task created for new Leads with Source = "Web". What tool meets this requirement, and why? Provide an Apex task creator.
Tool: Flow (Record-Triggered) to create a Task when Lead.Source = "Web". Reason: Declarative; supports record creation; integrates with mobile. Considerations: Governor limits; error handling; Flow complexity for large datasets. public class LeadTaskCreator { public static void createTasks(List leads) { List tasks = new List(); for (Lead l : leads) { if (l.Source == 'Web') { tasks.add(new Task(WhoId = l.Id, Subject = 'Follow Up', ActivityDate = Date.today().addDays(3))); } } insert tasks; } } CTA Case Study: A marketing firm with 1M Leads needs automated task creation for 3,000 users. Design a Flow versus Apex solution, justifying automation, performance, and scalability for a 5,000-user org.
166
A retailer needs to display real-time Product data from an ERP in Salesforce. What tool meets this, and why? Provide an Apex external query snippet.
Tool: Salesforce Connect with External Objects via OData. Reason: Real-time access without data duplication; supports lookups and reporting. Considerations: Licensing costs; external system performance; limited write-back. public class ExternalProductQuery { @AuraEnabled(cacheable=true) public static List getProducts() { return [SELECT ExternalId, Name__c, Price__c FROM External_Product__x WHERE Available__c = true LIMIT 50]; } } CTA Case Study: A retailer with 1M Opportunities and 500,000 external Products needs ERP integration for 4,000 users. Propose Salesforce Connect versus Apex callouts, evaluating performance, cost, and reporting for a 6,000-user org.
167
A field sales team needs a mobile-optimized Opportunity page with key fields and actions. What tool meets this, and why? Provide an Apex controller snippet.
Tool: Lightning App Builder to create a mobile-optimized Lightning Record Page. Reason: Declarative; supports dynamic actions, compact layouts; mobile-friendly. Considerations: Limited complex UI logic; user adoption; performance tuning. public class OpportunityMobileController { @AuraEnabled(cacheable=true) public static Opportunity getKeyFields(Id oppId) { return [SELECT Name, Amount, StageName FROM Opportunity WHERE Id = :oppId LIMIT 1]; } } CTA Case Study: A sales org with 500,000 Opportunities needs mobile pages for 5,000 reps. Design a Lightning Page versus Apex with LWC, justifying usability, performance, and offline support for a 7,000-user org.
168
A company needs to import 50,000 Accounts from a CSV file. What tool meets this requirement, and why? Provide an Apex import validator.
Tool: Data Import Wizard. Reason: Declarative; supports up to 50,000 records; handles deduplication and field mapping. Considerations: Data quality; error logging; no automation for recurring imports. public class AccountImportValidator { public static void validateAccounts(List accounts) { for (Account acc : accounts) { if (String.isBlank(acc.Name)) { acc.addError('Account Name is required.'); } } } } CTA Case Study: A financial firm with 200,000 Accounts needs monthly imports for 3,000 users. Propose Data Import Wizard versus Apex with Data Loader, addressing data integrity, automation, and scalability for a 4,000-user org.
169
A sales team needs Chatter notifications for Opportunities over $1M. What tool meets this, and why? Provide an Apex notification snippet.
Tool: Flow (Record-Triggered) to post to Chatter when Amount > 1,000,000. Reason: Declarative; supports feed posts; integrates with mobile. Considerations: Governor limits; user visibility; limited complex logic. public class OpportunityChatterNotifier { public static void postChatter(List opps) { List posts = new List(); for (Opportunity opp : opps) { if (opp.Amount > 1000000) { posts.add(new FeedItem(ParentId = opp.Id, Body = 'High-value Opportunity: $' + opp.Amount, Type = 'TextPost')); } } insert posts; } } CTA Case Study: A tech firm with 300,000 Opportunities needs Chatter alerts for 4,000 reps. Design a Flow versus Apex solution, justifying user engagement, performance, and scalability for a 6,000-user org.
170
A company needs a report combining Account, Contact, and Opportunity data. What tool meets this, and why? Provide an Apex data aggregator.
Tool: Custom Report Type in Setup. Reason: Declarative; supports up to 4 object relationships; enables cross-object reporting. Considerations: Limited to defined relationships; performance with large datasets; user access control. public class CrossObjectData { @AuraEnabled(cacheable=true) public static List getAccountData() { return [SELECT Name, (SELECT LastName FROM Contacts), (SELECT Amount FROM Opportunities) FROM Account LIMIT 50]; } } CTA Case Study: A consulting firm with 500,000 Accounts and 1M Opportunities needs cross-object reporting for 2,000 users. Propose a Custom Report Type versus Apex with LWC, evaluating reporting flexibility, performance, and user adoption for a 5,000-user org.
171
A sales team needs a Task created for Opportunities stagnant in "Prospecting" for 7 days. What automation solution avoids errors, and how? Provide an Apex alternative with error handling.
Solution: Scheduled Flow to check Opportunities daily, creating Tasks if LastModifiedDate < TODAY() - 7 and StageName = "Prospecting". Error Avoidance: Use validation rules to ensure required fields; log errors in a custom object; test with edge cases. Considerations: Governor limits; duplicate task prevention; user notifications. public class OpportunityTaskCreator implements Schedulable { public void execute(SchedulableContext sc) { try { List tasks = new List(); for (Opportunity opp : [SELECT Id, OwnerId FROM Opportunity WHERE StageName = 'Prospecting' AND LastModifiedDate < :Date.today().addDays(-7)]) { tasks.add(new Task(WhatId = opp.Id, OwnerId = opp.OwnerId, Subject = 'Follow Up', ActivityDate = Date.today())); } Database.insert(tasks, false); // Partial success } catch (Exception e) { Error_Log__c log = new Error_Log__c(Error_Message__c = e.getMessage()); insert log; } } } CTA Case Study: A tech firm with 1M Opportunities needs follow-up automation for 5,000 reps. Design a Scheduled Flow versus Apex scheduled job, justifying error handling, scalability, and user experience for a 7,000-user org.
172
A support team needs email notifications for Cases open over 48 hours with Priority = "High". What automation solution prevents errors? Provide an Apex notification with error logging.
Solution: Record-Triggered Flow on Case to send email alerts if CreatedDate < NOW() - 48 hours and Priority = "High". Error Avoidance: Validate email addresses; use custom object for error logs; handle null values. Considerations: Email limits (2,000/day); user visibility; performance with large datasets. public class CaseEscalationNotifier { public static void sendNotifications(List cases) { List emails = new List(); List logs = new List(); for (Case c : cases) { try { if (c.Priority == 'High' && Datetime.now().hour() - c.CreatedDate.hour() > 48) { Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); email.setToAddresses(new String[]{c.Contact.Email}); email.setSubject('Urgent: Case ' + c.CaseNumber); email.setPlainTextBody('Please address Case ' + c.CaseNumber); emails.add(email); } } catch (Exception e) { logs.add(new Error_Log__c(Error_Message__c = e.getMessage(), Record_Id__c = c.Id)); } } Messaging.sendEmail(emails); if (!logs.isEmpty()) insert logs; } } CTA Case Study: A telecom with 2M Cases needs escalation automation for 4,000 agents. Propose a Flow versus Apex solution, evaluating error logging, performance, and compliance for a 6,000-user org.
173
A legal team needs reminders 30 days before Contract End Dates. What automation solution avoids errors? Provide an Apex scheduler with error handling.
Solution: Scheduled Flow to query Contracts where End_Date__c = TODAY() + 30, creating Tasks for owners. Error Avoidance: Validate End_Date__c; log failed Task creations; handle inactive owners. Considerations: Query limits; duplicate reminders; user training. public class ContractRenewalScheduler implements Schedulable { public void execute(SchedulableContext sc) { List tasks = new List(); List logs = new List(); for (Contract__c c : [SELECT Id, OwnerId, End_Date__c FROM Contract__c WHERE End_Date__c = :Date.today().addDays(30)]) { try { tasks.add(new Task(WhatId = c.Id, OwnerId = c.OwnerId, Subject = 'Contract Renewal Due', ActivityDate = Date.today())); } catch (Exception e) { logs.add(new Error_Log__c(Error_Message__c = e.getMessage(), Record_Id__c = c.Id)); } } Database.insert(tasks, false); if (!logs.isEmpty()) insert logs; } } CTA Case Study: A law firm with 100,000 Contracts needs renewal automation for 2,000 users. Design a Scheduled Flow versus Apex scheduled job, justifying error prevention, scalability, and mobile access for a 4,000-user org.
174
A marketing team needs Leads assigned to reps based on Region. What automation solution prevents errors? Provide an Apex assignment handler.
Solution: Lead Assignment Rules triggered via Process Builder or Flow on Lead creation/update. Error Avoidance: Validate Region picklist values; log unassigned Leads; handle inactive users. Considerations: Rule complexity; performance with high volume; user visibility. public class LeadAssignmentHandler { public static void assignLeads(List leads) { List logs = new List(); Map regionToOwner = new Map(); // Populate from custom metadata for (Lead l : leads) { try { if (regionToOwner.containsKey(l.Region__c)) { l.OwnerId = regionToOwner.get(l.Region__c); } else { throw new CustomException('Invalid Region'); } } catch (Exception e) { logs.add(new Error_Log__c(Error_Message__c = e.getMessage(), Record_Id__c = l.Id)); } } if (!logs.isEmpty()) insert logs; update leads; } } CTA Case Study: A marketing firm with 1M Leads needs assignment automation for 3,000 users. Propose Lead Assignment Rules versus Apex trigger, addressing error handling, scalability, and reporting for a 5,000-user org.
175
A sales team needs approval for Opportunities with Discounts over 20%. What automation solution avoids errors? Provide an Apex approval submitter.
Solution: Approval Process on Opportunity with entry criteria (Discount__c > 20), auto-submitted via Flow. Error Avoidance: Validate Discount__c; ensure approver availability; log failed submissions. Considerations: Approval bottlenecks; performance; user training. public class DiscountApprovalSubmitter { @InvocableMethod(label='Submit for Approval' description='Submits Opportunity for discount approval') public static void submitForApproval(List oppIds) { List logs = new List(); for (Id oppId : oppIds) { try { Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest(); req.setObjectId(oppId); Approval.process(req); } catch (Exception e) { logs.add(new Error_Log__c(Error_Message__c = e.getMessage(), Record_Id__c = oppId)); } } if (!logs.isEmpty()) insert logs; } } CTA Case Study: A retailer with 500,000 Opportunities needs discount approval automation for 4,000 reps. Design an Approval Process with Flow versus Apex, justifying error prevention, auditability, and performance for a 6,000-user org.
176
A support team needs Case Status updated to "In Progress" when an agent adds a comment. What automation solution prevents errors? Provide an Apex status updater.
Solution: Record-Triggered Flow on CaseComment to update Case.Status to "In Progress". Error Avoidance: Validate comment content; prevent recursive updates; log failed updates. Considerations: Recursion risks; performance with high volume; user visibility. public class CaseStatusUpdater { public static void updateStatus(List comments) { List casesToUpdate = new List(); List logs = new List(); Set caseIds = new Set(); for (CaseComment cc : comments) caseIds.add(cc.ParentId); Map caseMap = new Map([SELECT Id, Status FROM Case WHERE Id IN :caseIds]); for (CaseComment cc : comments) { try { Case c = caseMap.get(cc.ParentId); if (c.Status != 'In Progress') { c.Status = 'In Progress'; casesToUpdate.add(c); } } catch (Exception e) { logs.add(new Error_Log__c(Error_Message__c = e.getMessage(), Record_Id__c = cc.ParentId)); } } Database.update(casesToUpdate, false); if (!logs.isEmpty()) insert logs; } } CTA Case Study: A healthcare provider with 1M Cases needs status automation for 4,000 agents. Propose a Flow versus Apex trigger, evaluating error handling, scalability, and user experience for an 8,000-user org.
177
A company needs Chatter posts for Accounts with no Opportunities in 90 days. What automation solution avoids errors? Provide an Apex Chatter poster.
Solution: Scheduled Flow to query Accounts and post to Chatter if no related Opportunities exist (Last_Opportunity_Date__c < TODAY() - 90). Error Avoidance: Validate Opportunity relationships; log failed posts; prevent duplicate posts. Considerations: Feed visibility; performance with large datasets; user engagement. public class AccountHealthNotifier implements Schedulable { public void execute(SchedulableContext sc) { List posts = new List(); List logs = new List(); for (Account acc : [SELECT Id FROM Account WHERE Last_Opportunity_Date__c < :Date.today().addDays(-90)]) { try { posts.add(new FeedItem(ParentId = acc.Id, Body = 'No Opportunities in 90 days!', Type = 'TextPost')); } catch (Exception e) { logs.add(new Error_Log__c(Error_Message__c = e.getMessage(), Record_Id__c = acc.Id)); } } Database.insert(posts, false); if (!logs.isEmpty()) insert logs; } } CTA Case Study: A SaaS company with 200,000 Accounts needs health notifications for 3,000 users. Design a Scheduled Flow versus Apex scheduled job, justifying error prevention, performance, and analytics for a 5,000-user org.
178
A logistics firm needs Order Status updated to "Shipped" when Shipped_Date__c is set. What automation solution prevents errors? Provide an Apex status updater.
Solution: Record-Triggered Flow on Order__c to update Status to "Shipped" when Shipped_Date__c != NULL. Error Avoidance: Validate date fields; prevent recursive updates; log errors. Considerations: Recursion risks; integration with external systems; performance. public class OrderStatusUpdater { public static void updateStatus(List orders) { List logs = new List(); for (Order__c ord : orders) { try { if (ord.Shipped_Date__c != null && ord.Status__c != 'Shipped') { ord.Status__c = 'Shipped'; } } catch (Exception e) { logs.add(new Error_Log__c(Error_Message__c = e.getMessage(), Record_Id__c = ord.Id)); } } Database.update(orders, false); if (!logs.isEmpty()) insert logs; } } CTA Case Study: A logistics firm with 1M Orders needs fulfillment automation for 3,000 users. Propose a Flow versus Apex trigger, justifying error handling, integration, and scalability for a 5,000-user org.
179
An HR team needs Tasks created for new Employees (e.g., IT setup, training). What automation solution avoids errors? Provide an Apex task generator.
Record-Triggered Flow on Employee__c to create multiple Tasks on record creation. Error Avoidance: Validate Employee data; ensure owner availability; log failed Task creations. Considerations: Task volume; user notifications; performance with bulk inserts. public class EmployeeOnboardingTasks { public static void createOnboardingTasks(List employees) { List tasks = new List(); List logs = new List(); for (Employee__c emp : employees) { try { tasks.add(new Task(WhatId = emp.Id, OwnerId = emp.IT_Owner__c, Subject = 'IT Setup', ActivityDate = Date.today().addDays(1))); tasks.add(new Task(WhatId = emp.Id, OwnerId = emp.HR_Owner__c, Subject = 'Training', ActivityDate = Date.today().addDays(3))); } catch (Exception e) { logs.add(new Error_Log__c(Error_Message__c = e.getMessage(), Record_Id__c = emp.Id)); } } Database.insert(tasks, false); if (!logs.isEmpty()) insert logs; } } CTA Case Study: A corporation with 50,000 Employees needs onboarding automation for 2,000 HR users. Design a Flow versus Apex solution, addressing error prevention, scalability, and user experience for a 4,000-user org.
180
A marketing team needs to delete Leads older than 2 years. What automation solution prevents errors? Provide an Apex deletion batch.
Solution: Scheduled Flow to query and delete Leads where CreatedDate < LAST_N_YEARS:2. Error Avoidance: Validate deletion criteria; log deleted records; exclude converted Leads. Considerations: Data loss risks; recycle bin limits; performance with large datasets. public class LeadCleanupBatch implements Database.Batchable { public Database.QueryLocator start(Database.BatchableContext bc) { return Database.getQueryLocator('SELECT Id FROM Lead WHERE CreatedDate < LAST_N_YEARS:2 AND IsConverted = false'); } public void execute(Database.BatchableContext bc, List scope) { List logs = new List(); Database.DeleteResult[] results = Database.delete(scope, false); for (Integer i = 0; i < results.size(); i++) { if (!results[i].isSuccess()) { logs.add(new Error_Log__c(Error_Message__c = results[i].getErrors()[0].getMessage(), Record_Id__c = scope[i].Id)); } } if (!logs.isEmpty()) insert logs; } public void finish(Database.BatchableContext bc) {} } CTA Case Study: A marketing firm with 1M Leads needs cleanup automation for 3,000 users. Propose a Scheduled Flow versus Apex batch job, justifying error handling, compliance, and performance for a 5,000-user org.
181
How can Lightning App Builder customize Opportunity pages for sales reps, and what are the key features? Provide an Apex controller for a custom component.
Capabilities: Lightning App Builder creates Lightning Record Pages with tabs, related lists, and components (e.g., Charts, Chatter). Features: Drag-and-drop interface, profile-specific layouts, mobile optimization. Considerations: Component limits; performance with heavy customization; user adoption. public class OpportunityDetailsController { @AuraEnabled(cacheable=true) public static Opportunity getOpportunityDetails(Id oppId) { return [SELECT Name, Amount, StageName FROM Opportunity WHERE Id = :oppId LIMIT 1]; } } CTA Case Study: A tech firm with 1M Opportunities needs tailored Opportunity pages for 5,000 reps across 10 profiles. Design a Lightning Page solution versus Visualforce, justifying usability, performance, and scalability for a 7,000-user org.
182
How can Compact Layouts enhance mobile views for Cases, and what are the customization options? Provide an Apex data fetcher for mobile.
Capabilities: Compact Layouts define key fields (up to 10) for record highlights in the Salesforce mobile app. Features: Supports standard/custom fields; profile-specific assignments. Considerations: Limited field count; impacts mobile load time; user training. public class CaseMobileController { @AuraEnabled(cacheable=true) public static Case getCaseHighlights(Id caseId) { return [SELECT CaseNumber, Priority, Status FROM Case WHERE Id = :caseId LIMIT 1]; } } CTA Case Study: A telecom with 2M Cases needs mobile-optimized views for 4,000 agents. Propose Compact Layouts versus LWC with Apex, evaluating load times, mobile usability, and offline support for a 6,000-user org.
183
How can Dynamic Forms customize Account pages for dynamic field visibility? Provide an Apex controller for dynamic field logic.
Capabilities: Dynamic Forms enable field-level customization on Lightning Record Pages, with visibility rules based on filters. Features: Field sections, conditional visibility, mobile support. Considerations: Limited to certain objects; performance with complex rules; user training. public class AccountDynamicController { @AuraEnabled(cacheable=true) public static Map getFieldVisibility(Id accountId) { Account acc = [SELECT Industry FROM Account WHERE Id = :accountId]; return new Map{'Custom_Field__c' => acc.Industry == 'Tech'}; } } CTA Case Study: A financial firm with 500,000 Accounts needs dynamic field visibility for 3,000 users across 20 profiles. Design a Dynamic Forms solution versus LWC with Apex, justifying flexibility, performance, and maintenance for a 5,000-user org.
184
How can Global Quick Actions streamline Task creation across objects, and what are the customization options? Provide an Apex action handler.
Capabilities: Global Quick Actions create records (e.g., Task) from any page via the Global Publisher Layout. Features: Supports predefined fields, mobile access, custom objects. Considerations: Limited complex logic; impacts global layout; user adoption. public class TaskActionHandler { @InvocableMethod(label='Create Task' description='Creates a Task from any object') public static void createTask(List recordIds) { List tasks = new List(); for (Id recordId : recordIds) { tasks.add(new Task(WhatId = recordId, Subject = 'Follow Up', ActivityDate = Date.today().addDays(3))); } insert tasks; } } CTA Case Study: A sales org with 10,000 users needs a global Task creation system for 50 objects. Propose Global Quick Actions versus Apex with Flow, addressing usability, scalability, and mobile support for a 7,000-user org.
185
How can Object-Specific Quick Actions enhance Lead conversion, and what are the customization options? Provide an Apex conversion handler.
Capabilities: Object-Specific Quick Actions on Lead (e.g., "Convert Lead") trigger record creation or updates with predefined fields. Features: Supports field mapping, mobile access, automation integration. Considerations: Object-specific scope; performance with complex logic; user training. public class LeadConverter { @InvocableMethod(label='Convert Lead' description='Converts a Lead to Contact and Opportunity') public static void convertLead(List leadIds) { for (Id leadId : leadIds) { Database.LeadConvert lc = new Database.LeadConvert(); lc.setLeadId(leadId); lc.setConvertedStatus('Qualified'); Database.convertLead(lc); } } } CTA Case Study: A marketing firm with 1M Leads needs streamlined conversion for 3,000 users. Design an Object-Specific Action versus Apex solution, justifying automation integration, performance, and user experience for a 5,000-user org.
186
How can Custom Tabs improve navigation for a Project object, and what are the customization options? Provide an Apex data provider for a tab component.
Capabilities: Custom Tabs provide navigation to custom objects, Visualforce, or Lightning pages. Features: Supports tab styles, profile visibility, mobile access. Considerations: Clutters navigation bar; impacts load time; user training needed. public class ProjectTabController { @AuraEnabled(cacheable=true) public static List getRecentProjects() { return [SELECT Name, Status__c FROM Project__c ORDER BY CreatedDate DESC LIMIT 10]; } } CTA Case Study: A consulting firm with 20,000 Projects needs intuitive navigation for 2,000 users. Propose Custom Tabs versus Lightning App Builder navigation, evaluating usability, performance, and scalability for a 4,000-user org.
187
How can Lightning Components enhance Opportunity dashboards, and what are the customization options? Provide an Apex controller for a component.
Lightning Components (Aura/LWC) add custom UI elements (e.g., charts, forms) to Lightning Pages. Features: Reusable, dynamic data binding, mobile support. Considerations: Development effort; performance with complex logic; testing required. public class OpportunityDashboardController { @AuraEnabled(cacheable=true) public static Map getStageTotals() { Map totals = new Map(); for (AggregateResult ar : [SELECT StageName, SUM(Amount) total FROM Opportunity GROUP BY StageName]) { totals.put((String)ar.get('StageName'), (Decimal)ar.get('total')); } return totals; } } CTA Case Study: A retailer with 500,000 Opportunities needs custom dashboards for 4,000 users. Design a Lightning Component versus standard Dashboard, justifying visualization, performance, and scalability for a 6,000-user org.
188
How can Dynamic Actions customize Case interactions based on Status? Provide an Apex action visibility controller.
Capabilities: Dynamic Actions on Lightning Record Pages show/hide actions based on record criteria (e.g., Status = "Open"). Features: Conditional logic, mobile support, integration with Flows. Considerations: Limited to Lightning; complex rules impact performance; user training. public class CaseActionController { @AuraEnabled(cacheable=true) public static Boolean canShowAction(Id caseId) { Case c = [SELECT Status FROM Case WHERE Id = :caseId LIMIT 1]; return c.Status == 'Open'; } } A healthcare provider with 1M Cases needs dynamic actions for 4,000 agents. Propose Dynamic Actions versus LWC with Apex, evaluating flexibility, performance, and user experience for an 8,000-user org.
189
How can Visualforce Pages provide custom UI for Account management, and what are the customization options? Provide an Apex controller for a Visualforce page.
Visualforce Pages create custom UI with markup and Apex logic. Features: Supports complex layouts, custom styling, and data manipulation. Considerations: Less mobile-friendly; higher development effort; maintenance overhead compared to Lightning. public class AccountVisualforceController { public List accounts { get; set; } public AccountVisualforceController() { accounts = [SELECT Id, Name, Industry FROM Account LIMIT 50]; } } CTA Case Study: A financial firm with 200,000 Accounts needs a custom UI for 3,000 users. Design a Visualforce versus Lightning Page solution, justifying mobile support, performance, and maintainability for a 5,000-user org.
190
How can the App Home Page be customized for sales reps to show key metrics? Provide an Apex controller for a custom Home component.
Capabilities: Lightning App Builder customizes App Home Pages with components (e.g., Reports, List Views, LWCs). Features: Drag-and-drop layout, profile-specific views, mobile optimization. Considerations: Component limits; performance with multiple components; user adoption. public class SalesHomeController { @AuraEnabled(cacheable=true) public static List getTopOpportunities() { return [SELECT Name, Amount FROM Opportunity WHERE StageName != 'Closed Won' ORDER BY Amount DESC LIMIT 5]; } } CTA Case Study: A sales org with 10,000 users needs a custom Home Page for 50 teams. Propose a Lightning Home Page versus LWC with Apex, addressing usability, performance, and scalability for a 7,000-user org.
191
A sales team needs a button on Opportunity to generate a Quote PDF. What are the capabilities and use cases of a custom button, and how can it be implemented? Provide an Apex snippet for PDF generation.
Capabilities: Custom buttons execute Visualforce pages, JavaScript, or URLs. A Visualforce button on Opportunity can trigger a PDF generation page. Use Cases: Document creation, external navigation, automation triggers. Considerations: Security (XSS for JavaScript); performance; mobile compatibility. Implementation: Create a Visualforce page for PDF rendering and link it via a custom button. public class QuotePDFController { public Id oppId { get; set; } public Opportunity opp { get; set; } public QuotePDFController() { oppId = ApexPages.currentPage().getParameters().get('id'); opp = [SELECT Name, Amount FROM Opportunity WHERE Id = :oppId]; } } CTA Case Study: A tech firm with 1M Opportunities needs Quote PDF generation for 5,000 reps. Design a Visualforce custom button versus LWC with Apex, justifying scalability, mobile support, and performance for a 7,000-user org.
192
A support team needs a link on Case to navigate to an external CRM with Case details. What are the capabilities and use cases of a custom link? Provide an Apex URL generator.
Custom links use URLs with merge fields to navigate to external systems or internal pages. Use Cases: External integrations, report access, record navigation. Considerations: URL security; merge field accuracy; user access. Implementation: Create a custom link on Case: /apex/ExternalCRM?caseId={!Case.Id}. public class ExternalCRMRedirect { public String getRedirectURL() { Id caseId = ApexPages.currentPage().getParameters().get('caseId'); Case c = [SELECT CaseNumber FROM Case WHERE Id = :caseId]; return 'https://crm.example.com/case?number=' + c.CaseNumber; } } CTA Case Study: A telecom with 2M Cases needs external CRM integration for 4,000 agents. Propose a custom link versus LWC with Apex, evaluating security, performance, and user experience for a 6,000-user org.
193
A sales team needs a Quick Action to create Tasks from Accounts. What are the capabilities and use cases of Quick Actions? Provide an Apex action handler.
Capabilities: Quick Actions (Object-Specific) create/update records with predefined fields, support Flows, and integrate with Lightning/mobile. Use Cases: Record creation, field updates, automation triggers. Considerations: Limited complex logic; performance with bulk actions; user training. Implementation: Create an Object-Specific Quick Action on Account to create a Task. public class TaskActionHandler { @InvocableMethod(label='Create Task' description='Creates Task from Account') public static void createTask(List accountIds) { List tasks = new List(); for (Id accId : accountIds) { tasks.add(new Task(WhatId = accId, Subject = 'Follow Up', ActivityDate = Date.today().addDays(3))); } insert tasks; } } CTA Case Study: A retailer with 500,000 Accounts needs Task creation for 3,000 users. Design a Quick Action versus Apex with Flow, justifying usability, scalability, and mobile support for a 5,000-user org.
194
A marketing team needs a button to convert multiple Leads from a list view. What are the capabilities and use cases of a custom button? Provide an Apex conversion handler.
Capabilities: List View custom buttons execute JavaScript or Visualforce for bulk operations. Use Cases: Mass updates, conversions, exports. Considerations: Bulk limits (2,000 records); security risks (JavaScript); user permissions. Implementation: Create a JavaScript button with {!GETRECORDIDS($ObjectType.Lead)}. public class MassLeadConverter { public static void convertLeads(List leadIds) { for (Id leadId : leadIds) { Database.LeadConvert lc = new Database.LeadConvert(); lc.setLeadId(leadId); lc.setConvertedStatus('Qualified'); Database.convertLead(lc); } } } CTA Case Study: A marketing firm with 1M Leads needs mass conversion for 2,000 users. Propose a custom button versus Flow with Apex, evaluating performance, error handling, and scalability for a 4,000-user org.
195
A field team needs a Global Quick Action to create Notes from any object. What are the capabilities and use cases? Provide an Apex note creator.
Capabilities: Global Quick Actions create records (e.g., ContentNote) from any page, added to Global Publisher Layout. Use Cases: Cross-object data entry, mobile collaboration. Considerations: Limited object support; performance with frequent use; user adoption. Implementation: Create a Global Quick Action for ContentNote. public class NoteCreator { @InvocableMethod(label='Create Note' description='Creates a Note from any object') public static void createNote(List recordIds) { List notes = new List(); for (Id recordId : recordIds) { notes.add(new ContentNote(Title = 'New Note', Content = Blob.valueOf('Note content'))); } insert notes; } } CTA Case Study: A logistics firm with 10,000 users needs global note creation for 50 objects. Design a Global Quick Action versus LWC with Apex, addressing mobile usability, performance, and scalability for a 7,000-user org.
196
A sales team needs a link on Opportunity to access a specific revenue report. What are the capabilities and use cases of a custom link? Provide an Apex report URL generator.
Capabilities: Custom links navigate to reports using report IDs and merge fields. Use Cases: Report/dashboard access, external URLs, internal navigation. Considerations: Report visibility; URL stability; user permissions. Implementation: Create a custom link: /00Oxxxxxxxxxxxx?pv0={!Opportunity.Id}. public class ReportLinkGenerator { public String getReportURL(Id oppId) { return '/00Oxxxxxxxxxxxx?pv0=' + oppId; } } CTA Case Study: A sales org with 500,000 Opportunities needs report access for 4,000 reps. Propose a custom link versus LWC with Apex, justifying usability, security, and performance for a 6,000-user org.
197
A support team needs a button to escalate Cases to a manager. What are the capabilities and use cases of a custom button? Provide an Apex escalation handler.
Custom buttons trigger Visualforce, JavaScript, or Apex to perform actions (e.g., update Case fields). Use Cases: Status updates, escalations, integrations. Considerations: Security (JavaScript); performance; mobile limitations. Implementation: Create a Visualforce button to update Case.Status. public class CaseEscalationController { public Id caseId { get; set; } public void escalateCase() { Case c = [SELECT Id, Status, OwnerId FROM Case WHERE Id = :caseId]; c.Status = 'Escalated'; c.OwnerId = [SELECT ManagerId FROM User WHERE Id = :c.OwnerId].ManagerId; update c; } } CTA Case Study: A healthcare provider with 1M Cases needs escalation automation for 4,000 agents. Design a custom button versus Flow with Apex, evaluating performance, error handling, and mobile support for an 8,000-user org.
198
A sales team needs a Quick Action to update Opportunity Stage to "Closed Won". What are the capabilities and use cases? Provide an Apex stage updater.
Capabilities: Object-Specific Quick Actions update records with predefined values, integrate with Flows, and support mobile. Use Cases: Field updates, automation triggers, user efficiency. Considerations: Limited logic; performance with validations; user training. Implementation: Create a Quick Action on Opportunity to set StageName. public class StageUpdater { @InvocableMethod(label='Update Stage' description='Updates Opportunity Stage') public static void updateStage(List oppIds) { List opps = [SELECT Id, StageName FROM Opportunity WHERE Id IN :oppIds]; for (Opportunity opp : opps) { opp.StageName = 'Closed Won'; } update opps; } } CTA Case Study: A B2B firm with 300,000 Opportunities needs stage updates for 3,000 reps. Design a Quick Action versus Apex with Flow, justifying usability, performance, and scalability for a 5,000-user org.
199
A finance team needs a button to export Account data to CSV. What are the capabilities and use cases of a custom button? Provide an Apex export handler.
Capabilities: Custom buttons trigger Visualforce pages or Apex to generate/export data. Use Cases: Data exports, file generation, integrations. Considerations: Data limits (50,000 rows); security; performance with large datasets. Implementation: Create a Visualforce button for CSV export. public class AccountExportController { public String csvContent { get; set; } public AccountExportController() { List accounts = [SELECT Id, Name FROM Account LIMIT 1000]; csvContent = 'Id,Name\n'; for (Account a : accounts) { csvContent += a.Id + ',' + a.Name + '\n'; } } } CTA Case Study: A financial firm with 200,000 Accounts needs data exports for 2,000 users. Design a custom button versus Apex with LWC, evaluating performance, security, and scalability for a 4,000-user org.
200
A marketing team needs a link to post a predefined Chatter message on Leads. What are the capabilities and use cases of a custom link? Provide an Apex Chatter poster.
Capabilities: Custom links trigger URLs to prefill Chatter posts or execute actions. Use Cases: Collaboration prompts, predefined notifications. Considerations: Feed visibility; merge field accuracy; user permissions. Implementation: Create a custom link: /apex/ChatterPost?leadId={!Lead.Id}. public class ChatterPostController { public Id leadId { get; set; } public void postChatter() { FeedItem post = new FeedItem(ParentId = leadId, Body = 'Review this Lead!', Type = 'TextPost'); insert post; } } CTA Case Study: A marketing firm with 1M Leads needs Chatter automation for 3,000 users. Propose a custom link versus Flow with Apex, justifying user engagement, performance, and scalability for a 5,000-user org.
201
A sales team needs a custom Opportunity dashboard component on the record page. What declarative option incorporates a Lightning component, and what are the considerations? Provide an Apex controller.
Option: Lightning App Builder to add a custom Lightning Web Component (LWC) to an Opportunity Lightning Record Page. Capabilities: Drag-and-drop placement, visibility rules, mobile support. Considerations: Component compatibility; performance with complex logic; user training. public class OpportunityDashboardController { @AuraEnabled(cacheable=true) public static Map getStageTotals(Id oppId) { Map totals = new Map(); for (AggregateResult ar : [SELECT StageName, SUM(Amount) total FROM Opportunity WHERE AccountId = :[SELECT AccountId FROM Opportunity WHERE Id = :oppId].AccountId GROUP BY StageName]) { totals.put((String)ar.get('StageName'), (Decimal)ar.get('total')); } return totals; } } CTA Case Study: A tech firm with 1M Opportunities needs custom dashboards for 5,000 reps. Design a Lightning Record Page with LWC versus standard components, justifying performance, usability, and scalability for a 7,000-user org.
202
A support team needs a persistent Case lookup tool across the app. What declarative option incorporates a Lightning component, and what are the considerations? Provide an Apex lookup controller.
Option: Add a custom LWC to the Utility Bar via Lightning App Builder. Capabilities: Persistent access, background utilities, mobile support. Considerations: Limited Utility Bar space; performance impact; user adoption. public class CaseLookupController { @AuraEnabled(cacheable=true) public static List searchCases(String searchTerm) { String query = '%' + searchTerm + '%'; return [SELECT CaseNumber, Subject FROM Case WHERE Subject LIKE :query LIMIT 10]; } } CTA Case Study: A telecom with 2M Cases needs a Case lookup tool for 4,000 agents. Propose a Utility Bar LWC versus a custom tab, evaluating accessibility, performance, and mobile usability for a 6,000-user org.
203
A marketing team needs a Lead scoring component triggered by a Flow. What declarative option incorporates a Lightning component, and what are the considerations? Provide an Apex scoring controller.
Option: Embed an LWC in a Flow using the Lightning Component element. Capabilities: Dynamic data display, user input, Flow variable integration. Considerations: Flow performance; component compatibility; debugging complexity. public class LeadScoringController { @AuraEnabled public static Decimal calculateScore(Id leadId) { Lead l = [SELECT AnnualRevenue, NumberOfEmployees FROM Lead WHERE Id = :leadId]; return (l.AnnualRevenue / 10000) + (l.NumberOfEmployees / 10); } } CTA Case Study: A marketing firm with 1M Leads needs scoring automation for 3,000 users. Design a Flow with LWC versus Apex-driven Flow, justifying scalability, user interaction, and error handling for a 5,000-user org.
204
A company needs a partner portal with a custom Opportunity tracker. What declarative option incorporates a Lightning component, and what are the considerations? Provide an Apex tracker controller.
Option: Experience Builder (Community Builder) to add an LWC to a Community Page. Capabilities: Custom branding, external user support, responsive design. Considerations: Licensing costs; performance for external users; security settings. public class OpportunityTrackerController { @AuraEnabled(cacheable=true) public static List getPartnerOpportunities(Id userId) { return [SELECT Name, Amount FROM Opportunity WHERE AccountId IN (SELECT AccountId FROM User WHERE Id = :userId) LIMIT 50]; } } CTA Case Study: A manufacturer with 10,000 partners needs a portal for 500,000 Opportunities. Propose an Experience Builder LWC versus Visualforce, evaluating security, scalability, and external user experience for a 4,000-user org.
205
A sales team needs a custom Home Page component for top Opportunities. What declarative option incorporates a Lightning component, and what are the considerations? Provide an Apex data provider.
Option: Lightning App Builder to add an LWC to the App Home Page. Capabilities: Custom metrics, profile-specific views, mobile support. Considerations: Component limits; performance with multiple components; user adoption. public class TopOpportunitiesController { @AuraEnabled(cacheable=true) public static List getTopOpportunities() { return [SELECT Name, Amount FROM Opportunity WHERE StageName != 'Closed Won' ORDER BY Amount DESC LIMIT 5]; } } CTA Case Study: A sales org with 500,000 Opportunities needs a Home Page for 5,000 reps. Design an App Home Page with LWC versus standard components, justifying usability, performance, and scalability for a 7,000-user org.
206
A support team needs a Quick Action to display Case history in a custom UI. What declarative option incorporates a Lightning component, and what are the considerations? Provide an Apex history controller.
Option: Create a Lightning Component Quick Action on Case via Lightning App Builder. Capabilities: Custom UI, record context, mobile support. Considerations: Development effort; performance with complex logic; user training. public class CaseHistoryController { @AuraEnabled(cacheable=true) public static List getCaseHistory(Id caseId) { return [SELECT Field, OldValue, NewValue FROM CaseHistory WHERE CaseId = :caseId ORDER BY CreatedDate DESC LIMIT 10]; } } CTA Case Study: A healthcare provider with 1M Cases needs custom history UI for 4,000 agents. Propose a Quick Action LWC versus Flow with LWC, evaluating usability, performance, and scalability for an 8,000-user org.
207
A project team needs a custom tab for Project analytics. What declarative option incorporates a Lightning component, and what are the considerations? Provide an Apex analytics controller.
Option: Lightning App Builder to create a Lightning Page Tab with an LWC. Capabilities: Custom analytics, tab-specific layout, mobile support. Considerations: Navigation clutter; performance with data-heavy components; user permissions. public class ProjectAnalyticsController { @AuraEnabled(cacheable=true) public static Map getProjectStatusCounts() { Map counts = new Map(); for (AggregateResult ar : [SELECT Status__c, COUNT(Id) cnt FROM Project__c GROUP BY Status__c]) { counts.put((String)ar.get('Status__c'), (Integer)ar.get('cnt')); } return counts; } } CTA Case Study: A consulting firm with 20,000 Projects needs analytics tabs for 2,000 users. Design a Lightning Page Tab with LWC versus Visualforce, justifying visualization, performance, and scalability for a 4,000-user org.
208
A finance team needs an embedded component to show Account payment history. What declarative option incorporates a Lightning component, and what are the considerations? Provide an Apex payment controller.
Option: Lightning App Builder to embed an LWC in the Account Record Detail section. Capabilities: Contextual data display, dynamic UI, mobile support. Considerations: Page load impact; component compatibility; user training. public class PaymentHistoryController { @AuraEnabled(cacheable=true) public static List getPaymentHistory(Id accountId) { return [SELECT Amount__c, Payment_Date__c FROM Payment__c WHERE Account__c = :accountId ORDER BY Payment_Date__c DESC LIMIT 10]; } } CTA Case Study: A financial firm with 200,000 Accounts needs payment history UI for 3,000 users. Propose an embedded LWC versus Visualforce, evaluating performance, usability, and integration for a 5,000-user org.
209
A sales team needs a guided Flow to update Opportunity details with a custom UI. What declarative option incorporates a Lightning component, and what are the considerations? Provide an Apex data updater.
Option: Embed an LWC in a Flow Screen using Lightning App Builder. Capabilities: Interactive UI, Flow variable binding, mobile support. Considerations: Flow complexity; performance with multiple components; debugging effort. public class OpportunityUpdater { @AuraEnabled public static void updateOpportunity(Id oppId, Decimal amount) { Opportunity opp = [SELECT Id, Amount FROM Opportunity WHERE Id = :oppId]; opp.Amount = amount; update opp; } } CTA Case Study: A sales org with 300,000 Opportunities needs guided updates for 4,000 reps. Design a Flow with LWC versus Apex-driven Flow, justifying user experience, scalability, and error handling for a 6,000-user org.
210
A support team needs a persistent calculator for Case cost estimates. What declarative option incorporates a Lightning component, and what are the considerations? Provide an Apex calculator controller.
Option: Add an LWC to the Utility Bar via Lightning App Builder. Capabilities: Persistent access, dynamic calculations, mobile support. Considerations: Utility Bar space; performance with complex logic; user adoption. public class CostCalculatorController { @AuraEnabled public static Decimal calculateCost(Id caseId) { Case c = [SELECT Priority, Estimated_Hours__c FROM Case WHERE Id = :caseId]; Decimal rate = c.Priority == 'High' ? 100 : 50; return c.Estimated_Hours__c * rate; } } CTA Case Study: A healthcare provider with 1M Cases needs a cost calculator for 4,000 agents. Propose a Utility Bar LWC versus a custom page, evaluating accessibility, performance, and scalability for an 8,000-user org.
211
How can a custom LWC display an Opportunity dashboard with aggregated data, and what programmatic customizations are needed? Provide an Apex controller.
Programmatic Customization: Create an LWC with an Apex controller to fetch aggregated Opportunity data (e.g., stage totals). Use @wire for data binding. Capabilities: Dynamic data visualization, real-time updates, mobile support. Considerations: Governor limits, caching, security (WITH SECURITY_ENFORCED). Implementation: Deploy LWC to Lightning App Builder. public with sharing class OpportunityDashboardController { @AuraEnabled(cacheable=true) public static Map getStageTotals() { Map totals = new Map(); for (AggregateResult ar : [SELECT StageName, SUM(Amount) total FROM Opportunity WHERE Amount != null WITH SECURITY_ENFORCED GROUP BY StageName]) { totals.put((String)ar.get('StageName'), (Decimal)ar.get('total')); } return totals; } } CTA Case Study: A tech firm with 1M Opportunities needs a custom dashboard for 5,000 reps. Design an LWC with Apex versus standard dashboards, justifying performance, scalability, and user experience for a 7,000-user org.
212
How can a custom LWC provide a Case search utility in the Utility Bar, and what programmatic customizations are required? Provide an Apex search controller.
Programmatic Customization: Build an LWC with an Apex controller for SOSL search, integrated into the Utility Bar via Lightning App Builder. Capabilities: Real-time search, mobile access, user-specific results. Considerations: SOSL limits, input sanitization, performance. Implementation: Use @wire for search results. public with sharing class CaseSearchController { @AuraEnabled(cacheable=true) public static List searchCases(String searchTerm) { String query = '%' + String.escapeSingleQuotes(searchTerm) + '%'; return [FIND :searchTerm IN ALL FIELDS RETURNING Case(CaseNumber, Subject WHERE Subject LIKE :query LIMIT 10)][0]; } } CTA Case Study: A telecom with 2M Cases needs a search utility for 4,000 agents. Propose an LWC in Utility Bar versus a custom page, evaluating performance, accessibility, and mobile support for a 6,000-user org.
213
How can a custom LWC in a Flow provide interactive Lead scoring, and what programmatic customizations are needed? Provide an Apex scoring controller.
Programmatic Customization: Create an LWC for Flow Screen with input/output properties, using an Apex controller for scoring logic. Capabilities: Interactive UI, Flow variable integration, dynamic calculations. Considerations: Flow performance, input validation, error handling. Implementation: Embed LWC in Flow Screen. public with sharing class LeadScoringController { @AuraEnabled public static Decimal calculateScore(Id leadId) { Lead l = [SELECT AnnualRevenue, NumberOfEmployees FROM Lead WHERE Id = :leadId WITH SECURITY_ENFORCED]; return (l.AnnualRevenue != null ? l.AnnualRevenue / 10000 : 0) + (l.NumberOfEmployees != null ? l.NumberOfEmployees / 10 : 0); } } CTA Case Study: A marketing firm with 1M Leads needs interactive scoring for 3,000 users. Design an LWC in Flow versus Apex-driven Flow, justifying usability, scalability, and error handling for a 5,000-user org.
214
How can a custom LWC provide an Opportunity tracker for a partner portal, and what programmatic customizations are required? Provide an Apex tracker controller.
Programmatic Customization: Build an LWC with an Apex controller for partner-specific Opportunity data, deployed via Experience Builder. Capabilities: Secure data access, responsive design, external user support. Considerations: Sharing rules, licensing costs, performance. Implementation: Add LWC to Community Page. public with sharing class OpportunityTrackerController { @AuraEnabled(cacheable=true) public static List getPartnerOpportunities() { Id userId = UserInfo.getUserId(); return [SELECT Name, Amount, StageName FROM Opportunity WHERE AccountId IN (SELECT AccountId FROM User WHERE Id = :userId) WITH SECURITY_ENFORCED LIMIT 50]; } } CTA Case Study: A manufacturer with 10,000 partners needs a portal for 500,000 Opportunities. Propose an LWC in Experience Builder versus Visualforce, evaluating security, scalability, and external user experience for a 4,000-user org.
215
How can a custom LWC display key metrics on the App Home Page, and what programmatic customizations are needed? Provide an Apex metrics controller.
Programmatic Customization: Create an LWC with an Apex controller for aggregated metrics, added to the Home Page via Lightning App Builder. Capabilities: Dynamic visuals, profile-specific data, mobile support. Considerations: Component limits, caching, performance. Implementation: Use @wire for data binding. public with sharing class HomeMetricsController { @AuraEnabled(cacheable=true) public static Map getOpportunityCounts() { Map counts = new Map(); for (AggregateResult ar : [SELECT StageName, COUNT(Id) cnt FROM Opportunity GROUP BY StageName WITH SECURITY_ENFORCED]) { counts.put((String)ar.get('StageName'), (Integer)ar.get('cnt')); } return counts; } } CTA Case Study: A sales org with 500,000 Opportunities needs a Home Page for 5,000 reps. Design an LWC versus standard Home components, justifying visualization, performance, and scalability for a 7,000-user org.
216
How can a custom LWC enhance a Quick Action for Case updates, and what programmatic customizations are required? Provide an Apex update controller.
Programmatic Customization: Build an LWC for a Lightning Component Quick Action with an Apex controller for Case updates. Capabilities: Custom UI, record context, mobile support. Considerations: Action performance, input validation, error handling. Implementation: Deploy via Quick Action in Lightning App Builder. public with sharing class CaseUpdateController { @AuraEnabled public static void updateCase(Id caseId, String status) { Case c = [SELECT Id, Status FROM Case WHERE Id = :caseId WITH SECURITY_ENFORCED]; c.Status = status; update c; } } CTA Case Study: A healthcare provider with 1M Cases needs custom update UI for 4,000 agents. Propose an LWC Quick Action versus Flow, evaluating usability, performance, and scalability for an 8,000-user org.
217
How can a custom LWC provide Project analytics in a custom tab, and what programmatic customizations are needed? Provide an Apex analytics controller.
Programmatic Customization: Create an LWC with an Apex controller for analytics, deployed as a Lightning Page Tab. Capabilities: Custom charts, dynamic data, mobile support. Considerations: Navigation clutter, performance, user permissions. Implementation: Add LWC to Lightning Page Tab. public with sharing class ProjectAnalyticsController { @AuraEnabled(cacheable=true) public static Map getProjectBudgets() { Map budgets = new Map(); for (AggregateResult ar : [SELECT Status__c, SUM(Budget__c) total FROM Project__c GROUP BY Status__c WITH SECURITY_ENFORCED]) { budgets.put((String)ar.get('Status__c'), (Decimal)ar.get('total')); } return budgets; } } CTA Case Study: A consulting firm with 20,000 Projects needs analytics tabs for 2,000 users. Design an LWC Tab versus Visualforce, justifying visualization, performance, and scalability for a 4,000-user org.
218
How can a custom LWC display dynamic Account details, and what programmatic customizations are required? Provide an Apex detail controller.
Programmatic Customization: Build an LWC with an Apex controller for dynamic Account data, added to Record Page via Lightning App Builder. Capabilities: Conditional field display, real-time updates, mobile support. Considerations: Query limits, security, performance. Implementation: Use Lightning Data Service or Apex. public with sharing class AccountDetailController { @AuraEnabled(cacheable=true) public static Account getAccountDetails(Id accountId) { return [SELECT Name, Industry, AnnualRevenue FROM Account WHERE Id = :accountId WITH SECURITY_ENFORCED LIMIT 1]; } } CTA Case Study: A financial firm with 200,000 Accounts needs dynamic detail UI for 3,000 users. Propose an LWC versus Dynamic Forms, evaluating flexibility, performance, and maintainability for a 5,000-user org.
219
How can a custom LWC enhance a Flow-guided Opportunity process, and what programmatic customizations are needed? Provide an Apex process controller.
Programmatic Customization: Create an LWC with input/output properties for Flow Screen, using an Apex controller for process logic. Capabilities: Interactive UI, Flow integration, mobile support. Considerations: Flow complexity, validation, error handling. Implementation: Embed LWC in Flow Screen. public with sharing class OpportunityProcessController { @AuraEnabled public static void updateOpportunity(Id oppId, String stage) { Opportunity opp = [SELECT Id, StageName FROM Opportunity WHERE Id = :oppId WITH SECURITY_ENFORCED]; opp.StageName = stage; update opp; } } CTA Case Study: A sales org with 300,000 Opportunities needs guided processes for 4,000 reps. Design an LWC in Flow versus Apex-driven Flow, justifying usability, scalability, and error handling for a 6,000-user org.
220
How can a custom LWC sync real-time Case data with an external system, and what programmatic customizations are required? Provide an Apex sync controller.
Programmatic Customization: Build an LWC with an Apex controller for HTTP callouts to sync Case data, added to a Lightning Page. Capabilities: Real-time integration, dynamic updates, mobile support. Considerations: Callout limits, security (Named Credentials), performance. Implementation: Use @wire or imperative Apex calls. public with sharing class CaseSyncController { @AuraEnabled public static void syncCase(Id caseId) { Case c = [SELECT CaseNumber, Subject FROM Case WHERE Id = :caseId WITH SECURITY_ENFORCED]; HttpRequest req = new HttpRequest(); req.setEndpoint('callout:ExternalSystem/case'); req.setMethod('POST'); req.setBody(JSON.serialize(c)); new Http().send(req); } } CTA Case Study: A healthcare provider with 1M Cases needs real-time external sync for 4,000 agents. Propose an LWC with Apex versus Salesforce Connect, evaluating performance, security, and scalability for an 8,000-user org.
221
A sales team needs a new Opportunity tracking app. What milestones and sandbox type are recommended, and what are the considerations? Provide an Apex test snippet.
Milestones: Gather requirements (fields, automation), design solution, prototype in sandbox. Sandbox: Developer Sandbox for initial prototyping. Capabilities: 200 MB data storage, supports code/config. Considerations: Limited data; daily refresh; no production data. @isTest private class OpportunityTrackerTest { @isTest static void testOpportunityCreation() { Account acc = new Account(Name = 'Test Account'); insert acc; Opportunity opp = new Opportunity(Name = 'Test Opp', AccountId = acc.Id, StageName = 'Prospecting', CloseDate = Date.today().addDays(30)); insert opp; System.assertEquals('Prospecting', [SELECT StageName FROM Opportunity WHERE Id = :opp.Id].StageName); } } CTA Case Study: A tech firm with 1M Opportunities needs a new tracking app for 5,000 reps. Design an ALM process using Developer Sandboxes, justifying milestones, data needs, and scalability for a 7,000-user org.
222
A support team needs a Case escalation automation solution. What milestones and sandbox type are recommended, and what are the considerations? Provide an Apex automation snippet.
Milestones: Develop automation (Flow/Apex), unit test, validate in sandbox. Sandbox: Developer Pro Sandbox for larger data testing. Capabilities: 1 GB data storage, supports complex automation. Considerations: Monthly refresh; limited production data; test data creation needed. public class CaseEscalation { public static void escalateCases(List cases) { for (Case c : cases) { if (c.Priority == 'High' && c.CreatedDate < Datetime.now().addHours(-48)) { c.Status = 'Escalated'; } } update cases; } } CTA Case Study: A telecom with 2M Cases needs escalation automation for 4,000 agents. Propose an ALM process using Developer Pro Sandboxes, addressing development, testing, and performance for a 6,000-user org.
223
A marketing team needs a Lead scoring app. What milestones and sandbox type are recommended for testing, and what are the considerations? Provide an Apex test class.
Milestones: Functional testing, integration testing, user acceptance testing (UAT). Sandbox: Partial Copy Sandbox for realistic data testing. Capabilities: 5 GB data storage, partial production data copy. Considerations: 29-day refresh; data sampling limits; security for sensitive data. @isTest private class LeadScoringTest { @isTest static void testLeadScoring() { Lead l = new Lead(LastName = 'Test', l = Lead__c, AnnualRevenue = 100000); insert l; LeadScoring.calculateScore(new List{l.Id}); System.assert([SELECT Score__c FROM Lead__c WHERE Id = :l.Id].Score__c > 0); } } CTA Case Study: A marketing firm with 1M Leads needs a scoring app tested for 3,000 users. Design an ALM process using Partial Copy Sandboxes, justifying testing phases, data realism, and scalability for a 5,000-user org.
224
A finance team needs a Contract approval app. What milestones and sandbox type are recommended for UAT, and what are the considerations? Provide an Apex validation trigger.
Milestones: End-user UAT, performance testing, final validation. Sandbox: Full Copy Sandbox for production-like environment. Capabilities: Full production data copy, same storage as production. Considerations: 29-day refresh; high licensing costs; data security compliance. trigger ContractValidation on Contract__c (before update) { for (Contract__c c : Trigger.new) { if (c.Value__c > 50000 && !Approval.isLocked(c.Id)) { c.addError('Contracts over $50,000 require approval.'); } } } CTA Case Study: A law firm with 100,000 Contracts needs UAT for 2,000 users. Propose an ALM process using Full Copy Sandboxes, addressing UAT, data security, and deployment readiness for a 4,000-user org.
225
A sales team needs automated deployment for a forecasting app. What milestones and sandbox considerations ensure smooth deployment? Provide an Apex deployment helper.
Milestones: Package metadata, validate in staging sandbox, deploy to production. Sandbox: Developer Sandbox for packaging, Full Copy for staging. Considerations: Change sets vs. DevOps tools (e.g., Gearset); test coverage (75%); rollback plan. public class DeploymentHelper { public static void postDeploymentSetup() { try { Custom_Setting__c cs = new Custom_Setting__c(Name = 'ForecastingConfig', Enabled__c = true); insert cs; } catch (Exception e) { Error_Log__c log = new Error_Log__c(Error_Message__c = e.getMessage()); insert log; } } } public class DeploymentHelper { public static void postDeploymentSetup() { try { Custom_Setting__c cs = new Custom_Setting__c(Name = 'ForecastingConfig', Enabled__c = true); insert cs; } catch (Exception e) { Error_Log__c log = new Error_Log__c(Error_Message__c = e.getMessage()); insert log; } } } CTA Case Study: A sales org with 500,000 Opportunities needs automated deployment for 4,000 reps. Design an ALM process using sandboxes and DevOps tools, justifying automation, error handling, and scalability for a 6,000-user org.
226
A logistics firm needs to migrate 1M Orders to a new object. What milestones and sandbox type ensure accurate migration? Provide an Apex data migration snippet.
Milestones: Data mapping, migration testing, validation in sandbox. Sandbox: Partial Copy Sandbox for data subset testing. Capabilities: 5 GB data, supports data imports. Considerations: Data sampling; external ID usage; data integrity checks. public class OrderMigration { public static void migrateOrders(List oldOrders) { List newOrders = new List(); for (Order__c o : oldOrders) { newOrders.add(new New_Order__c(External_ID__c = o.Id, Amount__c = o.Amount__c)); } Database.insert(newOrders, false); } } CTA Case Study: A logistics firm with 1M Orders needs migration testing for 3,000 users. Propose an ALM process using Partial Copy Sandboxes, addressing data integrity, performance, and validation for a 5,000-user org.
227
A healthcare provider needs a Case management app tested for performance. What milestones and sandbox type are recommended? Provide an Apex performance test.
Milestones: Load testing, stress testing, optimization in sandbox. Sandbox: Full Copy Sandbox for production-like data volume. Capabilities: Full data copy, realistic performance tests. Considerations: High costs; data masking for compliance; refresh delays. @isTest private class CasePerformanceTest { @isTest static void testBulkCaseUpdate() { List cases = new List(); for (Integer i = 0; i < 200; i++) { cases.add(new Case(Subject = 'Test ' + i)); } insert cases; Test.startTest(); CaseEscalation.escalateCases(cases); Test.stopTest(); System.assertEquals(200, [SELECT COUNT() FROM Case WHERE Status = 'Escalated']); } } CTA Case Study: A healthcare provider with 2M Cases needs performance testing for 4,000 agents. Design an ALM process using Full Copy Sandboxes, justifying performance metrics, data security, and scalability for an 8,000-user org.
228
A retail team needs regression testing for an updated pricing app. What milestones and sandbox type ensure stability? Provide an Apex regression test.
Milestones: Identify impacted features, run regression tests, validate fixes. Sandbox: Developer Sandbox for isolated testing. Capabilities: 200 MB data, supports code testing. Considerations: Limited data; manual test data setup; test coverage requirements. @isTest private class PricingRegressionTest { @isTest static void testPriceCalculation() { Product__c p = new Product__c(Name = 'Test Product', Price__c = 100); insert p; Order__c o = new Order__c(Product__c = p.Id, Quantity__c = 2); insert o; System.assertEquals(200, [SELECT Total_Price__c FROM Order__c WHERE Id = :o.Id].Total_Price__c); } } CTA Case Study: A retailer with 500,000 Orders needs regression testing for 3,000 users. Propose an ALM process using Developer Sandboxes, addressing test coverage, stability, and scalability for a 5,000-user org.
229
A company needs a training environment for a new CRM app. What milestones and sandbox type are recommended? Provide an Apex data setup snippet.
Milestones: Configure training data, set up user profiles, conduct training sessions. Sandbox: Partial Copy Sandbox for realistic training data. Capabilities: 5 GB data, partial production data. Considerations: Data anonymization; refresh delays; user access control. public class TrainingDataSetup { public static void createTrainingData() { List accounts = new List(); for (Integer i = 0; i < 100; i++) { accounts.add(new Account(Name = 'Training Account ' + i)); } insert accounts; } } CTA Case Study: A corporation with 10,000 users needs a CRM training environment for 2,000 trainees. Design an ALM process using Partial Copy Sandboxes, justifying data setup, security, and training effectiveness for a 4,000-user org.
230
A tech firm needs continuous integration (CI) for a forecasting app. What milestones and sandbox considerations support CI? Provide an Apex CI validation snippet.
Milestones: Set up CI pipeline (e.g., Jenkins, GitHub Actions), validate builds in sandboxes, deploy incrementally. Sandbox: Developer Sandboxes for CI builds, Full Copy for pre-production validation. Considerations: Refresh frequency; test data consistency; deployment automation.
231
A sales team needs a new custom object (Deal__c) deployed to production. How can change sets be used, and what troubleshooting steps address common issues? Provide an Apex test snippet.
Knowledge: Change sets deploy metadata (e.g., custom objects, fields) from sandbox to production. Viability: Ideal for simple metadata deployments; supports custom objects. Troubleshooting: Check for missing fields, validate permissions, ensure test coverage. Common Issues: Missing dependencies (e.g., picklist values), profile access errors. Implementation: Create an outbound change set in sandbox, add Deal__c, upload, and deploy in production. @isTest private class DealTest { @isTest static void testDealCreation() { Deal__c deal = new Deal__c(Name = 'Test Deal', Amount__c = 10000); insert deal; System.assertEquals(10000, [SELECT Amount__c FROM Deal__c WHERE Id = :deal.Id].Amount__c); } } CTA Case Study: A tech firm with 1M records needs a new Deal__c object for 5,000 users. Design a change set deployment strategy, addressing dependency checks, test coverage, and rollback plans for a 7,000-user org.
232
A support team needs a Case escalation Flow deployed. How viable are change sets, and how can deployment errors be troubleshooted? Provide an Apex validation snippet.
Knowledge: Change sets support Flows, including subflows and elements. Viability: Suitable for declarative automation; ensures version control. Troubleshooting: Verify active Flow version, check referenced fields/objects, debug validation rule conflicts. Common Issues: Inactive Flow versions, missing referenced fields. Implementation: Add Flow to outbound change set, validate in target org. public class CaseFlowValidator { public static void validateCase(List cases) { for (Case c : cases) { if (c.Priority == 'High' && c.Status != 'Escalated') { c.addError('High-priority Cases must be escalated via Flow.'); } } } } CTA Case Study: A telecom with 2M Cases needs a Flow deployment for 4,000 agents. Propose a change set strategy, troubleshooting version conflicts, performance, and user training for a 6,000-user org.
233
A marketing team needs an Apex trigger for Lead scoring. How can change sets deploy this, and what troubleshooting is needed? Provide an Apex trigger snippet.
Knowledge: Change sets deploy Apex classes, triggers, and test classes. Viability: Effective for code deployment; requires 75% test coverage. Troubleshooting: Ensure test class coverage, debug test failures, check governor limit violations. Common Issues: Low test coverage, missing test data, dependency errors. Implementation: Include trigger and test class in change set. trigger LeadScoringTrigger on Lead (before update) { for (Lead l : Trigger.new) { l.Score__c = (l.AnnualRevenue != null ? l.AnnualRevenue / 10000 : 0) + (l.NumberOfEmployees != null ? l.NumberOfEmployees / 10 : 0); } } CTA Case Study: A marketing firm with 1M Leads needs a trigger deployment for 3,000 users. Design a change set strategy, addressing test coverage, error logging, and scalability for a 5,000-user org.
234
A finance team needs updated Profiles for a Contract app. How viable are change sets for this, and how can access issues be troubleshooted? Provide an Apex permission checker.
Knowledge: Change sets deploy Profiles and Permission Sets, including field/object access. Viability: Suitable for access control changes; ensures consistency. Troubleshooting: Validate field-level security (FLS), check object permissions, ensure dependencies (e.g., custom fields) are included. Common Issues: Missing FLS, incomplete Profile settings. Implementation: Add Profile to change set with related metadata. public class ProfileAccessChecker { @AuraEnabled(cacheable=true) public static Boolean hasContractAccess() { return Schema.sObjectType.Contract__c.isAccessible(); } } CTA Case Study: A law firm with 100,000 Contracts needs Profile updates for 2,000 users. Propose a change set deployment, troubleshooting access errors, security, and scalability for a 4,000-user org.
235
A sales team needs a custom LWC for Opportunity analytics. How can change sets deploy this, and what troubleshooting is needed? Provide an Apex controller snippet.
Knowledge: Change sets deploy LWCs, Aura components, and dependencies (e.g., Apex controllers). Viability: Ideal for UI customizations; supports Lightning Pages. Troubleshooting: Verify component dependencies, check Aura/LWC compatibility, ensure profile access. Common Issues: Missing Apex classes, broken references. Implementation: Include LWC and controller in change set. public with sharing class OpportunityAnalyticsController { @AuraEnabled(cacheable=true) public static Map getStageTotals() { Map totals = new Map(); for (AggregateResult ar : [SELECT StageName, SUM(Amount) total FROM Opportunity GROUP BY StageName WITH SECURITY_ENFORCED]) { totals.put((String)ar.get('StageName'), (Decimal)ar.get('total')); } return totals; } } CTA Case Study: A sales org with 500,000 Opportunities needs an LWC deployment for 4,000 reps. Design a change set strategy, troubleshooting component errors, performance, and mobile support for a 6,000-user org.
236
A marketing team needs a Lead performance dashboard deployed. How viable are change sets, and how can report errors be troubleshooted? Provide an Apex data provider.
Knowledge: Change sets deploy reports, dashboards, and folders. Viability: Suitable for analytics; ensures folder permissions. Troubleshooting: Verify report folder access, check report type dependencies, ensure field visibility. Common Issues: Missing custom fields, folder permission errors. Implementation: Add dashboard and report to change set. public with sharing class LeadReportData { @AuraEnabled(cacheable=true) public static List getLeadPerformance() { return [SELECT Source, Status FROM Lead WHERE CreatedDate = THIS_YEAR WITH SECURITY_ENFORCED LIMIT 100]; } } CTA Case Study: A marketing firm with 1M Leads needs dashboard deployment for 3,000 users. Propose a change set strategy, troubleshooting access issues, reporting accuracy, and scalability for a 5,000-user org.
237
A logistics firm needs an Order automation Flow deployed but faces dependency errors. How can change sets handle this, and how can errors be troubleshooted? Provide an Apex dependency checker.
Answer: Knowledge: Change sets require all dependent metadata (e.g., fields, objects). Viability: Effective for bundled deployments; dependency tracking. Troubleshooting: Use Dependency API, include all referenced components, validate in target org. Common Issues: Missing custom fields, objects, or validation rules. Implementation: Add Flow and dependencies to change set. public class DependencyChecker { @AuraEnabled public static List checkDependencies(String flowName) { List missing = new List(); MetadataService.MetadataPort service = new MetadataService.MetadataPort(); // Example: Check Flow dependencies via Metadata API return missing; } } CTA Case Study: A logistics firm with 1M Orders needs Flow deployment for 3,000 users. Design a change set strategy, troubleshooting dependency errors, performance, and automation for a 5,000-user org.
238
A finance team needs a Contract approval process deployed. How viable are change sets, and how can approval errors be troubleshooted? Provide an Apex approval validator.
Knowledge: Change sets deploy approval processes, including steps and actions. Viability: Suitable for automation; ensures consistency. Troubleshooting: Verify entry criteria, check approver availability, ensure field permissions. Common Issues: Missing approvers, invalid field references. Implementation: Add approval process to change set. public class ApprovalValidator { public static void validateApproval(List contracts) { for (Contract__c c : contracts) { if (c.Value__c > 50000 && !Approval.isLocked(c.Id)) { c.addError('Contracts over $50,000 require approval.'); } } } } CTA Case Study: A law firm with 100,000 Contracts needs approval process deployment for 2,000 users. Propose a change set strategy, troubleshooting approval errors, auditability, and scalability for a 4,000-user org.
239
A sales team needs a forecasting Apex class deployed but faces test failures. How can change sets handle this, and how can failures be troubleshooted? Provide an Apex test class.
Knowledge: Change sets require 75% test coverage for Apex deployments. Viability: Ensures code quality; supports test execution. Troubleshooting: Run all tests in sandbox, debug failing tests, check data dependencies. Common Issues: Missing test data, governor limit violations. Implementation: Include Apex class and test class in change set. @isTest private class ForecastingTest { @isTest static void testForecastCalculation() { Opportunity opp = new Opportunity(Name = 'Test Opp', StageName = 'Prospecting', Amount = 10000, CloseDate = Date.today()); insert opp; Forecasting.calculateForecast(new List{opp.Id}); System.assert([SELECT Forecast_Amount__c FROM Opportunity WHERE Id = :opp.Id].Forecast_Amount__c > 0); } } CTA Case Study: A sales org with 500,000 Opportunities needs Apex deployment for 4,000 reps. Design a change set strategy, troubleshooting test failures, code coverage, and scalability for a 6,000-user org.
240
A retail team needs a pricing app deployed with a rollback plan. How can change sets support this, and how can deployment issues be troubleshooted? Provide an Apex rollback handler.
Knowledge: Change sets are one-way deployments; rollback requires manual or scripted reversal. Viability: Suitable for controlled deployments; requires backup planning. Troubleshooting: Validate in staging sandbox, maintain metadata backups, log deployment errors. Common Issues: Deployment failures, data corruption risks. Implementation: Deploy via change set with pre-deployment backup. public class RollbackHandler { public static void rollbackPricingChanges() { try { List prices = [SELECT Id FROM Price__c WHERE LastModifiedDate = TODAY]; delete prices; Error_Log__c log = new Error_Log__c(Message__c = 'Rollback completed'); insert log; } catch (Exception e) { Error_Log__c log = new Error_Log__c(Error_Message__c = e.getMessage()); insert log; } } } CTA Case Study: A retailer with 500,000 Orders needs a pricing app deployment for 3,000 users. Propose a change set strategy with rollback, troubleshooting deployment errors, data integrity, and scalability for a 5,000-user org.
241
A sales team needs to share a custom Opportunity tracking object (Deal__c) across orgs. How can an unmanaged package be used, and what are the considerations? Provide an Apex test snippet.
Use Case: Unmanaged packages distribute custom objects (e.g., Deal__c) for open collaboration or internal sharing. Capabilities: Includes metadata (objects, fields, code); fully editable post-installation. Considerations: No upgrades; no IP protection; potential namespace conflicts; manual maintenance. Implementation: Create an unmanaged package in a Developer org, include Deal__c, and share via URL. @isTest private class DealTest { @isTest static void testDealCreation() { Deal__c deal = new Deal__c(Name = 'Test Deal', Amount__c = 10000); insert deal; System.assertEquals(10000, [SELECT Amount__c FROM Deal__c WHERE Id = :deal.Id].Amount__c); } } CTA Case Study: A tech firm with 5 orgs and 1M records needs to share a Deal__c object. Design an unmanaged package strategy versus change sets, addressing customization, maintenance, and scalability for a 7,000-user enterprise.
242
A marketing team wants to distribute a Lead scoring app commercially. How can a managed package be used, and what are the considerations? Provide an Apex scoring snippet.
Use Case: Managed packages distribute commercial apps (e.g., Lead scoring) with IP protection. Capabilities: Upgradable, namespace isolation, AppExchange distribution, licensing. Considerations: Limited customization; namespace lock-in; security reviews; versioning complexity. Implementation: Create a managed package in a Developer Edition org, include Apex and LWC, and publish on AppExchange. public with sharing class LeadScoring { public static void calculateScore(List leads) { for (Lead l : leads) { l.Score__c = (l.AnnualRevenue != null ? l.AnnualRevenue / 10000 : 0) + (l.NumberOfEmployees != null ? l.NumberOfEmployees / 10 : 0); } } } CTA Case Study: A marketing firm with 1M Leads wants to sell a scoring app to 10,000 customers. Propose a managed package strategy versus unmanaged, evaluating IP protection, upgradability, and AppExchange compliance for a global market.
243
A support team needs to deploy a Case escalation Flow across multiple orgs. How can an unmanaged package support this, and what are the considerations? Provide an Apex validation snippet.
Use Case: Unmanaged packages share declarative automation (e.g., Flows) for internal consistency. Capabilities: Includes Flows, fields, objects; fully editable. Considerations: No version control; manual updates; potential conflicts with existing metadata. Implementation: Package Flow in a sandbox, distribute via unmanaged package. public with sharing class CaseFlowValidator { public static void validateEscalation(List cases) { for (Case c : cases) { if (c.Priority == 'High' && c.Status != 'Escalated') { c.addError('High-priority Cases must be escalated.'); } } } } CTA Case Study: A telecom with 2M Cases needs Flow deployment across 5 orgs for 4,000 agents. Design an unmanaged package strategy versus change sets, addressing customization, error handling, and scalability for a 6,000-user org.
244
A finance team wants to distribute a Contract approval app. How can a managed package be used, and what are the considerations? Provide an Apex approval handler.
Use Case: Managed packages deliver approval processes with controlled customization. Capabilities: Includes approval processes, fields, automation; upgradable; secure. Considerations: Security review delays; limited post-install customization; namespace conflicts. Implementation: Create a managed package with approval process, deploy via AppExchange. public with sharing class ContractApprovalHandler { @InvocableMethod(label='Submit Contract Approval') public static void submitForApproval(List contractIds) { for (Id contractId : contractIds) { Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest(); req.setObjectId(contractId); Approval.process(req); } } } CTA Case Study: A law firm with 100,000 Contracts wants to sell an approval app to 2,000 clients. Propose a managed package strategy versus unmanaged, evaluating upgradability, security, and customer support for a 4,000-user ecosystem.
245
A sales team needs to share a custom LWC for Opportunity analytics internally. How can an unmanaged package be used, and what are the considerations? Provide an Apex controller snippet.
Use Case: Unmanaged packages share LWCs for internal UI customization. Capabilities: Includes LWCs, Apex, metadata; fully editable. Considerations: No upgrades; manual bug fixes; potential dependency conflicts. Implementation: Package LWC and Apex in a Developer org, share via URL. public with sharing class OpportunityAnalyticsController { @AuraEnabled(cacheable=true) public static Map getStageTotals() { Map totals = new Map(); for (AggregateResult ar : [SELECT StageName, SUM(Amount) total FROM Opportunity GROUP BY StageName WITH SECURITY_ENFORCED]) { totals.put((String)ar.get('StageName'), (Decimal)ar.get('total')); } return totals; } } CTA Case Study: A sales org with 500,000 Opportunities needs LWC sharing for 4,000 reps across 3 orgs. Design an unmanaged package strategy versus managed, addressing customization, performance, and scalability for a 6,000-user org.
246
A support team wants to distribute a Case management app commercially. How can a managed package support this, and what are the considerations? Provide an Apex case handler.
Use Case: Managed packages deliver scalable Case management solutions with IP protection. Capabilities: Includes objects, automation, UI; upgradable; AppExchange-ready. Considerations: Security review costs; limited customization; namespace management. Implementation: Create a managed package with Case components, publish on AppExchange. public with sharing class CaseManagementHandler { public static void updateCaseStatus(List cases) { for (Case c : cases) { if (c.Priority == 'High') { c.Status = 'Escalated'; } } } } CTA Case Study: A healthcare provider with 2M Cases wants to sell a Case app to 5,000 clients. Propose a managed package strategy versus unmanaged, evaluating IP protection, scalability, and customer onboarding for an 8,000-user market.
247
A marketing team needs to share Lead performance reports internally. How can an unmanaged package be used, and what are the considerations? Provide an Apex data provider.
Use Case: Unmanaged packages share reports and dashboards for internal analytics. Capabilities: Includes reports, dashboards, folders; fully editable. Considerations: No version control; folder permission conflicts; manual updates. Implementation: Package reports and folders in a sandbox, distribute via unmanaged package. public with sharing class LeadReportData { @AuraEnabled(cacheable=true) public static List getLeadPerformance() { return [SELECT Source, Status FROM Lead WHERE CreatedDate = THIS_YEAR WITH SECURITY_ENFORCED LIMIT 100]; } } CTA Case Study: A marketing firm with 1M Leads needs report sharing across 3 orgs for 3,000 users. Design an unmanaged package strategy versus change sets, addressing access control, reporting accuracy, and scalability for a 5,000-user org.
248
A logistics firm wants to distribute an Order integration app with external systems. How can a managed package be used, and what are the considerations? Provide an Apex integration snippet.
Use Case: Managed packages deliver secure integration apps (e.g., Order sync). Capabilities: Includes Apex callouts, custom objects; upgradable; secure namespaces. Considerations: Callout limits; security reviews; external system compatibility. Implementation: Create a managed package with integration logic, deploy via AppExchange. public with sharing class OrderIntegration { @future(callout=true) public static void syncOrder(Id orderId) { Order__c o = [SELECT Id, Amount__c FROM Order__c WHERE Id = :orderId WITH SECURITY_ENFORCED]; HttpRequest req = new HttpRequest(); req.setEndpoint('callout:ExternalSystem/order'); req.setMethod('POST'); req.setBody(JSON.serialize(o)); new Http().send(req); } } public with sharing class OrderIntegration { @future(callout=true) public static void syncOrder(Id orderId) { Order__c o = [SELECT Id, Amount__c FROM Order__c WHERE Id = :orderId WITH SECURITY_ENFORCED]; HttpRequest req = new HttpRequest(); req.setEndpoint('callout:ExternalSystem/order'); req.setMethod('POST'); req.setBody(JSON.serialize(o)); new Http().send(req); } } CTA Case Study: A logistics firm with 1M Orders needs an integration app for 3,000 users. Propose a managed package versus unmanaged, evaluating security, upgradability, and external compatibility for a 5,000-user org.
249
A company needs to set up a training environment with a CRM app. How can an unmanaged package support this, and what are the considerations? Provide an Apex data setup snippet.
Use Case: Unmanaged packages distribute training metadata (e.g., objects, automation) for learning environments. Capabilities: Includes all metadata; fully editable. Considerations: No upgrades; data setup required; potential conflicts with existing metadata. Implementation: Package CRM components in a Developer org, install in training sandbox. public with sharing class TrainingDataSetup { public static void createTrainingData() { List accounts = new List(); for (Integer i = 0; i < 100; i++) { accounts.add(new Account(Name = 'Training Account ' + i)); } insert accounts; } } CTA Case Study: A corporation with 10,000 users needs a CRM training environment for 2,000 trainees. Design an unmanaged package strategy versus managed, addressing data setup, customization, and scalability for a 4,000-user org.
250
A retail chain needs a standardized pricing app across multiple orgs. How can a managed package be used, and what are the considerations? Provide an Apex pricing calculator.
Use Case: Managed packages ensure consistent app deployment (e.g., pricing logic) across orgs. Capabilities: Includes objects, code, UI; upgradable; namespace isolation. Considerations: Limited customization; security review; version management. Implementation: Create a managed package with pricing components, install in target orgs. public with sharing class PricingCalculator { public static void calculatePrice(List orders) { for (Order__c o : orders) { o.Total_Price__c = o.Quantity__c * [SELECT Price__c FROM Product__c WHERE Id = :o.Product__c WITH SECURITY_ENFORCED].Price__c; } } } CTA Case Study: A retail chain with 500,000 Orders needs a pricing app for 3,000 users across 5 orgs. Propose a managed package versus unmanaged, evaluating consistency, upgradability, and scalability for a 5,000-user org.
251
A sales team needs a new Deal__c object deployed to production. What deployment plan is appropriate, and what are key considerations? Provide an Apex test snippet.
Deployment Plan: Use a Developer Sandbox for development, Partial Copy for testing, and change sets for deployment. Milestones: Develop Deal__c (fields, validation rules), unit test, UAT in Partial Copy, deploy with change sets, validate in production. Considerations: Include dependencies (fields, profiles), ensure 75% test coverage, plan data migration, train users. Troubleshooting: Check for missing metadata, test failures. @isTest private class DealTest { @isTest static void testDealCreation() { Deal__c deal = new Deal__c(Name = 'Test Deal', Amount__c = 10000); insert deal; System.assertEquals(10000, [SELECT Amount__c FROM Deal__c WHERE Id = :deal.Id].Amount__c); } } CTA Case Study: A tech firm with 1M records needs Deal__c deployment for 5,000 reps. Design a deployment plan using change sets versus DevOps tools, justifying test coverage, data migration, and scalability for a 7,000-user org.
252
A support team needs a Case escalation Flow deployed. What deployment plan ensures success, and what are the considerations? Provide an Apex validation snippet.
Deployment Plan: Develop in Developer Sandbox, test in Partial Copy, deploy via change sets. Milestones: Build Flow, unit test with sample data, perform UAT, deploy, validate active Flow version. Considerations: Validate referenced fields, avoid inactive Flow versions, monitor governor limits, train users. Troubleshooting: Debug Flow errors, check dependencies. public with sharing class CaseFlowValidator { public static void validateEscalation(List cases) { for (Case c : cases) { if (c.Priority == 'High' && c.Status != 'Escalated') { c.addError('High-priority Cases must be escalated.'); } } } } CTA Case Study: A telecom with 2M Cases needs Flow deployment for 4,000 agents. Design a deployment plan, addressing dependency checks, performance testing, and user training for a 6,000-user org.
253
A marketing team needs a Lead scoring trigger deployed. What deployment plan is appropriate, and what are the considerations? Provide an Apex test class.
Deployment Plan: Develop in Developer Sandbox, test in Full Copy, deploy via Salesforce CLI. Milestones: Write trigger and test class, achieve 75% coverage, perform UAT, deploy, validate in production. Considerations: Ensure test data, monitor governor limits, plan rollback, document changes. Troubleshooting: Debug test failures, check coverage. @isTest private class LeadScoringTest { @isTest static void testScoring() { Lead l = new Lead(LastName = 'Test', Company = 'Test Co', AnnualRevenue = 100000); insert l; System.assert([SELECT Score__c FROM Lead WHERE Id = :l.Id].Score__c > 0); } } CTA Case Study: A marketing firm with 1M Leads needs trigger deployment for 3,000 users. Design a deployment plan using Salesforce CLI versus change sets, justifying code coverage, error handling, and scalability for a 5,000-user org.
254
A sales team needs an LWC for Opportunity analytics. What deployment plan ensures success, and what are the considerations? Provide an Apex controller snippet.
Deployment Plan: Develop in Developer Sandbox, test in Partial Copy, deploy via change sets. Milestones: Build LWC and Apex controller, unit test, perform UAT, deploy, validate on Lightning Page. Considerations: Include dependencies (Apex, fields), ensure profile access, optimize performance. Troubleshooting: Check component compatibility, debug Apex errors. public with sharing class OpportunityAnalyticsController { @AuraEnabled(cacheable=true) public static Map getStageTotals() { Map totals = new Map(); for (AggregateResult ar : [SELECT StageName, SUM(Amount) total FROM Opportunity GROUP BY StageName WITH SECURITY_ENFORCED]) { totals.put((String)ar.get('StageName'), (Decimal)ar.get('total')); } return totals; } } CTA Case Study: A sales org with 500,000 Opportunities needs LWC deployment for 4,000 reps. Design a deployment plan, addressing dependency management, performance, and mobile support for a 6,000-user org.
255
A logistics firm needs to migrate 1M Orders to a new Order__c object. What deployment plan supports this, and what are the considerations? Provide an Apex migration snippet.
Deployment Plan: Develop migration scripts in Developer Sandbox, test in Partial Copy, execute in production. Milestones: Map data, test migration with subset, validate data integrity, migrate, verify results. Considerations: Use External IDs, handle data volume, plan rollback, ensure data security. Troubleshooting: Debug data errors, check field mappings. public class OrderMigration { public static void migrateOrders(List oldOrders) { List newOrders = new List(); for (Order o : oldOrders) { newOrders.add(new Order__c(External_ID__c = o.Id, Amount__c = o.TotalAmount)); } Database.insert(newOrders, false); } } CTA Case Study: A logistics firm with 1M Orders needs migration for 3,000 users. Design a deployment plan, addressing data integrity, performance, and rollback strategies for a 5,000-user org.
256
A finance team needs a Contract approval process deployed. What deployment plan is appropriate, and what are the considerations? Provide an Apex approval handler.
Deployment Plan: Develop in Developer Sandbox, test in Full Copy, deploy via change sets. Milestones: Configure approval process, test with sample data, perform UAT, deploy, validate in production. Considerations: Include dependencies (fields, email templates), ensure approver availability, train users. Troubleshooting: Check entry criteria, debug approval failures. public with sharing class ContractApprovalHandler { @InvocableMethod(label='Submit Contract Approval') public static void submitForApproval(List contractIds) { for (Id contractId : contractIds) { Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest(); req.setObjectId(contractId); Approval.process(req); } } } CTA Case Study: A law firm with 100,000 Contracts needs approval deployment for 2,000 users. Design a deployment plan, addressing dependency checks, auditability, and user training for a 4,000-user org.
257
A marketing team needs a Lead performance dashboard deployed. What deployment plan ensures success, and what are the considerations? Provide an Apex data provider.
Deployment Plan: Develop in Developer Sandbox, test in Partial Copy, deploy via change sets. Milestones: Create reports and dashboards, test with sample data, perform UAT, deploy, validate folder access. Considerations: Include report types, folders, ensure field visibility, manage permissions. Troubleshooting: Debug folder access, check report dependencies. public with sharing class LeadReportData { @AuraEnabled(cacheable=true) public static List getLeadPerformance() { return [SELECT Source, Status FROM Lead WHERE CreatedDate = THIS_YEAR WITH SECURITY_ENFORCED LIMIT 100]; } } CTA Case Study: A marketing firm with 1M Leads needs dashboard deployment for 3,000 users. Design a deployment plan, addressing access control, reporting accuracy, and scalability for a 5,000-user org.
258
A tech firm needs continuous integration (CI) for a forecasting app. What deployment plan supports CI, and what are the considerations? Provide an Apex CI validator.
Deployment Plan: Use Developer Sandboxes for CI builds, Full Copy for staging, deploy via Salesforce CLI with CI tools (e.g., Jenkins). Milestones: Set up CI pipeline, validate builds, stage in Full Copy, deploy incrementally. Considerations: Test coverage (75%), version control, rollback plan. Troubleshooting: Debug test failures, check CI pipeline logs. public with sharing class CIValidator { public static Boolean validateBuild() { try { List opps = [SELECT Id FROM Opportunity LIMIT 1 WITH SECURITY_ENFORCED]; return !opps.isEmpty(); } catch (Exception e) { Error_Log__c log = new Error_Log__c(Error_Message__c = e.getMessage()); insert log; return false; } } } CTA Case Study: A tech firm with 300,000 Opportunities needs CI deployment for 4,000 developers. Design a deployment plan using CI tools, addressing automation, error handling, and scalability for a 6,000-user org.
259
A retail team needs to deploy a managed pricing app across orgs. What deployment plan is appropriate, and what are the considerations? Provide an Apex pricing calculator.
Deployment Plan: Develop in Developer Edition org, test in Full Copy, deploy via AppExchange. Milestones: Package app, pass security review, test in sandbox, install in production, validate functionality. Considerations: Namespace conflicts, licensing costs, limited customization. Troubleshooting: Debug installation errors, check security review compliance. public with sharing class PricingCalculator { public static void calculatePrice(List orders) { for (Order__c o : orders) { o.Total_Price__c = o.Quantity__c * [SELECT Price__c FROM Product__c WHERE Id = :o.Product__c WITH SECURITY_ENFORCED].Price__c; } } } CTA Case Study: A retail chain with 500,000 Orders needs a managed app deployment for 3,000 users across 5 orgs. Design a deployment plan, addressing upgradability, security, and scalability for a 5,000-user org.
260
A healthcare provider needs a rollback plan for a Case management app deployment. What deployment plan ensures safe rollback, and what are the considerations? Provide an Apex rollback handler.
Deployment Plan: Develop in Developer Sandbox, stage in Full Copy, deploy via change sets with rollback scripts. Milestones: Backup metadata/data, test rollback in sandbox, deploy, validate, execute rollback if needed. Considerations: Backup storage, data consistency, user communication. Troubleshooting: Debug rollback failures, ensure data restoration. public with sharing class RollbackHandler { public static void rollbackCaseChanges() { try { List cases = [SELECT Id FROM Case WHERE LastModifiedDate = TODAY]; delete cases; Error_Log__c log = new Error_Log__c(Message__c = 'Rollback completed'); insert log; } catch (Exception e) { Error_Log__c log = new Error_Log__c(Error_Message__c = e.getMessage()); insert log; } } } CTA Case Study: A healthcare provider with 1M Cases needs a Case app deployment for 4,000 agents. Design a deployment plan with rollback, addressing data integrity, error handling, and user impact for an 8,000-user org.
261