Salesforce Hello World Example

VerifiedSafe

Minimal Salesforce example with SOQL queries and CRUD operations in TypeScript and Python.

Sby Skills Guide Bot
DevelopmentBeginner
9/9/2026
Claude Code
#salesforce#soql#crm#crud#jsforce

Recommended for

Automated summary

Generates a minimal working Salesforce example — connecting through jsforce or simple_salesforce, running a SOQL query, and walking a CRUD cycle on the standard Account, Contact, and Lead sObjects.

Strengths

  • Ships runnable code in both TypeScript and Python for the same scenario
  • Covers the five core operations (connect/query, create, retrieve, update, destroy) as discrete numbered steps
  • Includes a table of common Salesforce errors (INVALID_FIELD, MALFORMED_QUERY, REQUIRED_FIELD_MISSING) with fixes
  • Reads credentials from environment variables instead of hardcoding secrets

Limitations

  • Assumes authentication is already set up by the salesforce-install-auth skill and that jsforce is installed
  • Covers standard sObjects only — no relationships, bulk operations, or governor limits
  • The provided SKILL.md is truncated partway through the error-handling table
When to use it

Use it to sanity-check a fresh Salesforce connection or to learn the basic API patterns before building a real integration.

When not to use it

Skip it if you need advanced territory such as Bulk API, relationship queries, metadata deployment, or a full OAuth flow.

Security analysis

Safe
Quality score88/100

The skill provides a Salesforce CRUD tutorial using standard API libraries (jsforce, simple_salesforce) and environment variables for credentials. It does not instruct shell commands, exfiltration, obfuscation, or disabling safety. Deleting a test Account is part of the tutorial and explicitly recommends using a sandbox and avoiding production orgs or real customer names.

No concerns found

How this analysis is made

Examples

TypeScript quick start
Write a Salesforce hello world in TypeScript with jsforce: log in from env vars, run a SOQL query for 5 Accounts, then create, update, and delete one.
Python equivalent
Show me the same Salesforce example in Python using simple_salesforce — query Accounts and then do create, update, and delete.
Debugging a SOQL error
My jsforce query fails with MALFORMED_QUERY. Walk me through the salesforce quick start example and tell me what's wrong with my SOQL.

name: salesforce-hello-world description: '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".

' allowed-tools: Read, Write, Edit version: 1.7.0 license: MIT author: Jeremy Longshore jeremy@intentsolutions.io tags:

  • saas
  • crm
  • salesforce compatibility: Designed for Claude Code

Salesforce Hello World

Overview

Minimal working example: connect to Salesforce, run a SOQL query, and perform basic CRUD on standard sObjects (Account, Contact, Lead).

Prerequisites

  • Completed salesforce-install-auth setup
  • jsforce installed (npm install jsforce)
  • Valid credentials in environment variables

Instructions

Step 1: Connect and Query Accounts

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'}`);
}

Step 2: Create a Record

// 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);

Step 3: Read a Record by ID

// 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}'`
);

Step 4: Update a Record

const updateResult = await conn.sobject('Account').update({
  Id: newAccount.id,
  Industry: 'Software',
  Description: 'Updated via jsforce API',
});
console.log('Updated:', updateResult.success);

Step 5: Delete a Record

const deleteResult = await conn.sobject('Account').destroy(newAccount.id);
console.log('Deleted:', deleteResult.success);

Python Example

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'])

Output

  • Successful SOQL query returning Account records
  • Created, read, updated, and deleted an Account sObject
  • Console output confirming each operation

Error Handling

| 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 |

Examples

Run a disposable CRUD smoke test in a sandbox

Authenticate with a sandbox-only integration user, create an Account whose name includes a unique test run ID, query it by that ID, and update only a non-sensitive test field. Assert the expected result count, delete the test record, and confirm it is absent from normal SOQL results. Never aim this tutorial at a production org or use real customer names; preserve only the run ID and pass/fail result in the test log.

Resources

Next Steps

Proceed to salesforce-local-dev-loop for development workflow setup.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/salesforce-hello-world-example-mttmx734/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/salesforce-hello-world-example-mttmx734' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/salesforce-hello-world-example-mttmx734/download' --output '.skill-downloads/salesforce-hello-world-example-mttmx734/SKILL.md.part' && mv '.skill-downloads/salesforce-hello-world-example-mttmx734/SKILL.md.part' '.skill-downloads/salesforce-hello-world-example-mttmx734/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Environment declared by the author: Designed for Claude Code

Tools declared by the author (check availability in your agent): Read, Write, Edit

Original excerpt: Prerequisites
  • Completed salesforce-install-auth setup
  • jsforce installed (npm install jsforce)
  • Valid credentials in environment variables

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/salesforce-hello-world-example-mttmx734/SKILL.md' && test -s '.skill-downloads/salesforce-hello-world-example-mttmx734/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/salesforce-hello-world' && cp -R '.skill-downloads/salesforce-hello-world-example-mttmx734' '.claude/skills/salesforce-hello-world'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/salesforce-hello-world-example-mttmx734'

openskills read 'salesforce-hello-world-example-mttmx734'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/salesforce-hello-world-example-mttmx734/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills