SlideShare ist ein Scribd-Unternehmen logo
1 von 53
Downloaden Sie, um offline zu lesen
Advanced Apex – Asynchronous Processes
March 29th
2016
#forcewebina
r
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.
Forward-Looking Statement
#forcewebina
r
Speakers
MJ Kahn
Vice President,
OpFocus, Inc.
Kartik Viswanadha
Director, OpFocus
Salesforce MVP
@logontokartik
#forcewebina
r
Go Social!
@salesforcedevs / #forcewebinar
Salesforce Developers
Salesforce Developers
Salesforce Developers
This webinar is being recorded! The video will be posted to YouTube and the
webinar recap page (same URL as registration).
#forcewebina
r
Agenda
• What is Asynchronous Process?
• Why we need it?
• Types of Asynchronous Processes in Salesforce
• Usage and Examples
• Comparison of various Asynchronous Processes
• Appendix
• Recap
#forcewebina
r
Pre-requisites
• Good understanding of Apex Programming on Salesforce
• Passion to learn the platform
The WHAT
#forcewebina
r
Asynchronous Process - Definition
• In computer
programs,
asynchronous
operation means
that a process
operates
independently of
other processes
#forcewebina
r
Asynchronous vs Synchronous
Synchronous
• Quick and
Immediate Actions
• Transactions are
immediate and
serial
• Normal governor
limits
Asynchronous
• Actions that will not
block the
transaction pr
process
• Duration is not a
Priority
• Higher governor
limits
#forcewebina
r
Asynchronous Process – Force.com
• Ensure fairness of
processing
• Ensure
transactional
capabilities
#forcewebina
r
Queue Based Framework
#forcewebina
r
Concepts
#forcewebina
r
Multi tenant Fair Share Handling - Delay
#forcewebina
r
Multi tenant Fair Share Handling - Delay
#forcewebina
r
Multi tenant Fair Share Handling – Extended Delay
All the rquests from Org 1 are moved back with an
Extended Delay
#forcewebina
r
The WHY
#forcewebina
r
Benefits
• User Efficiency
• Resource Efficiency
• Scalability
#forcewebina
r
Why Asynchronous Processes in Salesforce
• Avoid Governor Limits
• Mixed DML Operations
• Long Running User Operations
#forcewebina
r
Use Cases
• Send Data to an External System on a Insert or Update
• Complex Calculations or Analysis based on Data in Salesforce
• Report Runs
• Callouts to External Systems
#forcewebina
r
Use Case – Large Data Processing
#forcewebina
r
Use Case – Logic on Millions of Rows
• Supports complex logic on very
large datasets
• Scalable, robust, asynchronous
execution platform
• Scheduled or programmatically
executed
• Eliminate ‘data processing’
integrations
• Data cleansing, augmentation
• Automated batch process
#forcewebina
r
The HOW
#forcewebina
r
Types of Asynchronous Processes in Apex
• @future
• Queueable
• Batch Apex
• Schedulable
• Continuation
#forcewebina
r
Scenario
• Goal: Populate Account’s Billing Longitude/Latitude based on
Billing Address
• Assume we have a method that calls out to a web service and
returns the lon/lat for a given Account, in the Geocoding Utils class
public static LonLat geocodeAccount(Account acct) { … }
LonLat is a class with 2 Double properties.
• Solution: Write a trigger that calls this method.
• Problem: You can’t call out to a web service from a trigger.
#forcewebina
r
@future
• A public static method, decorated with @future
• Arguments:
• Primitives (Integer, String, etc.)
• Collections of primitives (List, Map, Set)
• NOT Sobjects or Apex objects
• You can use JSON.serialize() and pass in a String
• Returns void
@future
public class GeocodingUtils {
@future (callout=true)
public static void geocodeAccountFuture(Id accountId) {
Account acct =
[select Id, BillingStreet, BillingCity, BillingState, BillingPostalCode, BillingCountry
from Account
where Id = :accountId];
LonLat coordinates = geocodeAccount(acct);
if (coordinates != null) {
acct.BillingLongitude = coordinates.lon;
acct.BillingLatitude = coordinates.lat;
update acct;
}
}
}
@future – Account trigger
trigger Account on Account (before insert, before update) {
if (Trigger.isBefore && (Trigger.isInsert || Trigger.isUpdate)) {
// For each new Account or each existing Account whose Address has changed, geocode it
for (Account acct : Trigger.new) {
if (Trigger.isInsert ||
(Trigger.isUpdate && GeocodingUtils.addressChanged(acct, Trigger.oldMap.get(acct.Id)))) {
// Geocode the Account's address
GeocodingUtils.geocodeAccountFuture(acct.Id);
}
}
}
}
#forcewebina
r
Queueable Class
• A public class that implements the Queueable interface
• Includes an execute method that accepts only a QueueableContext
parameter
• The execute method can access instance properties for the
class
• Returns void
• Launch by calling System.enqueueJob(cls) with an instance of the
class.
• Returns an AsyncApexJob Id
Queueable Apex
public class GeocodingQueueable implements Queueable, Database.AllowsCallouts {
public Account[] lstAccounts = new Account[]{};
public void execute(QueueableContext ctx) {
// Process as many Accounts as we can
Account[] lstProcessed = new Account[]{};
Integer numProcessed;
for (numProcessed=0;
numProcessed < Limits.getLimitCallouts() && numProcessed<lstAccounts.size();
numProcessed++) {
Account acctGeo = lstAccounts[numProcessed];
GeocodingUtils.LonLat coordinates = GeocodingUtils.geocodeAccount(acctGeo);
if (coordinates != null) {
acctGeo.BillingLongitude = coordinates.lon;
acctGeo.BillingLatitude = coordinates.lat;
lstProcessed.add(acctGeo);
}
}
Queueable Apex
…
update lstProcessed;
// Remove the ones we just processed from the list.
for (Integer i=0; i<numProcessed; i++) {
lstAccounts.remove(0);
}
// If there are any remaining Accounts, chain a new Async job to process them.
// NOTE: As of Spring 16, a chained Queueable job cannot do a callout, so the next
// run of this execute() method will fail!
if (!lstAccounts.isEmpty()) {
Id jobID = System.enqueueJob(this);
}
}
}
Queueable Apex– Account trigger
trigger Account on Account (before insert, before update) {
if (Trigger.isBefore && (Trigger.isInsert || Trigger.isUpdate)) {
Account[] lstAccounts = new Account[]{};
for (Account acct : Trigger.new) {
if (Trigger.isInsert ||
(Trigger.isUpdate && GeocodingUtils.addressChanged(acct, Trigger.oldMap.get(acct.Id)))) {
Account acctGeo = new Account(Id=acct.Id);
acctGeo.BillingStreet = acct.BillingStreet;
acctGeo.BillingCity = acct.BillingCity;
acctGeo.BillingState = acct.BillingState;
acctGeo.BillingPostalCode = acct.BillingPostalCode;
acctGeo.BillingCountry = acct.BillingCountry;
lstAccounts.add(acctGeo);
}
}
if (!lstAccounts.isEmpty()) {
// Geocode the Account's address
GeocodingQueueable cls = new GeocodingQueueable();
cls.lstAccounts = lstAccounts;
Id jobID = System.enqueueJob(cls);
}
}
}
#forcewebina
r
Batchable Class
• A global class that implements the Database.Batchable interface
• Includes:
• Start method – identifies the scope (list of data to be processed)
• Execute method – processes a subset of the scoped records
• Finish method – does any post-job wrap-up
• Additional interfaces:
• Database.Stateful
• Database.AllowCallouts
#forcewebina
r
Batchable Class
• Launch by callling Database.executeBatch(cls) with an instance of
the class and an optional scope size
• Default scope size is 200
• Returns an AsyncApexJobId
Batch Apex
global class GeocodingBatch implements Database.Batchable<SObject>,
Database.AllowsCallouts, Database.Stateful {
global Integer numberOfAccountsUpdated = 0;
// Start method gets all Accounts that need to be geocoded
global Database.QueryLocator start(Database.BatchableContext bc) {
String query = 'select id from Account where Need_to_Geocode__c = true';
return Database.getQueryLocator(query);
}
Batch Apex
global void execute(Database.BatchableContext bc, List<SObject> lstSObjects) {
// Get the Accounts
Account[] lstAccounts =
[select Id, BillingStreet, BillingCity, BillingState, BillingPostalCode, BillingCountry
from Account where Id in :lstSObjects];
for (Account acct : lstAccounts) {
// Geocode the Account and save the results
GeocodingUtils.LonLat coordinates = GeocodingUtils.geocodeAccount(acct);
if (coordinates != null) {
acct.BillingLongitude = coordinates.lon;
acct.BillingLatitude = coordinates.lat;
}
acct.Need_to_Geocode__c = false;
}
update lstAccounts;
numberOfAccountsUpdated += lstAccounts.size();
}
Batch Apex
global void finish(Database.BatchableContext bc) {
// Send an email to let someone know how many Accounts we updated
System.debug('Number of Accounts updated: ' + numberOfAccountsUpdated);
}
} // End of class
Batchble Apex– Account trigger
trigger Account on Account (before insert, before update) {
if (Trigger.isBefore && (Trigger.isInsert || Trigger.isUpdate)) {
// For each new Account or each existing Account whose Address has changed,
// flag it to be geocoded later
for (Account acct : Trigger.new) {
if (Trigger.isInsert ||
(Trigger.isUpdate && GeocodingUtils.addressChanged(acct, Trigger.oldMap.get(acct.Id)))) {
acct.Need_to_Geocode__c = true;
}
}
}
}
#forcewebina
r
Schedulable Class
• A global class that implements the Schedulable interface
• Includes an execute method
Schedulable Apex
global class GeocodingSchedulable {
global void execute(SchedulableContext ctx) {
GeocodingBatch cls = new GeocodingBatch();
Integer batchSize = (Limits.getLimitCallouts() < 200) ? Limits.getLimitCallouts() : 200;
Id jobId = Database.executeBatch(cls, batchSize);
}
}
#forcewebina
r
Schedulable Class
• Schedule by calling
System.Schedule(‘job name’, cron expression, cls)
• Job Name is found in AsyncApexJob object
• Cron expression can be complex
• Returns an AsyncApexJob Id
#forcewebina
r
Schedulable Class
• Cron expression string
seconds minutes hours day_of_month month day_of_week optional_year
• Run at 30 minutes past midnight on Jan 1 every year
GeocodingSchedulable cls = new GeocodingSchedulable();
System.Schedule('Geocode on Jan 1', '0 30 0 1 1 ? *', cls);
• Run every hour
GeocodingSchedulable cls = new GeocodingSchedulable();
System.Schedule('Geocode on Jan 1', '0 0 * * * ? *', cls);
• Check the Apex Language Reference for details
#forcewebina
r
Summary of Techniques
• @future – static method, simple arguments, no monitoring, no
chaining
• Queueable – class with instance variables, can monitor, can chain
(within limits)
• Batch Apex – class with instance variables, great for large numbers
of records, can monitor
• Schedulable – class with instance variables, runs one or at
#forcewebina
r
Monitoring Async Apex
• For Queueable and Batchable
• When you launch the job, you get an AsyncApexJob Id
• Setup | Monitoring | Apex Jobs
• See doc for description of Status values
• For Schedulable
• When you schedule the job, you get a CronTrigger Id
• When it runs, it’s added to AsyncApexJobs
• Setup | Monitoring | Scheduled Jobs
• Add a list view filter for Type = Scheduled Apex
#forcewebina
r
Testing Async Apex
• Before launching the job, do Test.startTest()
• After launching the job, do Test.stopTest()
• One instance of the job will run before Test.stopTest() returns
#forcewebina
r
Recap
• Asynchronous Processes
• Salesforce Async Model & Framework
• Advantages of using Async processes
• Use Cases
• Types of Async Processes
• Comparison & Monitoring
#forcewebina
r
Resources
• https://developer.salesforce.
com/page/Loading_Large_Data_Sets_with_the_Force.
com_Bulk_API
• https://developer.salesforce.
com/page/Asynchronous_Processing_in_Force_com
• https://developer.salesforce.com/blogs/engineering/2014/05/flex-
batch-apex-muscles-flexqueue.html
#forcewebina
r
#forcewebina
r
Deploying Your Code
#forcewebina
r
Deploying Your Code
#forcewebina
r
Deploying Your Code
Got Questions?
developer.salesforce.com/forums/
Q&A
Your feedback is crucial to the success
of our webinar programs. Thank you!
Thank You
Try Trailhead: trailhead.salesforce.com
Join the conversation: @salesforcedevs

