salesforce-common-errors

Diagnose and fix Salesforce common errors, SOQL issues, and API exceptions. Use when encountering Salesforce errors, debugging failed requests, or troubleshooting integration issues. Trigger with phrases like "salesforce error", "fix salesforce", "salesforce not working", "debug salesforce", "SOQL error", "salesforce exception".

1,868 stars

Best use case

salesforce-common-errors is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Diagnose and fix Salesforce common errors, SOQL issues, and API exceptions. Use when encountering Salesforce errors, debugging failed requests, or troubleshooting integration issues. Trigger with phrases like "salesforce error", "fix salesforce", "salesforce not working", "debug salesforce", "SOQL error", "salesforce exception".

Teams using salesforce-common-errors should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/salesforce-common-errors/SKILL.md --create-dirs "https://raw.githubusercontent.com/jeremylongshore/claude-code-plugins-plus-skills/main/plugins/saas-packs/salesforce-pack/skills/salesforce-common-errors/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/salesforce-common-errors/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How salesforce-common-errors Compares

Feature / Agentsalesforce-common-errorsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Diagnose and fix Salesforce common errors, SOQL issues, and API exceptions. Use when encountering Salesforce errors, debugging failed requests, or troubleshooting integration issues. Trigger with phrases like "salesforce error", "fix salesforce", "salesforce not working", "debug salesforce", "SOQL error", "salesforce exception".

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Salesforce Common Errors

## Overview
Quick reference for the most common Salesforce API errors with real error codes, messages, and solutions.

## Prerequisites
- Salesforce connection established (jsforce or simple-salesforce)
- Access to Setup in your Salesforce org
- Familiarity with sObject field API names

## Instructions

### Step 1: Identify the Error
Check the `errorCode` field in the API response or the exception from jsforce.

### Step 2: Match to Error Below

---

### INVALID_LOGIN — Authentication Failed
```
[{"message":"INVALID_LOGIN: Invalid username, password, security token; or user locked out.","errorCode":"INVALID_LOGIN"}]
```
**Cause:** Wrong credentials or security token.
**Solution:**
```bash
# Reset security token: Setup > My Personal Information > Reset My Security Token
# Append token to password: password + securityToken
# Verify IP is whitelisted or token is appended
echo "Password format: ${SF_PASSWORD}${SF_SECURITY_TOKEN}"
```

---

### INVALID_FIELD — Wrong Field Name in SOQL
```
[{"message":"SELECT Id, FullName FROM Account\n                ^\nERROR: No such column 'FullName' on entity 'Account'","errorCode":"INVALID_FIELD"}]
```
**Cause:** Field API name does not exist on the sObject.
**Solution:**
```typescript
// Check available fields via describe
const meta = await conn.sobject('Account').describe();
const fieldNames = meta.fields.map(f => f.name);
console.log('Available fields:', fieldNames.join(', '));
// Common mistake: "FullName" vs "Name", "Email" on Account (doesn't exist — it's on Contact)
```

---

### MALFORMED_QUERY — SOQL Syntax Error
```
[{"message":"unexpected token: 'FORM'","errorCode":"MALFORMED_QUERY"}]
```
**Cause:** Typo in SOQL keywords or missing quotes.
**Solution:**
```sql
-- Wrong: SELECT Id FORM Account (typo)
-- Right: SELECT Id FROM Account

-- Wrong: WHERE Name = Acme (missing quotes)
-- Right: WHERE Name = 'Acme'

-- Wrong: WHERE CreatedDate > 2026-01-01 (needs literal format)
-- Right: WHERE CreatedDate > 2026-01-01T00:00:00Z
```

---

### REQUIRED_FIELD_MISSING — Missing Required Fields on Create
```
[{"message":"Required fields are missing: [LastName]","errorCode":"REQUIRED_FIELD_MISSING","fields":["LastName"]}]
```
**Cause:** Create/update missing a required field.
**Solution:**
```typescript
// Check required fields
const meta = await conn.sobject('Contact').describe();
const required = meta.fields
  .filter(f => !f.nillable && !f.defaultedOnCreate && f.createable)
  .map(f => f.name);
console.log('Required for create:', required);
// Contact requires: LastName
// Lead requires: LastName, Company
// Opportunity requires: Name, StageName, CloseDate
```

