BookatlasTwo-Day MuleSoft → Salesforce Bootcamp
Module 5 — Salesforce Data Model + SOQL

Module 5 — Salesforce Data Model + SOQL

You do not need to become a Salesforce developer in two days. You need enough Salesforce fluency that when somebody says:

“Query Contacts whose Accounts are active, then update a custom field on those Contacts”

you immediately understand the object relationships and can write or reason about the SOQL.

SOQL is Salesforce’s query language. It looks like SQL, but it is object/relationship-oriented rather than a general relational query language. Salesforce explicitly recommends SOQL when you know which objects/fields contain the data and when you need to query related Salesforce objects.

5.1First: Salesforce is basically an object databaseThink:27 words5.2The four objects you should knowUsually represents a:23 words5.3OpportunityAn Opportunity normally represents a potential sale/deal.24 words5.4CaseA Case usually represents a customer service/support issue.27 words5.5Standard versus custom objectsSalesforce standard object:20 words5.6Don't confuse labels with API namesThe Salesforce UI might display:41 words5.7Salesforce IDsSalesforce assigns an Id to every record.37 words5.8Lookup relationshipsImagine:30 words5.9Lookup vs Master-DetailDon't go too deep unless asked.43 words5.10SOQL basicsBasic syntax:20 words5.11One major difference from SQLDon't instinctively write:37 words5.12Query by External IDThis should look completely natural now:16 words5.13WHERE conditionsYou'll recognize:22 words5.14`IN`Very useful for Mule integration.25 words5.15NULLExample:12 words5.16DatesTypical Salesforce date/date-time fields include:18 words5.17Incremental synchronizationNaive approach:12 words5.18Be careful with watermarksSuppose your job runs:36 words5.19SOQL relationship queriesThis is the most important difference from traditional SQL for this module.44 words5.20Child → ParentWe're querying Contact:19 words5.21Filtering using the parentSuppose interviewer says:24 words5.22Interview scenarioFind Contacts belonging to active enterprise Accounts.18 words5.23Parent → ChildrenNow go the other direction.45 words5.24Child relationship names with custom objectsImagine:36 words5.25Parent relationship on a custom lookupSuppose:28 words5.26Your SQL instincts can hurt youSQL brain:12 words5.27Semi-joinsSuppose we want Accounts that have Contacts meeting a condition.34 words5.28`LIKE`Example:7 words5.29ORDER BYFor deterministic pagination/integration logic, sorting can matter.15 words5.30LIMITGreat during:26 words5.31COUNTExample:27 words5.32Other aggregate conceptsRecognize:18 words5.33A great QA/developer use case: reconciliationSay Mule imports:21 words5.34Avoid querying unnecessary fieldsBad:9 words5.35Avoid query-per-recordClassic N+1 problem.32 words5.36Building a lookup map in DataWeaveSuppose Salesforce returns:38 words5.37SOQL versus SOSLKnow the distinction.49 words5.38Object security mattersJust because:38 words5.39Sandbox versus production schema driftImagine QA Salesforce:25 words5.40Salesforce validation rulesA perfectly valid Mule request can still fail downstream.45 words5.41Salesforce automation can surprise youA Mule upsert may cause:28 words5.42Scenario 1 — find the AccountRequirement:12 words5.43Scenario 2 — retrieve ContactsRequirement:25 words5.44Scenario 3 — Account and Contacts togetherResult conceptually:11 words5.45Scenario 4 — Open OpportunitiesRetrieve open Opportunities over $100,000 for active Accounts.28 words5.46Scenario 5 — CasesRetrieve open high-priority Cases for customer C001.17 words5.47Scenario 6 — incremental Mule jobEvery 15 minutes:18 words5.48The interview question I promisedInterviewer:60 words5.49Questions they may ask“It's SQL-like, but designed specifically around Salesforce objects and relationships. Rather than arbitrary SQL joins, you usually…204 words5.50What you actually need to memorizeThis:21 words•Module 5 condensed cheat sheetThe next module should be Module 6: Mule routing and orchestration — Choice, For Each, Parallel For Each, Scatter-Gather, Flow Reference…57 words
← PreviousModule 4 — Salesforce Connector