Weitere ähnliche Inhalte

Was ist angesagt?

Episode 19 - Asynchronous Apex - Batch apex & schedulers
Episode 19 - Asynchronous Apex - Batch apex & schedulersEpisode 19 - Asynchronous Apex - Batch apex & schedulers
Episode 19 - Asynchronous Apex - Batch apex & schedulersJitendra Zaa
 
Salesforce apex hours PayPal with Salesforce Integration
Salesforce apex hours   PayPal with Salesforce IntegrationSalesforce apex hours   PayPal with Salesforce Integration
Salesforce apex hours PayPal with Salesforce IntegrationAmit Singh
 
Salesforce Integration Patterns
Salesforce Integration PatternsSalesforce Integration Patterns
Salesforce Integration Patternsusolutions
 
Dive Deep into Apex: Advanced Apex!
Dive Deep into Apex: Advanced Apex! Dive Deep into Apex: Advanced Apex!
Dive Deep into Apex: Advanced Apex! Salesforce Developers
 
Dynamic input tables lwc vs aura vs. visualforce
Dynamic input tables  lwc vs aura vs. visualforceDynamic input tables  lwc vs aura vs. visualforce
Dynamic input tables lwc vs aura vs. visualforceMike Tetlow
 
Dive Deep Into the Force.com Canvas Framework
Dive Deep Into the Force.com Canvas FrameworkDive Deep Into the Force.com Canvas Framework
Dive Deep Into the Force.com Canvas FrameworkSalesforce Developers
 
