salesforce-known-pitfalls

Featured

Identify and avoid Salesforce anti-patterns including SOQL N+1, governor limit violations, and API waste. Use when reviewing Salesforce code for issues, onboarding new developers, or auditing existing Salesforce integrations for best practices violations. Trigger with phrases like "salesforce mistakes", "salesforce anti-patterns", "salesforce pitfalls", "salesforce what not to do", "salesforce code review".

AI & Automation 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Salesforce Known Pitfalls ## Overview The 10 most common and costly mistakes when integrating with Salesforce, with real error messages and correct patterns. ## Pitfall #1: SOQL N+1 Query Pattern (Most Common) ### Anti-Pattern ```typescript // Query accounts, then query contacts for each = N+1 API calls const accounts = await conn.query('SELECT Id, Name FROM Account LIMIT 100'); for (const account of accounts.records) { // 100 extra API calls! (plus 100 extra SOQL queries in Apex) const contacts = await conn.query( `SELECT Id, Name, Email FROM Contact WHERE AccountId = '${account.Id}'` ); } // Total: 101 API calls for what should be 1 ``` ### Correct Pattern ```typescript // Single relationship query — 1 API call const accounts = await conn.query(` SELECT Id, Name, (SELECT Id, FirstName, LastName, Email FROM Contacts) FROM Account LIMIT 100 `); // accounts.records[0].Contacts.records → child contacts ``` --- ## Pitfall #2: Ignoring API Limits (Org-Wide Shared Pool) ### Anti-Pattern ```typescript // This integration uses 80,000 API calls/day // Sales team uses 60,000/day // Total: 140,000 > 150,000 limit → everyone gets blocked ``` ### Correct Pattern ```typescript // 1. Check limits before batch operations const limits = await conn.request('/services/data/v59.0/limits/'); if (limits.DailyApiRequests.Remaining < estimatedCalls) { throw new Error('Insufficient API calls remaining'); } // 2. Use sObject Collections (1 call = 200 records) await co...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category