Flows and Apex operate independently but execute in the same transaction. When both attempt to modify the same fields, conflicts occur. Lack of clear ownership over logic increases the risk of inconsistent outcomes. Defining clear boundaries between Flow and Apex responsibilities reduces conflicts.TRead more
Flows and Apex operate independently but execute in the same transaction. When both attempt to modify the same fields, conflicts occur.
Lack of clear ownership over logic increases the risk of inconsistent outcomes.
Defining clear boundaries between Flow and Apex responsibilities reduces conflicts.
Takeaway: Mixing automation layers requires strict coordination.
Why does my Apex test fail with “System.NullPointerException”?
Your test doesn’t initialize required data or relationships. Problem Explanation Tests run with SeeAllData=false by default, so missing records cause null references. Root Cause(s) 1. Missing lookup record creation 2. Query returns empty list 3. Static variables not reset Step-by-Step Solution 1. CrRead more
Your test doesn’t initialize required data or relationships.
Problem Explanation
Tests run with SeeAllData=false by default, so missing records cause null references.
Root Cause(s)
1. Missing lookup record creation
2. Query returns empty list
3. Static variables not reset
Step-by-Step Solution
1. Create all required test data explicitly
2. Use defensive null checks
3. Assert query results before access
Edge Cases & Variations
1. Triggers may expect org-level settings
2. Platform events behave differently in tests
Common Mistakes to Avoid
1. Assuming org data exists
2. Skipping assertions
See lessWhy does my Apex deployment fail with “Dependent class is invalid”?
A referenced class or method has compilation errors. Problem Explanation Salesforce validates all dependencies during deployment. Root Cause(s) 1. Method signature changed 2. Deleted class reference 3. Namespace conflicts Step-by-Step Solution 1. Compile all Apex classes in target org 2. Fix dependeRead more
A referenced class or method has compilation errors.
Problem Explanation
Salesforce validates all dependencies during deployment.
Root Cause(s)
1. Method signature changed
2. Deleted class reference
3. Namespace conflicts
Step-by-Step Solution
1. Compile all Apex classes in target org
2. Fix dependency errors first
3. Redeploy in correct order
Edge Cases & Variations
1. Managed packages lock dependencies
2. API version mismatches cause issues
Common Mistakes to Avoid
1. Partial deployments
2. Ignoring compile warnings
See lessWhy does my SOQL query return fewer records than expected?
Sharing rules or implicit filters are limiting visibility. Problem Explanation SOQL respects sharing, object permissions, and query filters unless explicitly overridden. Root Cause(s) 1. with sharing Apex class 2. Private org-wide defaults 3. Implicit date or owner filters Step-by-Step Solution 1. CRead more
Sharing rules or implicit filters are limiting visibility.
Problem Explanation
SOQL respects sharing, object permissions, and query filters unless explicitly overridden.
Root Cause(s)
1. with sharingApex class2. Private org-wide defaults
3. Implicit date or owner filters
Step-by-Step Solution
1. Check class sharing declaration
2. Verify org-wide defaults
3. Run query as affected user
Edge Cases & Variations
1. Reports may show more due to running user
2. System context applies only in Apex
Common Mistakes to Avoid
1. Testing only as admin
2. Assuming full data access
See lessWhy does my Salesforce Flow fail in production but work in sandbox?
Production data, permissions, or automation differ from sandbox. Problem Explanation Sandboxes rarely mirror production exactly, leading to runtime differences. Root Cause(s) 1. Missing permissions 2. Different record data 3. Additional automation in prod Step-by-Step Solution 1. Debug Flow in produRead more
Production data, permissions, or automation differ from sandbox.
Problem Explanation
Sandboxes rarely mirror production exactly, leading to runtime differences.
Root Cause(s)
1. Missing permissions
2. Different record data
3. Additional automation in prod
Step-by-Step Solution
1. Debug Flow in production safely
2. Compare permissions and profiles
3. Review active automation
Edge Cases & Variations
1. Production-only validation rules
2. Integration users behave differently
Common Mistakes to Avoid
1. Testing only in sandbox
2. Assuming identical environments
See lessWhy does my Salesforce report show “0” for formula fields but records have values?
The formula field isn’t included at the correct summary level. Problem Explanation Report formulas and field-level formulas behave differently depending on grouping and aggregation. Root Cause(s) 1. Formula field set to row-level only 2. Incorrect summary function 3. Field excluded from report typeRead more
The formula field isn’t included at the correct summary level.
Problem Explanation
Report formulas and field-level formulas behave differently depending on grouping and aggregation.
Root Cause(s)
1. Formula field set to row-level only
2. Incorrect summary function
3. Field excluded from report type
Step-by-Step Solution
1. Edit report and check field properties
2. Change summary type (SUM, MAX, etc.)
3. Confirm report type includes formula field
Edge Cases & Variations
1. Cross-object formulas may lag
2. Joined reports handle formulas per block
Common Mistakes to Avoid
1. Expecting row-level formulas to auto-summarize
2. Using text formulas in numeric summaries
See lessWhy does my Salesforce REST API upsert create duplicates instead of updating?
The External ID used for upsert is missing or not unique. Problem Explanation Upsert relies on External IDs to decide whether to insert or update a record. If Salesforce can’t match one record exactly, it inserts a new one. Root Cause(s) 1. External ID field not marked correctly 2. Null external IDRead more
The External ID used for upsert is missing or not unique.
Problem Explanation
Upsert relies on External IDs to decide whether to insert or update a record. If Salesforce can’t match one record exactly, it inserts a new one.
Root Cause(s)
1. External ID field not marked correctly
2. Null external ID value in request
3. Duplicate external ID values
Step-by-Step Solution
1. Mark field as External ID + Unique
2. Validate payload includes external ID
3. Clean existing duplicate records
Edge Cases & Variations
1. Case sensitivity matters for text external IDs
2. Bulk API handles failures differently
Common Mistakes to Avoid
1. Using Name field as External ID
2. Skipping uniqueness constraint
See lessWhy does my Salesforce deployment succeed but features don’t work?
Metadata deployed successfully, but required settings or permissions are missing. Problem Explanation Deployments don’t automatically configure permissions, licenses, or settings. Root Cause(s) 1. Missing permission sets 2. Feature not enabled in target org 3. Post-deployment steps skipped Step-by-SRead more
Metadata deployed successfully, but required settings or permissions are missing.
Problem Explanation
Deployments don’t automatically configure permissions, licenses, or settings.
Root Cause(s)
1. Missing permission sets
2. Feature not enabled in target org
3. Post-deployment steps skipped
Step-by-Step Solution
1. Verify feature activation
2. Assign permission sets
3. Validate profiles and access
Edge Cases & Variations
1. Sandboxes differ from production
2. Scratch orgs need manual setup
Common Mistakes to Avoid
1. Assuming deployment = configuration
2. Ignoring post-deploy checklist
See less