Laravel introduction
Laravel introductionLaravel introduction
Laravel introductionSimon Funk
 
Integrating with salesforce
Integrating with salesforceIntegrating with salesforce
Integrating with salesforceMark Adcock
 
Salesforce Integration Pattern Overview
Salesforce Integration Pattern OverviewSalesforce Integration Pattern Overview
Salesforce Integration Pattern OverviewDhanik Sahni
 
The virtual DOM and how react uses it internally
The virtual DOM and how react uses it internallyThe virtual DOM and how react uses it internally
The virtual DOM and how react uses it internallyClóvis Neto
 
Salesforce - Implicit Sharing, Record Locks & Skews
Salesforce - Implicit Sharing, Record Locks & SkewsSalesforce - Implicit Sharing, Record Locks & Skews
Salesforce - Implicit Sharing, Record Locks & SkewsNora Nicklis
 
OAuth with Salesforce - Demystified
OAuth with Salesforce - DemystifiedOAuth with Salesforce - Demystified
OAuth with Salesforce - DemystifiedCalvin Noronha
 
Real Time Integration with Salesforce Platform Events
Real Time Integration with Salesforce Platform EventsReal Time Integration with Salesforce Platform Events
Real Time Integration with Salesforce Platform EventsSalesforce Developers
 
Integration using Salesforce Canvas
Integration using Salesforce CanvasIntegration using Salesforce Canvas
Integration using Salesforce CanvasDhanik Sahni
 

Was ist angesagt? (20)

Joomla REST API
Joomla REST APIJoomla REST API
Joomla REST API
 
Episode 19 - Asynchronous Apex - Batch apex & schedulers
Episode 19 - Asynchronous Apex - Batch apex & schedulersEpisode 19 - Asynchronous Apex - Batch apex & schedulers
Episode 19 - Asynchronous Apex - Batch apex & schedulers
 
An Introduction to Lightning Web Components
An Introduction to Lightning Web ComponentsAn Introduction to Lightning Web Components
An Introduction to Lightning Web Components
 
Salesforce apex hours PayPal with Salesforce Integration
Salesforce apex hours   PayPal with Salesforce IntegrationSalesforce apex hours   PayPal with Salesforce Integration
Salesforce apex hours PayPal with Salesforce Integration
 
Salesforce REST API
Salesforce  REST API Salesforce  REST API
Salesforce REST API
 
Salesforce Integration Patterns
Salesforce Integration PatternsSalesforce Integration Patterns
Salesforce Integration Patterns
 
