Using Salesforce
Practical guide for working with Salesforce objects, SOQL queries, and records through Fp Switchboard.
Quick Tips
Section titled “Quick Tips”- UI field labels do not equal API field names: “Customer Status” becomes
CustomerStatus__c - Custom fields end with
__c, relationships with__r - SOQL has no
SELECT *— must specify each field - SOQL null check:
WHERE Field = null(no quotes around null) - Record IDs are 15 or 18 character case-sensitive strings
Common Gotchas
Section titled “Common Gotchas”API Names vs UI Labels Critical
Section titled “API Names vs UI Labels ”Field labels in Salesforce UI differ from API names. Custom fields have __c suffix.
| Example | |
|---|---|
| Wrong | SELECT Customer Status FROM Account |
| Correct | SELECT CustomerStatus__c FROM Account |
SOQL No SELECT * Critical
Section titled “SOQL No SELECT * ”SOQL does not support SELECT *. Must explicitly list every field.
| Example | |
|---|---|
| Wrong | SELECT * FROM Account |
| Correct | SELECT Id, Name, Industry, Website FROM Account |
Error: MALFORMED_QUERY: unexpected token: *
NULL Check Syntax Important
Section titled “NULL Check Syntax ”SOQL null checks don’t use quotes.
| Example | |
|---|---|
| Wrong | WHERE CustomField__c = "NULL" |
| Correct | WHERE CustomField__c = null |
15 vs 18 Character IDs Important
Section titled “15 vs 18 Character IDs ”15-char IDs are case-sensitive (from UI). 18-char IDs are case-insensitive (API-safe). Use 18-char for reliable comparisons.
Relationship Suffixes Important
Section titled “Relationship Suffixes ”Standard relationships use no suffix. Custom relationships use __r.
| Example | |
|---|---|
| Standard | SELECT Account.Name FROM Contact |
| Custom | SELECT Account__r.Name FROM CustomObject__c |
Multi-Step Patterns
Section titled “Multi-Step Patterns”Query with Related Records
Section titled “Query with Related Records”- Parent lookup:
SELECT Contact.FirstName, Contact.Account.Name FROM Contact - Child subquery:
SELECT Name, (SELECT LastName FROM Contacts) FROM Account - Use PLURAL relationship name in subqueries
Find Field API Names
Section titled “Find Field API Names”- Use Describe call:
GET /sobjects/Account/describe - Look for field
nameproperty (notlabel) - Use those names in SOQL queries
ID Format Reference
Section titled “ID Format Reference”| ID Type | Format | Example |
|---|---|---|
| Record ID (15-char) | 15 alphanumeric | 001xx000003DGbY |
| Record ID (18-char) | 18 alphanumeric | 001xx000003DGbYAAW |
SOQL Quick Reference
Section titled “SOQL Quick Reference”| Query | Description |
|---|---|
SELECT Id, Name FROM Account LIMIT 10 | Basic query |
WHERE Industry = 'Technology' | Filter by field |
WHERE CreatedDate = TODAY | Date literal |
WHERE Name LIKE '%Corp%' | Wildcard search |
ORDER BY CreatedDate DESC | Sort results |
WHERE CustomField__c = null | Null check (no quotes) |
Example Prompts
Section titled “Example Prompts”- “List my Salesforce opportunities closing this quarter”
- “Create a new lead for John Smith at TechCorp”
- “Search contacts at companies in the healthcare industry”
- “Update the deal stage for opportunity ABC to Closed Won”
- “Show all accounts created this month”
Rate Limits
Section titled “Rate Limits”| Edition | Limit |
|---|---|
| Enterprise | 100,000 API calls/24 hours |
| Unlimited | 5,000,000 API calls/24 hours |
| Per-user concurrent | 25 long-running requests |