---

### INSUFFICIENT_ACCESS_OR_READONLY — Permission Issue
```
[{"message":"Insufficient access rights on cross-reference id","errorCode":"INSUFFICIENT_ACCESS_OR_READONLY"}]
```
**Cause:** User profile lacks CRUD permission or field-level security blocks access.
**Solution:** In Setup, check:
1. Profile > Object Permissions > verify CRUD for the sObject
2. Profile > Field-Level Security > verify field access
3. Sharing Rules if record-level access is denied
4. Organization-Wide Defaults (OWD) for the object

---

### REQUEST_LIMIT_EXCEEDED — API Limit Hit
```
[{"message":"TotalRequests Limit exceeded.","errorCode":"REQUEST_LIMIT_EXCEEDED"}]
```
**Cause:** Org exceeded the 24-hour rolling API call limit.
**Solution:**
```typescript
// Check remaining API calls
const limits = await conn.request('/services/data/v59.0/limits/');
console.log('Daily API:', limits.DailyApiRequests);
// { Max: 100000, Remaining: 45230 }

// Enterprise Edition base: 100,000/24hr + 1,000 per user license
// Check: Setup > Company Information > API Requests, Last 24 Hours
```

---

### UNABLE_TO_LOCK_ROW — Record Locking Conflict
```
[{"message":"unable to obtain exclusive access to this record","errorCode":"UNABLE_TO_LOCK_ROW"}]
```
**Cause:** Another process is updating the same record simultaneously.
**Solution:** Retry with exponential backoff — this is transient.
```typescript
// This commonly occurs with triggers, workflows, or parallel bulk jobs
// Retry 3 times with increasing delay
await withRetry(() => conn.sobject('Account').update({ Id: id, Name: 'New Name' }));
```

---

### DUPLICATES_DETECTED — Duplicate Rule Triggered
```
[{"message":"Use one of these records?","errorCode":"DUPLICATES_DETECTED"}]
```
**Cause:** Salesforce Duplicate Rules matched existing records.
**Solution:**
```typescript
// Allow duplicates by setting header
const result = await conn.sobject('Lead').create(
  { LastName: 'Smith', Company: 'Acme', Email: 'smith@acme.com' },
  { headers: { 'Sforce-Duplicate-Rule-Header': 'allowSave=true' } }
);
```

---

### FIELD_CUSTOM_VALIDATION_EXCEPTION — Validation Rule Failed
```
[{"message":"Phone number must be 10 digits","errorCode":"FIELD_CUSTOM_VALIDATION_EXCEPTION"}]
```
**Cause:** A validation rule on the sObject rejected the data.
**Solution:** Check Setup > Object Manager > [Object] > Validation Rules to see active rules and fix your data accordingly.

---

### ENTITY_IS_DELETED — Record in Recycle Bin
```
[{"message":"entity is deleted","errorCode":"ENTITY_IS_DELETED"}]
```
**Cause:** Record was soft-deleted and is in the Recycle Bin.
**Solution:**
```sql
-- Query deleted records with ALL ROWS
SELECT Id, Name, IsDeleted FROM Account WHERE Id = '001xx' ALL ROWS

-- Undelete via API
```
```typescript
await conn.sobject('Account').undelete('001xxxxxxxxxxxx');
```

## Quick Diagnostic Commands
```bash
# Check Salesforce system status
curl -s https://api.status.salesforce.com/v1/instances | jq '.[0]'

# Check org API limits via sf CLI
sf org display --target-org my-org

# List recent API errors in debug log
sf apex log list --target-org my-org
sf apex log get --log-id 07Lxx --target-org my-org
```

## Error Handling
| HTTP Status | Error Code | Retryable? |
|------------|------------|------------|
| 400 | MALFORMED_QUERY, INVALID_FIELD | No — fix query |
| 401 | INVALID_SESSION_ID | Yes — refresh token |
| 403 | REQUEST_LIMIT_EXCEEDED | Yes — wait and retry |
| 404 | NOT_FOUND | No — wrong ID or sObject |
| 409 | UNABLE_TO_LOCK_ROW | Yes — retry with backoff |
| 500 | UNKNOWN_EXCEPTION | Maybe — check SF status |