Dive Deep into Apex: Advanced Apex!
Dive Deep into Apex: Advanced Apex! Dive Deep into Apex: Advanced Apex!
Dive Deep into Apex: Advanced Apex!
 
Dynamic input tables lwc vs aura vs. visualforce
Dynamic input tables  lwc vs aura vs. visualforceDynamic input tables  lwc vs aura vs. visualforce
Dynamic input tables lwc vs aura vs. visualforce
 
Dive Deep Into the Force.com Canvas Framework
Dive Deep Into the Force.com Canvas FrameworkDive Deep Into the Force.com Canvas Framework
Dive Deep Into the Force.com Canvas Framework
 
SLDS and Lightning Components
SLDS and Lightning ComponentsSLDS and Lightning Components
SLDS and Lightning Components
 
Laravel introduction
Laravel introductionLaravel introduction
Laravel introduction
 
Integrating with salesforce
Integrating with salesforceIntegrating with salesforce
Integrating with salesforce
 
Introduction to Apex Triggers
Introduction to Apex TriggersIntroduction to Apex Triggers
Introduction to Apex Triggers
 
Salesforce Integration Pattern Overview
Salesforce Integration Pattern OverviewSalesforce Integration Pattern Overview
Salesforce Integration Pattern Overview
 
The virtual DOM and how react uses it internally
The virtual DOM and how react uses it internallyThe virtual DOM and how react uses it internally
The virtual DOM and how react uses it internally
 
Salesforce - Implicit Sharing, Record Locks & Skews
Salesforce - Implicit Sharing, Record Locks & SkewsSalesforce - Implicit Sharing, Record Locks & Skews
Salesforce - Implicit Sharing, Record Locks & Skews
 
Introduction to Apex Triggers
Introduction to Apex TriggersIntroduction to Apex Triggers
Introduction to Apex Triggers
 
OAuth with Salesforce - Demystified
OAuth with Salesforce - DemystifiedOAuth with Salesforce - Demystified
OAuth with Salesforce - Demystified
 
Real Time Integration with Salesforce Platform Events
Real Time Integration with Salesforce Platform EventsReal Time Integration with Salesforce Platform Events
Real Time Integration with Salesforce Platform Events
 
Integration using Salesforce Canvas
Integration using Salesforce CanvasIntegration using Salesforce Canvas
Integration using Salesforce Canvas
 

Andere mochten auch

Apex Flex Queue: Batch Apex Liberated
Apex Flex Queue: Batch Apex LiberatedApex Flex Queue: Batch Apex Liberated
Apex Flex Queue: Batch Apex LiberatedCarolEnLaNube
 
Webinar: Integrating Salesforce and Slack (05 12-16)
Webinar: Integrating Salesforce and Slack (05 12-16)Webinar: Integrating Salesforce and Slack (05 12-16)
Webinar: Integrating Salesforce and Slack (05 12-16)Salesforce Developers
 
Advanced Platform Series - OAuth and Social Authentication
Advanced Platform Series - OAuth and Social AuthenticationAdvanced Platform Series - OAuth and Social Authentication
Advanced Platform Series - OAuth and Social AuthenticationSalesforce Developers
 
Secure Development on the Salesforce Platform - Part I
Secure Development on the Salesforce Platform - Part ISecure Development on the Salesforce Platform - Part I
Secure Development on the Salesforce Platform - Part ISalesforce Developers
 
Building a Single Page App with Lightning Components
Building a Single Page App with Lightning ComponentsBuilding a Single Page App with Lightning Components
Building a Single Page App with Lightning ComponentsSalesforce Developers
 
Asynchronous Apex Salesforce World Tour Paris 2015
Asynchronous Apex Salesforce World Tour Paris 2015Asynchronous Apex Salesforce World Tour Paris 2015
Asynchronous Apex Salesforce World Tour Paris 2015Samuel De Rycke
 
Coding Apps in the Cloud with Force.com - Part 2
Coding Apps in the Cloud with Force.com - Part 2Coding Apps in the Cloud with Force.com - Part 2
Coding Apps in the Cloud with Force.com - Part 2Salesforce Developers
 
Best Practices for Lightning Apps
Best Practices for Lightning AppsBest Practices for Lightning Apps
Best Practices for Lightning AppsMark Adcock
 
Integrating Salesforce with Microsoft Office through Add-ins
Integrating Salesforce with Microsoft Office through Add-insIntegrating Salesforce with Microsoft Office through Add-ins
Integrating Salesforce with Microsoft Office through Add-insSalesforce Developers
 
Secure Development on the Salesforce Platform - Part 3
Secure Development on the Salesforce Platform - Part 3Secure Development on the Salesforce Platform - Part 3
Secure Development on the Salesforce Platform - Part 3Mark Adcock
 
Secure Development on the Salesforce Platform - Part 2
Secure Development on the Salesforce Platform - Part 2Secure Development on the Salesforce Platform - Part 2
Secure Development on the Salesforce Platform - Part 2Salesforce Developers
 
Developing Office Add-Ins
Developing Office Add-InsDeveloping Office Add-Ins
Developing Office Add-InsPeter Plessers
 
Enterprise Integration - Solution Patterns From the Field
Enterprise Integration - Solution Patterns From the FieldEnterprise Integration - Solution Patterns From the Field
Enterprise Integration - Solution Patterns From the FieldSalesforce Developers
 
Salesforce Apex Ten Commandments
Salesforce Apex Ten CommandmentsSalesforce Apex Ten Commandments
Salesforce Apex Ten CommandmentsNetStronghold
 
