Salesforce abstracts internals for safety. Logs reveal details. Error handling helps users.Takeaway: Surface meaningful errors where possible.
Salesforce abstracts internals for safety.
Logs reveal details.
Error handling helps users.
Takeaway: Surface meaningful errors where possible.
Why do API rate limits fail to prevent abuse?
Rate limiting controls how frequently a single source can make requests, but it doesn’t account for distributed or adaptive behavior. Attackers often spread traffic across multiple IPs, tokens, or accounts to stay below thresholds while still causing harm. This makes rate limiting effective againstRead more
Rate limiting controls how frequently a single source can make requests, but it doesn’t account for distributed or adaptive behavior. Attackers often spread traffic across multiple IPs, tokens, or accounts to stay below thresholds while still causing harm.
See lessThis makes rate limiting effective against simple abuse but insufficient on its own against determined attackers. Additional signals such as behavior patterns, authentication context, and anomaly detection are needed to distinguish normal use from abuse.
Relying on rate limiting alone often creates a false sense of protection.
Takeaway: Rate limits reduce noise, but they don’t stop intent-driven abuse.
Why does my LWC Apex call return empty data but works in Developer Console?
The running user lacks record-level access. Problem Explanation LWCs run in user context, while Developer Console often runs with elevated access. Root Cause(s) 1. Missing sharing rules 2. Apex class marked with sharing 3. Field-level security restrictions Step-by-Step Solution 1. Check object and fRead more
The running user lacks record-level access.
Problem Explanation
LWCs run in user context, while Developer Console often runs with elevated access.
Root Cause(s)
1. Missing sharing rules
2. Apex class marked
with sharing3. Field-level security restrictions
Step-by-Step Solution
1. Check object and field permissions
2. Review sharing model
3. Adjust Apex sharing if appropriate
Edge Cases & Variations
1. System context applies only to Apex, not LWC
2. Guest users have additional limits
Common Mistakes to Avoid
1. Removing sharing without justification
See less2. Testing only as admin
Why does my Apex test class fail with “Mixed DML Operation” error?
You’re modifying setup and non-setup objects in the same transaction. Problem Explanation Salesforce separates setup objects (User, Profile) from standard objects to maintain system integrity. Root Cause(s) 1. Creating Users and Accounts together 2. Updating Permission Sets alongside data records 3.Read more
You’re modifying setup and non-setup objects in the same transaction.
Problem Explanation
Salesforce separates setup objects (User, Profile) from standard objects to maintain system integrity.
Root Cause(s)
1. Creating Users and Accounts together
2. Updating Permission Sets alongside data records
3. Test setup not isolated
Step-by-Step Solution
1. Move setup object DML to
System.runAs()2. Separate transactions using
@testSetup3. Use async Apex for one side if required
Edge Cases & Variations
1. Permission Set Assignments count as setup DML
2. Community Users increase complexity
Common Mistakes to Avoid
1. Creating users inside main test method
See less2. Ignoring setup vs non-setup distinction
Why does my Salesforce Flow create duplicate records even with entry conditions?
The Flow is triggered multiple times due to record updates or automation recursion. Problem Explanation Record-triggered Flows can re-run when the same record is updated by another Flow, Process Builder, or Apex, causing duplicate record creation. Root Cause(s) 1. Flow runs on create and update 2. NRead more
The Flow is triggered multiple times due to record updates or automation recursion.
Problem Explanation
Record-triggered Flows can re-run when the same record is updated by another Flow, Process Builder, or Apex, causing duplicate record creation.
Root Cause(s)
1. Flow runs on create and update
2. No duplicate-check logic
3. Another automation updates the same record
4. Before-save and after-save Flows both active
Step-by-Step Solution
1. Change trigger to Only when record is created
2. Add a Decision element to check for existing records
3. Use a unique field (Email, External ID)
4. Disable redundant automation
Edge Cases & Variations
1. Integration updates can retrigger Flows
2. Bulk updates amplify duplicates
Common Mistakes to Avoid
1. Relying only on entry criteria
See less2. Ignoring update-triggered executions
Why does my model’s performance drop only during peak traffic hours?
This usually points to resource contention or degraded inference conditions rather than a modeling issue. During peak hours, models often compete for CPU, GPU, memory, or I/O bandwidth. This can lead to timeouts, truncated inputs, or fallback logic silently kicking in, all of which reduce observed pRead more
This usually points to resource contention or degraded inference conditions rather than a modeling issue.
During peak hours, models often compete for CPU, GPU, memory, or I/O bandwidth. This can lead to timeouts, truncated inputs, or fallback logic silently kicking in, all of which reduce observed performance. Check system-level metrics alongside model metrics. Look for increased latency, dropped requests, or reduced batch sizes under load. If you use autoscaling, verify that new instances warm up fully before serving traffic.
Common mistakes:
Model quality can’t be evaluated independently of the system serving it.
See lessWhy is the Service layer considered the “brain” of a Salesforce Apex application?
The Service layer owns validation, calculations, and core decision logic.It orchestrates workflows without worrying about UI or database specifics.This makes business behavior reusable across controllers, triggers, and batch jobs.This approach is central to business-logic isolation.
The Service layer owns validation, calculations, and core decision logic.
See lessIt orchestrates workflows without worrying about UI or database specifics.
This makes business behavior reusable across controllers, triggers, and batch jobs.
This approach is central to business-logic isolation.
Why does Salesforce automation slow down record saves over time?
This slowdown is almost always caused by automation stacking rather than a single inefficient component. Each record save can trigger record-triggered Flows, Apex triggers, validation rules, roll-ups, and even downstream automation on related objects. Individually these may be lightweight, but togetRead more
This slowdown is almost always caused by automation stacking rather than a single inefficient component. Each record save can trigger record-triggered Flows, Apex triggers, validation rules, roll-ups, and even downstream automation on related objects. Individually these may be lightweight, but together they add measurable execution time.
See lessThe issue often worsens because automation is added incrementally. New Flows or triggers are created to handle edge cases without considering existing logic, so the same record may be updated multiple times in one transaction. This leads to repeated evaluations, recalculations, and re-entry into automation chains.