SlideShare une entreprise Scribd logo
1  sur  27
Webinar: Data Models,
Relationships and SOQL
April 8, 2014
Rob Woodward
Platform Solution Engineer
@robw116
Safe Harbor
Safe harbor statement under the Private Securities Litigation Reform Act of 1995:
This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties
materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or
implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking,
including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements
regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded
services or technology developments and customer contracts or use of our services.
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality
for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results
and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated
with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history,
our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer
deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further
information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for
the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing
important disclosures are available on the SEC Filings section of the Investor Information section of our Web site.
Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available
and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions
based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-
looking statements.
Agenda
Data Model & Relationships
Comparing Force.com with Relational DBMS
Relationship Types & the Predefined Join
Relationships & SOQL
SOQL vs SQL
Relationship Queries
Assumptions
 A basic understanding of the Force.com Platform
including:
– Creating Custom Objects
– Adding Custom Fields
– Navigating the UI
 Knowledge of relational database concepts
– Tables
– Primary/Foreign Keys
– Joins
Data Model and Relationships
Relationships and SOQL
Agenda
Data Model and the Force.com Platform
 sObject:
– Table-like data structure
• Records
• Fields
– Extensible
– Queryable/Updatable
– Relationships
 Automatic Features:
– User Interface
– Security
• CRUD
• Field-level
• Record-level (ACL)
– REST & SOAP APIs
Standard Data Model
 Standard Objects
– Account
– Contact
– Lead
– Opportunity
– Case
– …
 Standard Fields
– Id
– Name
– CreatedBy/Date
– LastModifiedBy/Date
– OwnerId
– IsDeleted
– …
Extensible Data Model
 Custom Objects
– Workshop__c
– Room__c
– …
 Custom Fields
– Status__c
– Type__c
– Start_Time__c
– End_Time__c
– …
Relationships: The Predefined Join
 RDBMS
– Join at runtime
with SQL or
view
 Force.com
– Predefined join
at design-time
– Similar to
integrity
constraints
Master-DetailLookup
Relationship Types
NeverOptional
Cascade
Clear
Field/Block/Cascade*
Nullability
Delete Behavior
Child Inherits from ParentIndependent Parent/Child
225
Record Sharing
Access
Max Allowed Fields
Demo Use Case:
– Community Centre
– Workshops and Rooms
Data Model and Relationships
Relationships and SOQL
Agenda
SOQL
 Salesforce Object Query Language
 SQL-like syntax
 Queries the Force.com Object Layer
 Used in:
– Apex
– Developer Tools (Developer Console, Eclipse, Workbench, …)
– API (REST, SOAP, Bulk, …)
From SQL to SOQL
 At first may look familiar
 Important differences
 Learn the differences
 Use good data design practices
From SQL to SOQL: The Familiar Bits
 Table-like structure
 Similar query syntax
 Indexed
 Transactional
 Triggers
SELECT Id, Name, Capacity__c
FROM Room__c
WHERE Capacity__c > 10
From SQL to SOQL: Immediate Differences
 No select *
 No views
 SOQL is read-only
 Limited indexes
 Object-relational mapping is automatic
 Schema changes protected
From SQL to SOQL: Differences To Learn
 sObjects are not actually tables – multi-tenant
environment
 Relationship metadata
– Management of referential integrity
– Predefines joins
– Relationship query syntax
 Query usage explicitly metered
– API Batch Limits
– Apex Governor Limits
The __c and __r Suffixes
Room__c
Workshop__c
Id
Id
Room__c
Room__r
Workshops__r Type:
List<Workshop__c>
Type: Id
Type: Room__c
1-M
Relationship Query: Child to Parent
SELECT Id, Name, Room__c,
Room__r.Id,
Room__r.Capacity__c
FROM Workshop__c
WHERE Status__c = ’Open’
[
{
"Id": "a0145000000aBf4AAE",
"Name": "Yoga for Beginners",
"Room__c": "a00vn000000dU3dAAE",
"Room__r": {
"Id": "a00vn000000dU3dAAE",
"Capacity__c": 10
}
},
{
"Id": "a0145000000aBf4AAE",
"Name": "Yoga for Beginners",
"Room__c": "",
"Room__r": ""
}, ...
]
Relationship Query: Parent to Child
SELECT Id, Name,
(SELECT Id, Status__c
FROM Workshops__r)
FROM Room__c
WHERE Capacity__c > 10
[
{
"Id": "a00vn000000dU3dAAE",
"Name": "Salon 1 West",
"Workshops__r": [
{
"Id": "a0145000000aBf4AAE",
"Status__c": "Open"
},
{
"Id": "a0145000000aBd4AAE",
"Status__c": "Full"
}
]
}, ...
]
Querying for Intersection
Select Id, Name,
Room__r.Name,
Room__r.Capacity__c
FROM Workshop__c
WHERE
Room__r.Capacity__c > 8
[
{
"Id": "a0145000000aBf4AAE",
"Name": "Yoga for Beginners",
"Room__c": "a00vn000000dU3dAAE",
"Room__r": {
"Id": "a00vn000000dU3dAAE",
"Capacity__c": 10
}
},
{...},
...
]
Aggregate Queries
SELECT
COUNT(Id) rmCount,
MAX(Capacity__c) maxRmCap,
Configuration__c
FROM Room__c
GROUP BY Configuration__c
[
{
"rmCount": 4,
"maxRmCap": 6,
"Configuration__c": "Classroom"
},
{
"rmCount": 2,
"maxRmCap": 10,
"Configuration__c": "Theatre"
},
...
]
Demo Use Case:
– Find a tally of empty spaces
being held for workshops that
are not actively enrolling
delegates
Recap
 Data Model &