Batchable vs @future vs Queueable
Batchable vs @future vs QueueableBatchable vs @future vs Queueable
Batchable vs @future vs QueueableBoris Bachovski
 
Analyze billions of records on Salesforce App Cloud with BigObject
Analyze billions of records on Salesforce App Cloud with BigObjectAnalyze billions of records on Salesforce App Cloud with BigObject
Analyze billions of records on Salesforce App Cloud with BigObjectSalesforce Developers
 

Andere mochten auch (20)

Salesforce asynchronous apex
Salesforce asynchronous apexSalesforce asynchronous apex
Salesforce asynchronous apex
 
Apex Flex Queue: Batch Apex Liberated
Apex Flex Queue: Batch Apex LiberatedApex Flex Queue: Batch Apex Liberated
Apex Flex Queue: Batch Apex Liberated
 
Webinar: Integrating Salesforce and Slack (05 12-16)
Webinar: Integrating Salesforce and Slack (05 12-16)Webinar: Integrating Salesforce and Slack (05 12-16)
Webinar: Integrating Salesforce and Slack (05 12-16)
 
Advanced Platform Series - OAuth and Social Authentication
Advanced Platform Series - OAuth and Social AuthenticationAdvanced Platform Series - OAuth and Social Authentication
Advanced Platform Series - OAuth and Social Authentication
 
Secure Development on the Salesforce Platform - Part I
Secure Development on the Salesforce Platform - Part ISecure Development on the Salesforce Platform - Part I
Secure Development on the Salesforce Platform - Part I
 
Building a Single Page App with Lightning Components
Building a Single Page App with Lightning ComponentsBuilding a Single Page App with Lightning Components
Building a Single Page App with Lightning Components
 
Asynchronous Apex Salesforce World Tour Paris 2015
Asynchronous Apex Salesforce World Tour Paris 2015Asynchronous Apex Salesforce World Tour Paris 2015
Asynchronous Apex Salesforce World Tour Paris 2015
 
Coding Apps in the Cloud with Force.com - Part 2
Coding Apps in the Cloud with Force.com - Part 2Coding Apps in the Cloud with Force.com - Part 2
Coding Apps in the Cloud with Force.com - Part 2
 
Diving Into Heroku Private Spaces
Diving Into Heroku Private SpacesDiving Into Heroku Private Spaces
Diving Into Heroku Private Spaces
 
Best Practices for Lightning Apps
Best Practices for Lightning AppsBest Practices for Lightning Apps
Best Practices for Lightning Apps
 
Integrating Salesforce with Microsoft Office through Add-ins
Integrating Salesforce with Microsoft Office through Add-insIntegrating Salesforce with Microsoft Office through Add-ins
Integrating Salesforce with Microsoft Office through Add-ins
 
Secure Development on the Salesforce Platform - Part 3
Secure Development on the Salesforce Platform - Part 3Secure Development on the Salesforce Platform - Part 3
Secure Development on the Salesforce Platform - Part 3
 
Secure Development on the Salesforce Platform - Part 2
Secure Development on the Salesforce Platform - Part 2Secure Development on the Salesforce Platform - Part 2
Secure Development on the Salesforce Platform - Part 2
 
Developing Office Add-Ins
Developing Office Add-InsDeveloping Office Add-Ins
Developing Office Add-Ins
 
Enterprise Integration - Solution Patterns From the Field
Enterprise Integration - Solution Patterns From the FieldEnterprise Integration - Solution Patterns From the Field
Enterprise Integration - Solution Patterns From the Field
 
Salesforce Apex Ten Commandments
Salesforce Apex Ten CommandmentsSalesforce Apex Ten Commandments
Salesforce Apex Ten Commandments
 
Office Add-in development
Office Add-in developmentOffice Add-in development
Office Add-in development
 
Apex Nirvana
Apex NirvanaApex Nirvana
Apex Nirvana
 
Batchable vs @future vs Queueable
Batchable vs @future vs QueueableBatchable vs @future vs Queueable
Batchable vs @future vs Queueable
 
Analyze billions of records on Salesforce App Cloud with BigObject
Analyze billions of records on Salesforce App Cloud with BigObjectAnalyze billions of records on Salesforce App Cloud with BigObject
Analyze billions of records on Salesforce App Cloud with BigObject
 

Ähnlich wie Advanced Apex Development - Asynchronous Processes

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
 
TrailheaDX 2019 : Truly Asynchronous Apex Triggers using Change Data Capture
TrailheaDX 2019 : Truly Asynchronous Apex Triggers using Change Data CaptureTrailheaDX 2019 : Truly Asynchronous Apex Triggers using Change Data Capture
TrailheaDX 2019 : Truly Asynchronous Apex Triggers using Change Data CaptureJohn Brock
 
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
 
Quickly Create Data Sets for the Analytics Cloud
Quickly Create Data Sets for the Analytics CloudQuickly Create Data Sets for the Analytics Cloud
Quickly Create Data Sets for the Analytics CloudSalesforce Developers
 
Cutting Edge Mobile Development in the App Cloud
Cutting Edge Mobile Development in the App CloudCutting Edge Mobile Development in the App Cloud
Cutting Edge Mobile Development in the App CloudSalesforce Developers
 
Data Design Tips for Developing Robust Apps on Force.com
Data Design Tips for Developing Robust Apps on Force.comData Design Tips for Developing Robust Apps on Force.com
Data Design Tips for Developing Robust Apps on Force.comSalesforce Developers
 
