Skip to content

Using Salesforce

Practical guide for working with Salesforce objects, SOQL queries, and records through Fp Switchboard.

  • 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

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
WrongSELECT Customer Status FROM Account
CorrectSELECT CustomerStatus__c FROM Account

SOQL does not support SELECT *. Must explicitly list every field.

Example
WrongSELECT * FROM Account
CorrectSELECT 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
WrongWHERE CustomField__c = "NULL"
CorrectWHERE 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
StandardSELECT Account.Name FROM Contact
CustomSELECT Account__r.Name FROM CustomObject__c
  1. Parent lookup: SELECT Contact.FirstName, Contact.Account.Name FROM Contact
  2. Child subquery: SELECT Name, (SELECT LastName FROM Contacts) FROM Account
  3. Use PLURAL relationship name in subqueries
  1. Use Describe call: GET /sobjects/Account/describe
  2. Look for field name property (not label)
  3. Use those names in SOQL queries
ID TypeFormatExample
Record ID (15-char)15 alphanumeric001xx000003DGbY
Record ID (18-char)18 alphanumeric001xx000003DGbYAAW
QueryDescription
SELECT Id, Name FROM Account LIMIT 10Basic query
WHERE Industry = 'Technology'Filter by field
WHERE CreatedDate = TODAYDate literal
WHERE Name LIKE '%Corp%'Wildcard search
ORDER BY CreatedDate DESCSort results
WHERE CustomField__c = nullNull check (no quotes)
  • “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”
EditionLimit
Enterprise100,000 API calls/24 hours
Unlimited5,000,000 API calls/24 hours
Per-user concurrent25 long-running requests