Relationships
– Much that looks similar,
but
– Many important
differences
– Predefined Join
– Relationship Types
 Relationships & SOQL
– SOQL has relations but is
not “relational”
– Limits cannot be ignored
– Good design principles
still apply but check your
assumptions
Read More
 Article: From SQL to SOQL http://bit.ly/sql2soql
 SOQL-SOSL Guide http://bit.ly/soqlsosl
 Sharing http://bit.ly/sharingarch
 Limits http://bit.ly/apexgovlim
 Multi-Tenant Architecture http://bit.ly/sfmultiten
Next Webinar:
May 15: Intro to building Mobile Apps with
Salesforce1 Platform – No code required

Contenu connexe

Similaire à Salesforce1 Platform: Data Model, Relationships and Queries Webinar

Understanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We DoUnderstanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We DoSalesforce Developers
 
OData: A Standard API for Data Access
OData: A Standard API for Data AccessOData: A Standard API for Data Access
OData: A Standard API for Data AccessPat Patterson
 
Integrating with salesforce
Integrating with salesforceIntegrating with salesforce
Integrating with salesforceMark Adcock
 
Our API Evolution: From Metadata to Tooling API for Building Incredible Apps
Our API Evolution: From Metadata to Tooling API for Building Incredible AppsOur API Evolution: From Metadata to Tooling API for Building Incredible Apps
Our API Evolution: From Metadata to Tooling API for Building Incredible AppsDreamforce
 
Exploring SQL Server Azure Database Relationships Using Lightning Connect
Exploring SQL Server Azure Database Relationships Using Lightning ConnectExploring SQL Server Azure Database Relationships Using Lightning Connect
Exploring SQL Server Azure Database Relationships Using Lightning ConnectSalesforce Developers
 
Designing Custom REST and SOAP Interfaces on Force.com
Designing Custom REST and SOAP Interfaces on Force.comDesigning Custom REST and SOAP Interfaces on Force.com
Designing Custom REST and SOAP Interfaces on Force.comSalesforce Developers
 
Design Patterns Every ISV Needs to Know (October 15, 2014)
Design Patterns Every ISV Needs to Know (October 15, 2014)Design Patterns Every ISV Needs to Know (October 15, 2014)
Design Patterns Every ISV Needs to Know (October 15, 2014)Salesforce Partners
 
Get ready for your platform developer i certification webinar
Get ready for your platform developer i certification   webinarGet ready for your platform developer i certification   webinar
Get ready for your platform developer i certification webinarJackGuo20
 
Designing custom REST and SOAP interfaces on Force.com
Designing custom REST and SOAP interfaces on Force.comDesigning custom REST and SOAP interfaces on Force.com
Designing custom REST and SOAP interfaces on Force.comSteven Herod
 
Next Generation Web Services
Next Generation Web ServicesNext Generation Web Services
Next Generation Web Servicesdreamforce2006
 
Solving Complex Data Load Challenges
Solving Complex Data Load ChallengesSolving Complex Data Load Challenges
Solving Complex Data Load ChallengesSunand P
 
Moving Sharing to a Parallel Architecture
Moving Sharing to a Parallel ArchitectureMoving Sharing to a Parallel Architecture
Moving Sharing to a Parallel ArchitectureSalesforce Developers
 
Understanding Multitenancy and the Architecture of the Salesforce Platform
Understanding Multitenancy and the Architecture of the Salesforce PlatformUnderstanding Multitenancy and the Architecture of the Salesforce Platform
Understanding Multitenancy and the Architecture of the Salesforce PlatformSalesforce Developers
 