All Aboard the Lightning Components Action Service
All Aboard the Lightning Components Action ServiceAll Aboard the Lightning Components Action Service
All Aboard the Lightning Components Action ServicePeter Chittum
 
Apex Nuances: Transitioning to Force.com Development
Apex Nuances: Transitioning to Force.com DevelopmentApex Nuances: Transitioning to Force.com Development
Apex Nuances: Transitioning to Force.com DevelopmentSalesforce Developers
 
S1 and Visualforce Publisher Actions
S1 and Visualforce Publisher ActionsS1 and Visualforce Publisher Actions
S1 and Visualforce Publisher ActionsPeter Chittum
 
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
 
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
 
Visualforce Hack for Junction Objects
Visualforce Hack for Junction ObjectsVisualforce Hack for Junction Objects
Visualforce Hack for Junction ObjectsRitesh Aswaney
 
Force.com Friday: Intro to Force.com
Force.com Friday: Intro to Force.comForce.com Friday: Intro to Force.com
Force.com Friday: Intro to Force.comSalesforce Developers
 
Lightning components performance best practices
Lightning components performance best practicesLightning components performance best practices
Lightning components performance best practicesSalesforce Developers
 
Mastering Force.com: Advanced Visualforce
Mastering Force.com: Advanced VisualforceMastering Force.com: Advanced Visualforce
Mastering Force.com: Advanced VisualforceSalesforce Developers
 

Ähnlich wie Advanced Apex Development - Asynchronous Processes (20)

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
 
TrailheaDX 2019 : Truly Asynchronous Apex Triggers using Change Data Capture
TrailheaDX 2019 : Truly Asynchronous Apex Triggers using Change Data CaptureTrailheaDX 2019 : Truly Asynchronous Apex Triggers using Change Data Capture
TrailheaDX 2019 : Truly Asynchronous Apex Triggers using Change Data Capture
 
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
 
Force.com Friday : Intro to Apex
Force.com Friday : Intro to Apex Force.com Friday : Intro to Apex
Force.com Friday : Intro to Apex
 
Quickly Create Data Sets for the Analytics Cloud
Quickly Create Data Sets for the Analytics CloudQuickly Create Data Sets for the Analytics Cloud
Quickly Create Data Sets for the Analytics Cloud
 
Cutting Edge Mobile Development in the App Cloud
Cutting Edge Mobile Development in the App CloudCutting Edge Mobile Development in the App Cloud
Cutting Edge Mobile Development in the App Cloud
 
Lightning Components: The Future
Lightning Components: The FutureLightning Components: The Future
Lightning Components: The Future
 
Data Design Tips for Developing Robust Apps on Force.com
Data Design Tips for Developing Robust Apps on Force.comData Design Tips for Developing Robust Apps on Force.com
Data Design Tips for Developing Robust Apps on Force.com
 
All Aboard the Lightning Components Action Service
All Aboard the Lightning Components Action ServiceAll Aboard the Lightning Components Action Service
All Aboard the Lightning Components Action Service
 
Apex Nuances: Transitioning to Force.com Development
Apex Nuances: Transitioning to Force.com DevelopmentApex Nuances: Transitioning to Force.com Development
Apex Nuances: Transitioning to Force.com Development
 
S1 and Visualforce Publisher Actions
S1 and Visualforce Publisher ActionsS1 and Visualforce Publisher Actions
S1 and Visualforce Publisher Actions
 
Salesforce platform session 2
 Salesforce platform session 2 Salesforce platform session 2
Salesforce platform session 2
 
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
 
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
 
Visualforce Hack for Junction Objects
Visualforce Hack for Junction ObjectsVisualforce Hack for Junction Objects
Visualforce Hack for Junction Objects
 
Force.com Friday: Intro to Force.com
Force.com Friday: Intro to Force.comForce.com Friday: Intro to Force.com
Force.com Friday: Intro to Force.com
 
Lightning components performance best practices
Lightning components performance best practicesLightning components performance best practices
Lightning components performance best practices
 
Mastering Force.com: Advanced Visualforce
Mastering Force.com: Advanced VisualforceMastering Force.com: Advanced Visualforce
Mastering Force.com: Advanced Visualforce
 
Intro to Apex Programmers
Intro to Apex ProgrammersIntro to Apex Programmers
Intro to Apex Programmers
 
Using the Google SOAP API
Using the Google SOAP APIUsing the Google SOAP API
Using the Google SOAP API
 

Mehr von 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 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionSalesforce 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
 
Modern App Dev: Modular Development Strategies
Modern App Dev: Modular Development StrategiesModern App Dev: Modular Development Strategies
Modern App Dev: Modular Development StrategiesSalesforce Developers
 

Mehr von 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 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An Introduction
 
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
 
Introduction to MuleSoft
Introduction to MuleSoftIntroduction to MuleSoft
Introduction to MuleSoft
 
Modern App Dev: Modular Development Strategies
Modern App Dev: Modular Development StrategiesModern App Dev: Modular Development Strategies
Modern App Dev: Modular Development Strategies
 

Kürzlich hochgeladen

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 