## Resources
- [Salesforce Status API](https://api.status.salesforce.com/)
- [REST API Error Responses](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/errorcodes.htm)
- [SOQL Date Literals](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_dateformats.htm)
- [Salesforce Governor Limits](https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_api.htm)

## Next Steps
For comprehensive debugging, see `salesforce-debug-bundle`.

Related Skills

workhuman-common-errors

1868
from jeremylongshore/claude-code-plugins-plus-skills

Workhuman common errors for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman common errors".

wispr-common-errors

1868
from jeremylongshore/claude-code-plugins-plus-skills

Wispr Flow common errors for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr common errors".

windsurf-common-errors

1868
from jeremylongshore/claude-code-plugins-plus-skills

Diagnose and fix common Windsurf IDE and Cascade errors. Use when Cascade stops working, Supercomplete fails, indexing hangs, or encountering Windsurf-specific issues. Trigger with phrases like "windsurf error", "fix windsurf", "windsurf not working", "cascade broken", "windsurf slow".

webflow-common-errors

1868
from jeremylongshore/claude-code-plugins-plus-skills

Diagnose and fix Webflow Data API v2 errors — 400, 401, 403, 404, 409, 429, 500. Use when encountering Webflow API errors, debugging failed requests, or troubleshooting integration issues. Trigger with phrases like "webflow error", "fix webflow", "webflow not working", "debug webflow", "webflow 429", "webflow 401".

vercel-common-errors

1868
from jeremylongshore/claude-code-plugins-plus-skills

Diagnose and fix common Vercel deployment and function errors. Use when encountering Vercel errors, debugging failed deployments, or troubleshooting serverless function issues. Trigger with phrases like "vercel error", "fix vercel", "vercel not working", "debug vercel", "vercel 500", "vercel build failed".

veeva-common-errors

1868
from jeremylongshore/claude-code-plugins-plus-skills

Veeva Vault common errors for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva common errors".

vastai-common-errors

1868
from jeremylongshore/claude-code-plugins-plus-skills

Diagnose and fix Vast.ai common errors and exceptions. Use when encountering Vast.ai errors, debugging failed instances, or troubleshooting GPU rental issues. Trigger with phrases like "vastai error", "fix vastai", "vastai not working", "debug vastai", "vastai instance failed".

twinmind-common-errors

1868
from jeremylongshore/claude-code-plugins-plus-skills

Diagnose and fix TwinMind common errors and exceptions. Use when encountering transcription errors, debugging failed requests, or troubleshooting integration issues. Trigger with phrases like "twinmind error", "fix twinmind", "twinmind not working", "debug twinmind", "transcription failed".

together-common-errors

1868
from jeremylongshore/claude-code-plugins-plus-skills

Together AI common errors for inference, fine-tuning, and model deployment. Use when working with Together AI's OpenAI-compatible API. Trigger: "together common errors".

techsmith-common-errors

1868
from jeremylongshore/claude-code-plugins-plus-skills

TechSmith common errors for Snagit COM API and Camtasia automation. Use when working with TechSmith screen capture and video editing automation. Trigger: "techsmith common errors".

supabase-common-errors

1868
from jeremylongshore/claude-code-plugins-plus-skills

Diagnose and fix Supabase errors across PostgREST, PostgreSQL, Auth, Storage, and Realtime. Use when encountering error codes like PGRST301, 42501, 23505, or auth failures. Use when debugging failed queries, RLS policy violations, or HTTP 4xx/5xx responses. Trigger with "supabase error", "fix supabase", "PGRST", "supabase 403", "RLS not working", "supabase auth error", "unique constraint", "foreign key violation".

stackblitz-common-errors

1868
from jeremylongshore/claude-code-plugins-plus-skills

Fix WebContainer and StackBlitz errors: COOP/COEP, SharedArrayBuffer, boot failures. Use when WebContainers fail to boot, embeds don't load, or processes crash inside WebContainers. Trigger: "stackblitz error", "webcontainer error", "SharedArrayBuffer not defined".