Hands-On Workshop: Introduction to Coding for on Force.com for Admins and Non...
Hands-On Workshop: Introduction to Coding for on Force.com for Admins and Non...Hands-On Workshop: Introduction to Coding for on Force.com for Admins and Non...
Hands-On Workshop: Introduction to Coding for on Force.com for Admins and Non...Salesforce Developers
 
Building towards a Composite API Framework in Salesforce
Building towards a Composite API Framework in SalesforceBuilding towards a Composite API Framework in Salesforce
Building towards a Composite API Framework in SalesforceSalesforce Developers
 
The Power of Salesforce APIs World Tour Edition
The Power of Salesforce APIs World Tour EditionThe Power of Salesforce APIs World Tour Edition
The Power of Salesforce APIs World Tour EditionPeter Chittum
 
New Powerful API Enhancements for Summer '15
New Powerful API Enhancements for Summer '15 New Powerful API Enhancements for Summer '15
New Powerful API Enhancements for Summer '15 Salesforce Developers
 
Intro to AppExchange - Building Composite Apps
Intro to AppExchange - Building Composite AppsIntro to AppExchange - Building Composite Apps
Intro to AppExchange - Building Composite Appsdreamforce2006
 

Similaire à Salesforce1 Platform: Data Model, Relationships and Queries Webinar (20)

Understanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We DoUnderstanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We Do
 
OData: A Standard API for Data Access
OData: A Standard API for Data AccessOData: A Standard API for Data Access
OData: A Standard API for Data Access
 
Integrating with salesforce
Integrating with salesforceIntegrating with salesforce
Integrating with salesforce
 
Our API Evolution: From Metadata to Tooling API for Building Incredible Apps
Our API Evolution: From Metadata to Tooling API for Building Incredible AppsOur API Evolution: From Metadata to Tooling API for Building Incredible Apps
Our API Evolution: From Metadata to Tooling API for Building Incredible Apps
 
Exploring SQL Server Azure Database Relationships Using Lightning Connect
Exploring SQL Server Azure Database Relationships Using Lightning ConnectExploring SQL Server Azure Database Relationships Using Lightning Connect
Exploring SQL Server Azure Database Relationships Using Lightning Connect
 
Designing Custom REST and SOAP Interfaces on Force.com
Designing Custom REST and SOAP Interfaces on Force.comDesigning Custom REST and SOAP Interfaces on Force.com
Designing Custom REST and SOAP Interfaces on Force.com
 
Beyond Custom Metadata Types
Beyond Custom Metadata TypesBeyond Custom Metadata Types
Beyond Custom Metadata Types
 
Design Patterns Every ISV Needs to Know (October 15, 2014)
Design Patterns Every ISV Needs to Know (October 15, 2014)Design Patterns Every ISV Needs to Know (October 15, 2014)
Design Patterns Every ISV Needs to Know (October 15, 2014)
 
Get ready for your platform developer i certification webinar
Get ready for your platform developer i certification   webinarGet ready for your platform developer i certification   webinar
Get ready for your platform developer i certification webinar
 
Designing custom REST and SOAP interfaces on Force.com
Designing custom REST and SOAP interfaces on Force.comDesigning custom REST and SOAP interfaces on Force.com
Designing custom REST and SOAP interfaces on Force.com
 
Next Generation Web Services
Next Generation Web ServicesNext Generation Web Services
Next Generation Web Services
 
Solving Complex Data Load Challenges
Solving Complex Data Load ChallengesSolving Complex Data Load Challenges
Solving Complex Data Load Challenges
 
Moving Sharing to a Parallel Architecture
Moving Sharing to a Parallel ArchitectureMoving Sharing to a Parallel Architecture
Moving Sharing to a Parallel Architecture
 
Understanding Multitenancy and the Architecture of the Salesforce Platform
Understanding Multitenancy and the Architecture of the Salesforce PlatformUnderstanding Multitenancy and the Architecture of the Salesforce Platform
Understanding Multitenancy and the Architecture of the Salesforce Platform
 
Hands-On Workshop: Introduction to Coding for on Force.com for Admins and Non...
Hands-On Workshop: Introduction to Coding for on Force.com for Admins and Non...Hands-On Workshop: Introduction to Coding for on Force.com for Admins and Non...
Hands-On Workshop: Introduction to Coding for on Force.com for Admins and Non...
 
Building towards a Composite API Framework in Salesforce
Building towards a Composite API Framework in SalesforceBuilding towards a Composite API Framework in Salesforce
Building towards a Composite API Framework in Salesforce
 
