SlideShare a Scribd company logo
1 of 26
Download to read offline
Loading data without Apex/SOQL
in Lightning Components
Lightning Data Service: Eliminate Your Need to Load Records Through Controllers
​ Carolyn Grabill
​ SMTS Software Engineer
​ cgrabill@salesforce.com
​ @CarolynCodes
​ 
Kevin Venkiteswaran
PMTS Software Engineer
kvenkiteswaran@salesforce.com
@kevinv11n
​ 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.
Safe Harbor
Agenda
•  The Problem
•  The <force:record> Component
•  Demonstration + Code
•  <force:record> in the Lightning Experience
•  Roadmap
•  Questions
The Problem
Many components need access to the same data
Data re-use across components
​ Highlights and Details
components display data
from the same Opportunity
record
Multiple SOQL calls for the same data
Highlights cmp
Name: Acme Anvils
Phone: (123) 456-7890
Details cmp
Name: Acme Anvils
Phone: (123) 456-7890
Address: 123 Main St
Amount: $500
Owner: Wile E. Coyote
Component
controller
Apex
controller SOQL
Component
controller
Apex
controller
SOQL
Client Server
Multiple SOQL calls for the same data
Highlights cmp
Name: Acme Anvils
Phone: (123) 456-7890
Details cmp
Name: Acme Anvils
Phone: (123) 456-7890
Address: 123 Main St
Amount: $500
Owner: Wile E. Coyote
Component
controller
Apex
controller SOQL
Component
controller
Apex
controller
SOQL
Client Server
Lots of custom code!
The <force:record> component
<force:record>
Standard component in “force”
namespace
(#SafeHarbor)
Shared
Record
Cache
<force:record
recordId=“001x00123”
fields=“Id,Name” />
Client
Server
Fetches record
Auto
SOQL
Automatic record loading
Multiple SOQL calls for the same data
Highlights cmp
Name: Acme Anvils
Phone: (123) 456-7890
Details cmp
Name: Acme Anvils
Phone: (123) 456-7890
Address: 123 Main St
Amount: $500
Owner: Wile E. Coyote
Component
controller
Apex
controller SOQL
Component
controller
Apex
controller
SOQL
Client Server
<force:record> handles loading records
Highlights cmp
Name: Acme Anvils
Phone: (123) 456-7890
Details cmp
Name: Acme Anvils
Phone: (123) 456-7890
Address: 123 Main St
Amount: $500
Owner: Wile E. Coyote
force:recordcontroller
force:record
controller
<force:record>
Shared
Record
Cache
Consolidated
requests
Client Server
<force:record>
<force:record>
No server trip on cache hits!
Highlights cmp
Name: Acme Anvils
Phone: (123) 456-7890
Details cmp
Name: Acme Anvils
Phone: (123) 456-7890
Address: 123 Main St
Amount: $500
Owner: Wile E. Coyote
force:recordcontroller
force:record
controller
Shared
Record
Cache
Client Server
<force:record>
​ 
<aura:component controller="MyApexController">
​  <aura:attribute name="recordId" type="String" />
​  <aura:attribute name="record" type="SObject" />
<aura:handler name="change”
value="{!v.recordId}”
action="{!c.getRecord}"/>
​ 
<ui:inputText label="Record Name"
value="{!v.record.Name}"/>
​ </aura:component>
Simple refactor - BEFORE
​ Lightning Component Apex Controller
​ 
public with sharing class MyApexController {
​  @AuraEnabled
​  public static <SObject> getRecord(String recordId) {
​  return [SELECT Id, Name FROM <SObject>
WHERE Id = :recordId];
}
​ }
<aura:component>
​  <aura:attribute name="recordId" type="String" />
​  <aura:attribute name="record" type="SObject" />
<force:record recordId="{!v.recordId}"
targetRecord="{!v.record}"
fields="Id, Name"/>
​  <ui:inputText label="Record Name"
value="{!v.record.Name}"/>
​ </aura:component>
Simple refactor - AFTER
​ Lightning Component No Apex Controller Needed
•  No Apex or SOQL
•  Performance boost from client cache
•  Data available offline
•  Data consistency across components
•  Automatic record refresh from server
•  Automatic notification when record
changes
•  Components can be entity-agnostic
Benefits of <force:record> over custom record loading
Demonstration
Campground custom object
​ Two important fields:
•  Name
•  Location
<force:record> in
Lightning Experience
​ Opportunity List ​ Opportunity Record
+ hover on parent Account
​ Account Record
<force:record> in record browsing flow
​ Same Opportunity record in
list view and highlights
Same Account record in
preview and highlights
components
Page load time improved
​ Experienced page time (milliseconds) before and after highlights component
refactored to use <force:record>
0
200
400
600
800
1000
1200
1400
1600
Opportunities Accounts Users
Before <force:record>
After <force:record>
EPT(ms)
•  No Apex or SOQL
•  Performance boost from client cache
•  Data available offline
•  Data consistency across components
•  Automatic record refresh from server
•  Automatic notification when record
changes
•  Components can be entity-agnostic
Benefits of <force:record> over custom record loading
Roadmap
•  More optimizations to record
loading
•  Proactive loading of records
•  Advanced record loading with Aura
method load() 

•  Deleting records with Aura method
delete()

Future of <force:record>
•  Saving records with Aura method
save()

•  Securely storing draft records when
offline
•  Supporting lists of records
Thank you
Questions?

More Related Content

What's hot

Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce IntegrationJoshua Hoskins
 
Automate the development lifecycle with cumulus ci on april 9th, 2020
Automate the development lifecycle with cumulus ci on april 9th, 2020Automate the development lifecycle with cumulus ci on april 9th, 2020
Automate the development lifecycle with cumulus ci on april 9th, 2020Sudipta Deb ☁
 
Salesforce Partner Program for ISV Partners
Salesforce Partner Program for ISV PartnersSalesforce Partner Program for ISV Partners
Salesforce Partner Program for ISV PartnersSalesforce Partners
 
Flow in Salesforce
Flow in SalesforceFlow in Salesforce
Flow in Salesforcevikas singh
 
Why Flow with Salesforce Flow
Why Flow with Salesforce FlowWhy Flow with Salesforce Flow
Why Flow with Salesforce FlowAjeet Singh
 
Mule salesforce integration solutions
Mule  salesforce integration solutionsMule  salesforce integration solutions
Mule salesforce integration solutionshimajareddys
 
Introducing the Salesforce platform
Introducing the Salesforce platformIntroducing the Salesforce platform
Introducing the Salesforce platformJohn Stevenson
 
Non Functional Requirement.
Non Functional Requirement.Non Functional Requirement.
Non Functional Requirement.Khushboo Shaukat
 
Power Apps Accessibility.pptx
Power Apps Accessibility.pptxPower Apps Accessibility.pptx
Power Apps Accessibility.pptxApril Dunnam
 
Deep dive into Salesforce Connected App
Deep dive into Salesforce Connected AppDeep dive into Salesforce Connected App
Deep dive into Salesforce Connected AppDhanik Sahni
 
Integrating with salesforce using platform events
Integrating with salesforce using platform eventsIntegrating with salesforce using platform events
Integrating with salesforce using platform eventsAmit Chaudhary
 
How To Integrate Salesforce With Outlook
How To Integrate Salesforce With OutlookHow To Integrate Salesforce With Outlook
How To Integrate Salesforce With OutlookCloud Analogy
 
Lightning customization with lightning app builder
Lightning customization with lightning app builderLightning customization with lightning app builder
Lightning customization with lightning app builderSalesforce Developers
 
Salesforce Multitenant Architecture: How We Do the Magic We Do
Salesforce Multitenant Architecture: How We Do the Magic We DoSalesforce Multitenant Architecture: How We Do the Magic We Do
Salesforce Multitenant Architecture: How We Do the Magic We DoSalesforce Developers
 

What's hot (20)

Introduction to salesforce ppt
Introduction to salesforce pptIntroduction to salesforce ppt
Introduction to salesforce ppt
 
Power query
Power queryPower query
Power query
 
Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce Integration
 
Introduction to Apex for Developers
Introduction to Apex for DevelopersIntroduction to Apex for Developers
Introduction to Apex for Developers
 
Automate the development lifecycle with cumulus ci on april 9th, 2020
Automate the development lifecycle with cumulus ci on april 9th, 2020Automate the development lifecycle with cumulus ci on april 9th, 2020
Automate the development lifecycle with cumulus ci on april 9th, 2020
 
Salesforce Partner Program for ISV Partners
Salesforce Partner Program for ISV PartnersSalesforce Partner Program for ISV Partners
Salesforce Partner Program for ISV Partners
 
Architect day 20181128 - Afternoon Session
Architect day 20181128 - Afternoon SessionArchitect day 20181128 - Afternoon Session
Architect day 20181128 - Afternoon Session
 
Flow in Salesforce
Flow in SalesforceFlow in Salesforce
Flow in Salesforce
 
Why Flow with Salesforce Flow
Why Flow with Salesforce FlowWhy Flow with Salesforce Flow
Why Flow with Salesforce Flow
 
Mule salesforce integration solutions
Mule  salesforce integration solutionsMule  salesforce integration solutions
Mule salesforce integration solutions
 
Introducing the Salesforce platform
Introducing the Salesforce platformIntroducing the Salesforce platform
Introducing the Salesforce platform
 
Non Functional Requirement.
Non Functional Requirement.Non Functional Requirement.
Non Functional Requirement.
 
Power Apps Accessibility.pptx
Power Apps Accessibility.pptxPower Apps Accessibility.pptx
Power Apps Accessibility.pptx
 
Deep dive into Salesforce Connected App
Deep dive into Salesforce Connected AppDeep dive into Salesforce Connected App
Deep dive into Salesforce Connected App
 
Integrating with salesforce using platform events
Integrating with salesforce using platform eventsIntegrating with salesforce using platform events
Integrating with salesforce using platform events
 
How To Integrate Salesforce With Outlook
How To Integrate Salesforce With OutlookHow To Integrate Salesforce With Outlook
How To Integrate Salesforce With Outlook
 
Introduction to Apex Triggers
Introduction to Apex TriggersIntroduction to Apex Triggers
Introduction to Apex Triggers
 
Lightning customization with lightning app builder
Lightning customization with lightning app builderLightning customization with lightning app builder
Lightning customization with lightning app builder
 
Salesforce Multitenant Architecture: How We Do the Magic We Do
Salesforce Multitenant Architecture: How We Do the Magic We DoSalesforce Multitenant Architecture: How We Do the Magic We Do
Salesforce Multitenant Architecture: How We Do the Magic We Do
 
Introduction to Apex Triggers
Introduction to Apex TriggersIntroduction to Apex Triggers
Introduction to Apex Triggers
 

Similar to Lightning Data Service: Eliminate Your Need to Load Records Through Controllers

Building Apps Faster with Lightning and Winter '17
Building Apps Faster with Lightning and Winter '17Building Apps Faster with Lightning and Winter '17
Building Apps Faster with Lightning and Winter '17Mark Adcock
 
Building apps faster with lightning and winter '17
Building apps faster with lightning and winter '17Building apps faster with lightning and winter '17
Building apps faster with lightning and winter '17Salesforce Developers
 
Lightning components performance best practices
Lightning components performance best practicesLightning components performance best practices
Lightning components performance best practicesSalesforce Developers
 
Building Efficient Visualforce Pages
Building Efficient Visualforce PagesBuilding Efficient Visualforce Pages
Building Efficient Visualforce PagesSalesforce Developers
 
Building Efficient Visualforce Pages
Building Efficient Visualforce PagesBuilding Efficient Visualforce Pages
Building Efficient Visualforce PagesSFDCSregan
 
Javascript and Remote Objects on Force.com Winter 15
Javascript and Remote Objects on Force.com Winter 15Javascript and Remote Objects on Force.com Winter 15
Javascript and Remote Objects on Force.com Winter 15Peter Chittum
 
Solving Complex Data Load Challenges
Solving Complex Data Load ChallengesSolving Complex Data Load Challenges
Solving Complex Data Load ChallengesSunand P
 
Unleash the Power of Apex Realtime Debugger
Unleash the Power of Apex Realtime DebuggerUnleash the Power of Apex Realtime Debugger
Unleash the Power of Apex Realtime DebuggerSalesforce Developers
 
Scaling to Millions of Devices and Billions of Events
Scaling to Millions of Devices and Billions of EventsScaling to Millions of Devices and Billions of Events
Scaling to Millions of Devices and Billions of EventsSalesforce Developers
 
Event Driven Integrations
Event Driven IntegrationsEvent Driven Integrations
Event Driven IntegrationsDeepu Chacko
 
Lightning Flow Actions
Lightning Flow ActionsLightning Flow Actions
Lightning Flow Actionsmisswlee
 
アドバンスドLightningコンポーネント:品質の高いコンポーネント開発のためのTips
アドバンスドLightningコンポーネント:品質の高いコンポーネント開発のためのTipsアドバンスドLightningコンポーネント:品質の高いコンポーネント開発のためのTips
アドバンスドLightningコンポーネント:品質の高いコンポーネント開発のためのTipsSalesforce Developers Japan
 
Innovation Showcase: Top Financial Services Apps Built on App Cloud
Innovation Showcase: Top Financial Services Apps Built on App CloudInnovation Showcase: Top Financial Services Apps Built on App Cloud
Innovation Showcase: Top Financial Services Apps Built on App CloudDreamforce
 
Innovation Showcase: How Amazon and USAA Build Inspiring Apps on App Cloud
Innovation Showcase: How Amazon and USAA Build Inspiring Apps on App CloudInnovation Showcase: How Amazon and USAA Build Inspiring Apps on App Cloud
Innovation Showcase: How Amazon and USAA Build Inspiring Apps on App CloudDreamforce
 
Lightning Component Framework from 0 to App
Lightning Component Framework from 0 to AppLightning Component Framework from 0 to App
Lightning Component Framework from 0 to AppDiego Szuster Marçal
 
Intro to Apex - Salesforce Force Friday Webinar
Intro to Apex - Salesforce Force Friday Webinar Intro to Apex - Salesforce Force Friday Webinar
Intro to Apex - Salesforce Force Friday Webinar Abhinav Gupta
 
Hca advanced developer workshop
Hca advanced developer workshopHca advanced developer workshop
Hca advanced developer workshopDavid Scruggs
 

Similar to Lightning Data Service: Eliminate Your Need to Load Records Through Controllers (20)

Building Apps Faster with Lightning and Winter '17
Building Apps Faster with Lightning and Winter '17Building Apps Faster with Lightning and Winter '17
Building Apps Faster with Lightning and Winter '17
 
Building apps faster with lightning and winter '17
Building apps faster with lightning and winter '17Building apps faster with lightning and winter '17
Building apps faster with lightning and winter '17
 
Lightning components performance best practices
Lightning components performance best practicesLightning components performance best practices
Lightning components performance best practices
 
Winter 14 Release Developer Preview
Winter 14 Release Developer PreviewWinter 14 Release Developer Preview
Winter 14 Release Developer Preview
 
Building Efficient Visualforce Pages
Building Efficient Visualforce PagesBuilding Efficient Visualforce Pages
Building Efficient Visualforce Pages
 
Building Efficient Visualforce Pages
Building Efficient Visualforce PagesBuilding Efficient Visualforce Pages
Building Efficient Visualforce Pages
 
Javascript and Remote Objects on Force.com Winter 15
Javascript and Remote Objects on Force.com Winter 15Javascript and Remote Objects on Force.com Winter 15
Javascript and Remote Objects on Force.com Winter 15
 
Solving Complex Data Load Challenges
Solving Complex Data Load ChallengesSolving Complex Data Load Challenges
Solving Complex Data Load Challenges
 
Unleash the Power of Apex Realtime Debugger
Unleash the Power of Apex Realtime DebuggerUnleash the Power of Apex Realtime Debugger
Unleash the Power of Apex Realtime Debugger
 
Streaming API with Java
Streaming API with JavaStreaming API with Java
Streaming API with Java
 
Scaling to Millions of Devices and Billions of Events
Scaling to Millions of Devices and Billions of EventsScaling to Millions of Devices and Billions of Events
Scaling to Millions of Devices and Billions of Events
 
Event Driven Integrations
Event Driven IntegrationsEvent Driven Integrations
Event Driven Integrations
 
Lightning Flow Actions
Lightning Flow ActionsLightning Flow Actions
Lightning Flow Actions
 
アドバンスドLightningコンポーネント:品質の高いコンポーネント開発のためのTips
アドバンスドLightningコンポーネント:品質の高いコンポーネント開発のためのTipsアドバンスドLightningコンポーネント:品質の高いコンポーネント開発のためのTips
アドバンスドLightningコンポーネント:品質の高いコンポーネント開発のためのTips
 
Innovation Showcase: Top Financial Services Apps Built on App Cloud
Innovation Showcase: Top Financial Services Apps Built on App CloudInnovation Showcase: Top Financial Services Apps Built on App Cloud
Innovation Showcase: Top Financial Services Apps Built on App Cloud
 
Innovation Showcase: How Amazon and USAA Build Inspiring Apps on App Cloud
Innovation Showcase: How Amazon and USAA Build Inspiring Apps on App CloudInnovation Showcase: How Amazon and USAA Build Inspiring Apps on App Cloud
Innovation Showcase: How Amazon and USAA Build Inspiring Apps on App Cloud
 
Lightning Component Framework from 0 to App
Lightning Component Framework from 0 to AppLightning Component Framework from 0 to App
Lightning Component Framework from 0 to App
 
Intro to Apex - Salesforce Force Friday Webinar
Intro to Apex - Salesforce Force Friday Webinar Intro to Apex - Salesforce Force Friday Webinar
Intro to Apex - Salesforce Force Friday Webinar
 
Lightning Components: The Future
Lightning Components: The FutureLightning Components: The Future
Lightning Components: The Future
 
Hca advanced developer workshop
Hca advanced developer workshopHca advanced developer workshop
Hca advanced developer workshop
 

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

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

Recently uploaded

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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
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
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
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
 
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 convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
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
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 

Recently uploaded (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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
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 ...
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
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
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
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 convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
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
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 

Lightning Data Service: Eliminate Your Need to Load Records Through Controllers

  • 1. Loading data without Apex/SOQL in Lightning Components Lightning Data Service: Eliminate Your Need to Load Records Through Controllers ​ Carolyn Grabill ​ SMTS Software Engineer ​ cgrabill@salesforce.com ​ @CarolynCodes ​  Kevin Venkiteswaran PMTS Software Engineer kvenkiteswaran@salesforce.com @kevinv11n
  • 2. ​ 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. Safe Harbor
  • 3. Agenda •  The Problem •  The <force:record> Component •  Demonstration + Code •  <force:record> in the Lightning Experience •  Roadmap •  Questions
  • 4. The Problem Many components need access to the same data
  • 5. Data re-use across components ​ Highlights and Details components display data from the same Opportunity record
  • 6. Multiple SOQL calls for the same data Highlights cmp Name: Acme Anvils Phone: (123) 456-7890 Details cmp Name: Acme Anvils Phone: (123) 456-7890 Address: 123 Main St Amount: $500 Owner: Wile E. Coyote Component controller Apex controller SOQL Component controller Apex controller SOQL Client Server
  • 7. Multiple SOQL calls for the same data Highlights cmp Name: Acme Anvils Phone: (123) 456-7890 Details cmp Name: Acme Anvils Phone: (123) 456-7890 Address: 123 Main St Amount: $500 Owner: Wile E. Coyote Component controller Apex controller SOQL Component controller Apex controller SOQL Client Server Lots of custom code!
  • 9. <force:record> Standard component in “force” namespace (#SafeHarbor)
  • 11. Multiple SOQL calls for the same data Highlights cmp Name: Acme Anvils Phone: (123) 456-7890 Details cmp Name: Acme Anvils Phone: (123) 456-7890 Address: 123 Main St Amount: $500 Owner: Wile E. Coyote Component controller Apex controller SOQL Component controller Apex controller SOQL Client Server
  • 12. <force:record> handles loading records Highlights cmp Name: Acme Anvils Phone: (123) 456-7890 Details cmp Name: Acme Anvils Phone: (123) 456-7890 Address: 123 Main St Amount: $500 Owner: Wile E. Coyote force:recordcontroller force:record controller <force:record> Shared Record Cache Consolidated requests Client Server <force:record>
  • 13. <force:record> No server trip on cache hits! Highlights cmp Name: Acme Anvils Phone: (123) 456-7890 Details cmp Name: Acme Anvils Phone: (123) 456-7890 Address: 123 Main St Amount: $500 Owner: Wile E. Coyote force:recordcontroller force:record controller Shared Record Cache Client Server <force:record>
  • 14. ​  <aura:component controller="MyApexController"> ​  <aura:attribute name="recordId" type="String" /> ​  <aura:attribute name="record" type="SObject" /> <aura:handler name="change” value="{!v.recordId}” action="{!c.getRecord}"/> ​  <ui:inputText label="Record Name" value="{!v.record.Name}"/> ​ </aura:component> Simple refactor - BEFORE ​ Lightning Component Apex Controller ​  public with sharing class MyApexController { ​  @AuraEnabled ​  public static <SObject> getRecord(String recordId) { ​  return [SELECT Id, Name FROM <SObject> WHERE Id = :recordId]; } ​ }
  • 15. <aura:component> ​  <aura:attribute name="recordId" type="String" /> ​  <aura:attribute name="record" type="SObject" /> <force:record recordId="{!v.recordId}" targetRecord="{!v.record}" fields="Id, Name"/> ​  <ui:inputText label="Record Name" value="{!v.record.Name}"/> ​ </aura:component> Simple refactor - AFTER ​ Lightning Component No Apex Controller Needed
  • 16. •  No Apex or SOQL •  Performance boost from client cache •  Data available offline •  Data consistency across components •  Automatic record refresh from server •  Automatic notification when record changes •  Components can be entity-agnostic Benefits of <force:record> over custom record loading
  • 18. Campground custom object ​ Two important fields: •  Name •  Location
  • 20. ​ Opportunity List ​ Opportunity Record + hover on parent Account ​ Account Record <force:record> in record browsing flow ​ Same Opportunity record in list view and highlights Same Account record in preview and highlights components
  • 21. Page load time improved ​ Experienced page time (milliseconds) before and after highlights component refactored to use <force:record> 0 200 400 600 800 1000 1200 1400 1600 Opportunities Accounts Users Before <force:record> After <force:record> EPT(ms)
  • 22. •  No Apex or SOQL •  Performance boost from client cache •  Data available offline •  Data consistency across components •  Automatic record refresh from server •  Automatic notification when record changes •  Components can be entity-agnostic Benefits of <force:record> over custom record loading
  • 24. •  More optimizations to record loading •  Proactive loading of records •  Advanced record loading with Aura method load() 
 •  Deleting records with Aura method delete()
 Future of <force:record> •  Saving records with Aura method save()
 •  Securely storing draft records when offline •  Supporting lists of records