Kürzlich hochgeladen (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 

Advanced Apex Development - Asynchronous Processes

  • 1. Advanced Apex – Asynchronous Processes March 29th 2016
  • 2. #forcewebina r 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. Forward-Looking Statement
  • 3. #forcewebina r Speakers MJ Kahn Vice President, OpFocus, Inc. Kartik Viswanadha Director, OpFocus Salesforce MVP @logontokartik
  • 4. #forcewebina r Go Social! @salesforcedevs / #forcewebinar Salesforce Developers Salesforce Developers Salesforce Developers This webinar is being recorded! The video will be posted to YouTube and the webinar recap page (same URL as registration).
  • 5. #forcewebina r Agenda • What is Asynchronous Process? • Why we need it? • Types of Asynchronous Processes in Salesforce • Usage and Examples • Comparison of various Asynchronous Processes • Appendix • Recap
  • 6. #forcewebina r Pre-requisites • Good understanding of Apex Programming on Salesforce • Passion to learn the platform
  • 8. #forcewebina r Asynchronous Process - Definition • In computer programs, asynchronous operation means that a process operates independently of other processes
  • 9. #forcewebina r Asynchronous vs Synchronous Synchronous • Quick and Immediate Actions • Transactions are immediate and serial • Normal governor limits Asynchronous • Actions that will not block the transaction pr process • Duration is not a Priority • Higher governor limits
  • 10. #forcewebina r Asynchronous Process – Force.com • Ensure fairness of processing • Ensure transactional capabilities
  • 13. #forcewebina r Multi tenant Fair Share Handling - Delay
  • 14. #forcewebina r Multi tenant Fair Share Handling - Delay
  • 15. #forcewebina r Multi tenant Fair Share Handling – Extended Delay All the rquests from Org 1 are moved back with an Extended Delay
  • 17. #forcewebina r Benefits • User Efficiency • Resource Efficiency • Scalability
  • 18. #forcewebina r Why Asynchronous Processes in Salesforce • Avoid Governor Limits • Mixed DML Operations • Long Running User Operations
  • 19. #forcewebina r Use Cases • Send Data to an External System on a Insert or Update • Complex Calculations or Analysis based on Data in Salesforce • Report Runs • Callouts to External Systems
  • 20. #forcewebina r Use Case – Large Data Processing
  • 21. #forcewebina r Use Case – Logic on Millions of Rows • Supports complex logic on very large datasets • Scalable, robust, asynchronous execution platform • Scheduled or programmatically executed • Eliminate ‘data processing’ integrations • Data cleansing, augmentation • Automated batch process
  • 23. #forcewebina r Types of Asynchronous Processes in Apex • @future • Queueable • Batch Apex • Schedulable • Continuation
  • 24. #forcewebina r Scenario • Goal: Populate Account’s Billing Longitude/Latitude based on Billing Address • Assume we have a method that calls out to a web service and returns the lon/lat for a given Account, in the Geocoding Utils class public static LonLat geocodeAccount(Account acct) { … } LonLat is a class with 2 Double properties. • Solution: Write a trigger that calls this method. • Problem: You can’t call out to a web service from a trigger.
  • 25. #forcewebina r @future • A public static method, decorated with @future • Arguments: • Primitives (Integer, String, etc.) • Collections of primitives (List, Map, Set) • NOT Sobjects or Apex objects • You can use JSON.serialize() and pass in a String • Returns void
  • 26. @future public class GeocodingUtils { @future (callout=true) public static void geocodeAccountFuture(Id accountId) { Account acct = [select Id, BillingStreet, BillingCity, BillingState, BillingPostalCode, BillingCountry from Account where Id = :accountId]; LonLat coordinates = geocodeAccount(acct); if (coordinates != null) { acct.BillingLongitude = coordinates.lon; acct.BillingLatitude = coordinates.lat; update acct; } } }
  • 27. @future – Account trigger trigger Account on Account (before insert, before update) { if (Trigger.isBefore && (Trigger.isInsert || Trigger.isUpdate)) { // For each new Account or each existing Account whose Address has changed, geocode it for (Account acct : Trigger.new) { if (Trigger.isInsert || (Trigger.isUpdate && GeocodingUtils.addressChanged(acct, Trigger.oldMap.get(acct.Id)))) { // Geocode the Account's address GeocodingUtils.geocodeAccountFuture(acct.Id); } } } }
  • 28. #forcewebina r Queueable Class • A public class that implements the Queueable interface • Includes an execute method that accepts only a QueueableContext parameter • The execute method can access instance properties for the class • Returns void • Launch by calling System.enqueueJob(cls) with an instance of the class. • Returns an AsyncApexJob Id
  • 29. Queueable Apex public class GeocodingQueueable implements Queueable, Database.AllowsCallouts { public Account[] lstAccounts = new Account[]{}; public void execute(QueueableContext ctx) { // Process as many Accounts as we can Account[] lstProcessed = new Account[]{}; Integer numProcessed; for (numProcessed=0; numProcessed < Limits.getLimitCallouts() && numProcessed<lstAccounts.size(); numProcessed++) { Account acctGeo = lstAccounts[numProcessed]; GeocodingUtils.LonLat coordinates = GeocodingUtils.geocodeAccount(acctGeo); if (coordinates != null) { acctGeo.BillingLongitude = coordinates.lon; acctGeo.BillingLatitude = coordinates.lat; lstProcessed.add(acctGeo); } }
  • 30. Queueable Apex … update lstProcessed; // Remove the ones we just processed from the list. for (Integer i=0; i<numProcessed; i++) { lstAccounts.remove(0); } // If there are any remaining Accounts, chain a new Async job to process them. // NOTE: As of Spring 16, a chained Queueable job cannot do a callout, so the next // run of this execute() method will fail! if (!lstAccounts.isEmpty()) { Id jobID = System.enqueueJob(this); } } }
  • 31. Queueable Apex– Account trigger trigger Account on Account (before insert, before update) { if (Trigger.isBefore && (Trigger.isInsert || Trigger.isUpdate)) { Account[] lstAccounts = new Account[]{}; for (Account acct : Trigger.new) { if (Trigger.isInsert || (Trigger.isUpdate && GeocodingUtils.addressChanged(acct, Trigger.oldMap.get(acct.Id)))) { Account acctGeo = new Account(Id=acct.Id); acctGeo.BillingStreet = acct.BillingStreet; acctGeo.BillingCity = acct.BillingCity; acctGeo.BillingState = acct.BillingState; acctGeo.BillingPostalCode = acct.BillingPostalCode; acctGeo.BillingCountry = acct.BillingCountry; lstAccounts.add(acctGeo); } } if (!lstAccounts.isEmpty()) { // Geocode the Account's address GeocodingQueueable cls = new GeocodingQueueable(); cls.lstAccounts = lstAccounts; Id jobID = System.enqueueJob(cls); } } }
  • 32. #forcewebina r Batchable Class • A global class that implements the Database.Batchable interface • Includes: • Start method – identifies the scope (list of data to be processed) • Execute method – processes a subset of the scoped records • Finish method – does any post-job wrap-up • Additional interfaces: • Database.Stateful • Database.AllowCallouts
  • 33. #forcewebina r Batchable Class • Launch by callling Database.executeBatch(cls) with an instance of the class and an optional scope size • Default scope size is 200 • Returns an AsyncApexJobId
  • 34. Batch Apex global class GeocodingBatch implements Database.Batchable<SObject>, Database.AllowsCallouts, Database.Stateful { global Integer numberOfAccountsUpdated = 0; // Start method gets all Accounts that need to be geocoded global Database.QueryLocator start(Database.BatchableContext bc) { String query = 'select id from Account where Need_to_Geocode__c = true'; return Database.getQueryLocator(query); }
  • 35. Batch Apex global void execute(Database.BatchableContext bc, List<SObject> lstSObjects) { // Get the Accounts Account[] lstAccounts = [select Id, BillingStreet, BillingCity, BillingState, BillingPostalCode, BillingCountry from Account where Id in :lstSObjects]; for (Account acct : lstAccounts) { // Geocode the Account and save the results GeocodingUtils.LonLat coordinates = GeocodingUtils.geocodeAccount(acct); if (coordinates != null) { acct.BillingLongitude = coordinates.lon; acct.BillingLatitude = coordinates.lat; } acct.Need_to_Geocode__c = false; } update lstAccounts; numberOfAccountsUpdated += lstAccounts.size(); }
  • 36. Batch Apex global void finish(Database.BatchableContext bc) { // Send an email to let someone know how many Accounts we updated System.debug('Number of Accounts updated: ' + numberOfAccountsUpdated); } } // End of class
  • 37. Batchble Apex– Account trigger trigger Account on Account (before insert, before update) { if (Trigger.isBefore && (Trigger.isInsert || Trigger.isUpdate)) { // For each new Account or each existing Account whose Address has changed, // flag it to be geocoded later for (Account acct : Trigger.new) { if (Trigger.isInsert || (Trigger.isUpdate && GeocodingUtils.addressChanged(acct, Trigger.oldMap.get(acct.Id)))) { acct.Need_to_Geocode__c = true; } } } }
  • 38. #forcewebina r Schedulable Class • A global class that implements the Schedulable interface • Includes an execute method
  • 39. Schedulable Apex global class GeocodingSchedulable { global void execute(SchedulableContext ctx) { GeocodingBatch cls = new GeocodingBatch(); Integer batchSize = (Limits.getLimitCallouts() < 200) ? Limits.getLimitCallouts() : 200; Id jobId = Database.executeBatch(cls, batchSize); } }
  • 40. #forcewebina r Schedulable Class • Schedule by calling System.Schedule(‘job name’, cron expression, cls) • Job Name is found in AsyncApexJob object • Cron expression can be complex • Returns an AsyncApexJob Id
  • 41. #forcewebina r Schedulable Class • Cron expression string seconds minutes hours day_of_month month day_of_week optional_year • Run at 30 minutes past midnight on Jan 1 every year GeocodingSchedulable cls = new GeocodingSchedulable(); System.Schedule('Geocode on Jan 1', '0 30 0 1 1 ? *', cls); • Run every hour GeocodingSchedulable cls = new GeocodingSchedulable(); System.Schedule('Geocode on Jan 1', '0 0 * * * ? *', cls); • Check the Apex Language Reference for details
  • 42. #forcewebina r Summary of Techniques • @future – static method, simple arguments, no monitoring, no chaining • Queueable – class with instance variables, can monitor, can chain (within limits) • Batch Apex – class with instance variables, great for large numbers of records, can monitor • Schedulable – class with instance variables, runs one or at
  • 43. #forcewebina r Monitoring Async Apex • For Queueable and Batchable • When you launch the job, you get an AsyncApexJob Id • Setup | Monitoring | Apex Jobs • See doc for description of Status values • For Schedulable • When you schedule the job, you get a CronTrigger Id • When it runs, it’s added to AsyncApexJobs • Setup | Monitoring | Scheduled Jobs • Add a list view filter for Type = Scheduled Apex
  • 44. #forcewebina r Testing Async Apex • Before launching the job, do Test.startTest() • After launching the job, do Test.stopTest() • One instance of the job will run before Test.stopTest() returns
  • 45. #forcewebina r Recap • Asynchronous Processes • Salesforce Async Model & Framework • Advantages of using Async processes • Use Cases • Types of Async Processes • Comparison & Monitoring
  • 52. Q&A Your feedback is crucial to the success of our webinar programs. Thank you!
  • 53. Thank You Try Trailhead: trailhead.salesforce.com Join the conversation: @salesforcedevs