Exploring the Salesforce REST API
Exploring the Salesforce REST APIExploring the Salesforce REST API
Exploring the Salesforce REST API
 
The Power of Salesforce APIs World Tour Edition
The Power of Salesforce APIs World Tour EditionThe Power of Salesforce APIs World Tour Edition
The Power of Salesforce APIs World Tour Edition
 
New Powerful API Enhancements for Summer '15
New Powerful API Enhancements for Summer '15 New Powerful API Enhancements for Summer '15
New Powerful API Enhancements for Summer '15
 
Intro to AppExchange - Building Composite Apps
Intro to AppExchange - Building Composite AppsIntro to AppExchange - Building Composite Apps
Intro to AppExchange - Building Composite Apps
 

Plus de Salesforce Developers

Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSalesforce Developers
 
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceMaximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceSalesforce Developers
 
Local development with Open Source Base Components
Local development with Open Source Base ComponentsLocal development with Open Source Base Components
Local development with Open Source Base ComponentsSalesforce Developers
 
TrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsTrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsSalesforce Developers
 
Why developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaWhy developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaSalesforce Developers
 
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentCodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentSalesforce Developers
 
CodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsCodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsSalesforce Developers
 
Enterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsEnterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsSalesforce Developers
 
TrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsTrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsSalesforce Developers
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and TestingSalesforce Developers
 
LWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilityLWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilitySalesforce Developers
 
Lightning web components episode 2- work with salesforce data
Lightning web components   episode 2- work with salesforce dataLightning web components   episode 2- work with salesforce data
Lightning web components episode 2- work with salesforce dataSalesforce Developers
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionSalesforce Developers
 
Migrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPMigrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPSalesforce Developers
 
Scale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceScale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceSalesforce Developers
 
Replicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureReplicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureSalesforce Developers
 
Modern Development with Salesforce DX
Modern Development with Salesforce DXModern Development with Salesforce DX
Modern Development with Salesforce DXSalesforce Developers
 
Integrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectIntegrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectSalesforce Developers
 

Plus de Salesforce Developers (20)

Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce Developers
 
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceMaximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component Performance
 
Local development with Open Source Base Components
Local development with Open Source Base ComponentsLocal development with Open Source Base Components
Local development with Open Source Base Components
 
TrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsTrailheaDX India : Developer Highlights
TrailheaDX India : Developer Highlights
 
Why developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaWhy developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX India
 
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentCodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local Development
 
CodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsCodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web Components
 
Enterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsEnterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web Components
 
TrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsTrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer Highlights
 
Live coding with LWC
Live coding with LWCLive coding with LWC
Live coding with LWC
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and Testing
 
LWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilityLWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura Interoperability
 
Lightning web components episode 2- work with salesforce data
Lightning web components   episode 2- work with salesforce dataLightning web components   episode 2- work with salesforce data
Lightning web components episode 2- work with salesforce data
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An Introduction
 
Migrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPMigrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCP
 
Scale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceScale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in Salesforce
 
Replicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureReplicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data Capture
 
Modern Development with Salesforce DX
Modern Development with Salesforce DXModern Development with Salesforce DX
Modern Development with Salesforce DX
 
Get Into Lightning Flow Development
Get Into Lightning Flow DevelopmentGet Into Lightning Flow Development
Get Into Lightning Flow Development
 
Integrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectIntegrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS Connect
 

