From salesforce-pack
Create a minimal working Salesforce example with SOQL queries and sObject CRUD. Use when starting a new Salesforce integration, testing your setup, or learning basic Salesforce API patterns. Trigger with phrases like "salesforce hello world", "salesforce example", "salesforce quick start", "first salesforce query", "salesforce SOQL".
npx claudepluginhub flight505/skill-forge --plugin salesforce-packThis skill is limited to using the following tools:
Minimal working example: connect to Salesforce, run a SOQL query, and perform basic CRUD on standard sObjects (Account, Contact, Lead).
Guides Next.js Cache Components and Partial Prerendering (PPR): 'use cache' directives, cacheLife(), cacheTag(), revalidateTag() for caching, invalidation, static/dynamic optimization. Auto-activates on cacheComponents: true.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Share bugs, ideas, or general feedback.
Minimal working example: connect to Salesforce, run a SOQL query, and perform basic CRUD on standard sObjects (Account, Contact, Lead).
salesforce-install-auth setupnpm install jsforce)import jsforce from 'jsforce';
const conn = new jsforce.Connection({
loginUrl: process.env.SF_LOGIN_URL || 'https://login.salesforce.com',
});
await conn.login(
process.env.SF_USERNAME!,
process.env.SF_PASSWORD! + process.env.SF_SECURITY_TOKEN!
);
// Your first SOQL query — fetch 5 Accounts
const result = await conn.query(
"SELECT Id, Name, Industry, AnnualRevenue FROM Account LIMIT 5"
);
console.log(`Total records: ${result.totalSize}`);
for (const account of result.records) {
console.log(` ${account.Name} — ${account.Industry ?? 'N/A'}`);
}
// Create a new Account
const newAccount = await conn.sobject('Account').create({
Name: 'Acme Corporation',
Industry: 'Technology',
Website: 'https://acme.example.com',
NumberOfEmployees: 250,
});
console.log('Created Account ID:', newAccount.id);
console.log('Success:', newAccount.success);
// Retrieve specific fields by record ID
const account = await conn.sobject('Account').retrieve(newAccount.id);
console.log('Account Name:', account.Name);
// Or use SOQL for more control
const result = await conn.query(
`SELECT Id, Name, Industry, CreatedDate
FROM Account
WHERE Id = '${newAccount.id}'`
);
const updateResult = await conn.sobject('Account').update({
Id: newAccount.id,
Industry: 'Software',
Description: 'Updated via jsforce API',
});
console.log('Updated:', updateResult.success);
const deleteResult = await conn.sobject('Account').destroy(newAccount.id);
console.log('Deleted:', deleteResult.success);
from simple_salesforce import Salesforce
import os
sf = Salesforce(
username=os.environ['SF_USERNAME'],
password=os.environ['SF_PASSWORD'],
security_token=os.environ['SF_SECURITY_TOKEN']
)
# SOQL query
result = sf.query("SELECT Id, Name, Industry FROM Account LIMIT 5")
for record in result['records']:
print(f" {record['Name']} — {record.get('Industry', 'N/A')}")
# Create
new_account = sf.Account.create({'Name': 'Acme Corp', 'Industry': 'Technology'})
print(f"Created: {new_account['id']}")
# Update
sf.Account.update(new_account['id'], {'Industry': 'Software'})
# Delete
sf.Account.delete(new_account['id'])
| Error | Cause | Solution |
|---|---|---|
INVALID_FIELD | Field name wrong in SOQL | Check field API names in Setup > Object Manager |
MALFORMED_QUERY | SOQL syntax error | Verify quotes, field names, WHERE clause |
INVALID_TYPE | sObject name wrong | Use API name (e.g., Account, not Accounts) |
REQUIRED_FIELD_MISSING | Missing required field on create | Add required fields (e.g., Name for Account) |
ENTITY_IS_DELETED | Record already deleted | Query with isDeleted = true to find in Recycle Bin |
Proceed to salesforce-local-dev-loop for development workflow setup.