Dernier

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Dernier (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

Salesforce1 Platform: Data Model, Relationships and Queries Webinar

  • 1. Webinar: Data Models, Relationships and SOQL April 8, 2014
  • 2. Rob Woodward Platform Solution Engineer @robw116
  • 3. Safe Harbor Safe harbor statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward- looking statements.
  • 4. Agenda Data Model & Relationships Comparing Force.com with Relational DBMS Relationship Types & the Predefined Join Relationships & SOQL SOQL vs SQL Relationship Queries
  • 5. Assumptions  A basic understanding of the Force.com Platform including: – Creating Custom Objects – Adding Custom Fields – Navigating the UI  Knowledge of relational database concepts – Tables – Primary/Foreign Keys – Joins
  • 6. Data Model and Relationships Relationships and SOQL Agenda
  • 7. Data Model and the Force.com Platform  sObject: – Table-like data structure • Records • Fields – Extensible – Queryable/Updatable – Relationships  Automatic Features: – User Interface – Security • CRUD • Field-level • Record-level (ACL) – REST & SOAP APIs
  • 8. Standard Data Model  Standard Objects – Account – Contact – Lead – Opportunity – Case – …  Standard Fields – Id – Name – CreatedBy/Date – LastModifiedBy/Date – OwnerId – IsDeleted – …
  • 9. Extensible Data Model  Custom Objects – Workshop__c – Room__c – …  Custom Fields – Status__c – Type__c – Start_Time__c – End_Time__c – …
  • 10. Relationships: The Predefined Join  RDBMS – Join at runtime with SQL or view  Force.com – Predefined join at design-time – Similar to integrity constraints
  • 11. Master-DetailLookup Relationship Types NeverOptional Cascade Clear Field/Block/Cascade* Nullability Delete Behavior Child Inherits from ParentIndependent Parent/Child 225 Record Sharing Access Max Allowed Fields
  • 12. Demo Use Case: – Community Centre – Workshops and Rooms
  • 13. Data Model and Relationships Relationships and SOQL Agenda
  • 14. SOQL  Salesforce Object Query Language  SQL-like syntax  Queries the Force.com Object Layer  Used in: – Apex – Developer Tools (Developer Console, Eclipse, Workbench, …) – API (REST, SOAP, Bulk, …)
  • 15. From SQL to SOQL  At first may look familiar  Important differences  Learn the differences  Use good data design practices
  • 16. From SQL to SOQL: The Familiar Bits  Table-like structure  Similar query syntax  Indexed  Transactional  Triggers SELECT Id, Name, Capacity__c FROM Room__c WHERE Capacity__c > 10
  • 17. From SQL to SOQL: Immediate Differences  No select *  No views  SOQL is read-only  Limited indexes  Object-relational mapping is automatic  Schema changes protected
  • 18. From SQL to SOQL: Differences To Learn  sObjects are not actually tables – multi-tenant environment  Relationship metadata – Management of referential integrity – Predefines joins – Relationship query syntax  Query usage explicitly metered – API Batch Limits – Apex Governor Limits
  • 19. The __c and __r Suffixes Room__c Workshop__c Id Id Room__c Room__r Workshops__r Type: List<Workshop__c> Type: Id Type: Room__c 1-M
  • 20. Relationship Query: Child to Parent SELECT Id, Name, Room__c, Room__r.Id, Room__r.Capacity__c FROM Workshop__c WHERE Status__c = ’Open’ [ { "Id": "a0145000000aBf4AAE", "Name": "Yoga for Beginners", "Room__c": "a00vn000000dU3dAAE", "Room__r": { "Id": "a00vn000000dU3dAAE", "Capacity__c": 10 } }, { "Id": "a0145000000aBf4AAE", "Name": "Yoga for Beginners", "Room__c": "", "Room__r": "" }, ... ]
  • 21. Relationship Query: Parent to Child SELECT Id, Name, (SELECT Id, Status__c FROM Workshops__r) FROM Room__c WHERE Capacity__c > 10 [ { "Id": "a00vn000000dU3dAAE", "Name": "Salon 1 West", "Workshops__r": [ { "Id": "a0145000000aBf4AAE", "Status__c": "Open" }, { "Id": "a0145000000aBd4AAE", "Status__c": "Full" } ] }, ... ]
  • 22. Querying for Intersection Select Id, Name, Room__r.Name, Room__r.Capacity__c FROM Workshop__c WHERE Room__r.Capacity__c > 8 [ { "Id": "a0145000000aBf4AAE", "Name": "Yoga for Beginners", "Room__c": "a00vn000000dU3dAAE", "Room__r": { "Id": "a00vn000000dU3dAAE", "Capacity__c": 10 } }, {...}, ... ]
  • 23. Aggregate Queries SELECT COUNT(Id) rmCount, MAX(Capacity__c) maxRmCap, Configuration__c FROM Room__c GROUP BY Configuration__c [ { "rmCount": 4, "maxRmCap": 6, "Configuration__c": "Classroom" }, { "rmCount": 2, "maxRmCap": 10, "Configuration__c": "Theatre" }, ... ]
  • 24. Demo Use Case: – Find a tally of empty spaces being held for workshops that are not actively enrolling delegates
  • 25. Recap  Data Model & Relationships – Much that looks similar, but – Many important differences – Predefined Join – Relationship Types  Relationships & SOQL – SOQL has relations but is not “relational” – Limits cannot be ignored – Good design principles still apply but check your assumptions
  • 26. Read More  Article: From SQL to SOQL http://bit.ly/sql2soql  SOQL-SOSL Guide http://bit.ly/soqlsosl  Sharing http://bit.ly/sharingarch  Limits http://bit.ly/apexgovlim  Multi-Tenant Architecture http://bit.ly/sfmultiten
  • 27. Next Webinar: May 15: Intro to building Mobile Apps with Salesforce1 Platform – No code required