SlideShare a Scribd company logo
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

More Related Content

What's hot

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
Salesforce Developers
 
Batchable vs @future vs Queueable
Batchable vs @future vs QueueableBatchable vs @future vs Queueable
Batchable vs @future vs Queueable
Boris Bachovski
 
How to Use Salesforce Platform Events to Help With Salesforce Limits
How to Use Salesforce Platform Events to Help With Salesforce LimitsHow to Use Salesforce Platform Events to Help With Salesforce Limits
How to Use Salesforce Platform Events to Help With Salesforce Limits
Roy Gilad
 
Triggers and order of execution1
Triggers and order of execution1Triggers and order of execution1
Triggers and order of execution1
Prabhakar Sharma
 
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
Jitendra Zaa
 
Exploring the Salesforce REST API
Exploring the Salesforce REST APIExploring the Salesforce REST API
Exploring the Salesforce REST API
Salesforce Developers
 
Salesforce integration best practices columbus meetup
Salesforce integration best practices   columbus meetupSalesforce integration best practices   columbus meetup
Salesforce integration best practices columbus meetup
MuleSoft Meetup
 
Relationships in Salesforce
Relationships in SalesforceRelationships in Salesforce
Relationships in Salesforce
MST Solutions LLC
 
Integrating with salesforce
Integrating with salesforceIntegrating with salesforce
Integrating with salesforce
Mark Adcock
 
Apex Design Patterns
Apex Design PatternsApex Design Patterns
Apex Design Patterns
Salesforce Developers
 
Integrating with salesforce using platform events
Integrating with salesforce using platform eventsIntegrating with salesforce using platform events
Integrating with salesforce using platform events
Amit Chaudhary
 
Decluttering your Salesfroce org
Decluttering your Salesfroce orgDecluttering your Salesfroce org
Decluttering your Salesfroce org
Roy Gilad
 
Publish Your First App on the AppExchange
Publish Your First App on the AppExchangePublish Your First App on the AppExchange
Publish Your First App on the AppExchange
Salesforce Partners
 
Secure Coding: Field-level Security, CRUD, and Sharing
Secure Coding: Field-level Security, CRUD, and SharingSecure Coding: Field-level Security, CRUD, and Sharing
Secure Coding: Field-level Security, CRUD, and Sharing
Salesforce Developers
 
Simple Salesforce Data Migration
Simple Salesforce Data MigrationSimple Salesforce Data Migration
Simple Salesforce Data Migration
Scribe Software Corp.
 
Flow in Salesforce
Flow in SalesforceFlow in Salesforce
Flow in Salesforce
vikas singh
 
Asynchronous apex
Asynchronous apexAsynchronous apex
Design Patterns for Asynchronous Apex
Design Patterns for Asynchronous ApexDesign Patterns for Asynchronous Apex
Design Patterns for Asynchronous Apex
Salesforce Developers
 
Webinar: Take Control of Your Org with Salesforce Optimizer
Webinar: Take Control of Your Org with Salesforce OptimizerWebinar: Take Control of Your Org with Salesforce Optimizer
Webinar: Take Control of Your Org with Salesforce Optimizer
Salesforce Admins
 

What's hot (20)

Governor limits
Governor limitsGovernor limits
Governor limits
 
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
 
Batchable vs @future vs Queueable
Batchable vs @future vs QueueableBatchable vs @future vs Queueable
Batchable vs @future vs Queueable
 
How to Use Salesforce Platform Events to Help With Salesforce Limits
How to Use Salesforce Platform Events to Help With Salesforce LimitsHow to Use Salesforce Platform Events to Help With Salesforce Limits
How to Use Salesforce Platform Events to Help With Salesforce Limits
 
Triggers and order of execution1
Triggers and order of execution1Triggers and order of execution1
Triggers and order of execution1
 
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
 
Exploring the Salesforce REST API
Exploring the Salesforce REST APIExploring the Salesforce REST API
Exploring the Salesforce REST API
 
Salesforce integration best practices columbus meetup
Salesforce integration best practices   columbus meetupSalesforce integration best practices   columbus meetup
Salesforce integration best practices columbus meetup
 
Relationships in Salesforce
Relationships in SalesforceRelationships in Salesforce
Relationships in Salesforce
 
Integrating with salesforce
Integrating with salesforceIntegrating with salesforce
Integrating with salesforce
 
Apex Design Patterns
Apex Design PatternsApex Design Patterns
Apex Design Patterns
 
Integrating with salesforce using platform events
Integrating with salesforce using platform eventsIntegrating with salesforce using platform events
Integrating with salesforce using platform events
 
Decluttering your Salesfroce org
Decluttering your Salesfroce orgDecluttering your Salesfroce org
Decluttering your Salesfroce org
 
Publish Your First App on the AppExchange
Publish Your First App on the AppExchangePublish Your First App on the AppExchange
Publish Your First App on the AppExchange
 
Secure Coding: Field-level Security, CRUD, and Sharing
Secure Coding: Field-level Security, CRUD, and SharingSecure Coding: Field-level Security, CRUD, and Sharing
Secure Coding: Field-level Security, CRUD, and Sharing
 
Simple Salesforce Data Migration
Simple Salesforce Data MigrationSimple Salesforce Data Migration
Simple Salesforce Data Migration
 
Flow in Salesforce
Flow in SalesforceFlow in Salesforce
Flow in Salesforce
 
Asynchronous apex
Asynchronous apexAsynchronous apex
Asynchronous apex
 
Design Patterns for Asynchronous Apex
Design Patterns for Asynchronous ApexDesign Patterns for Asynchronous Apex
Design Patterns for Asynchronous Apex
 
Webinar: Take Control of Your Org with Salesforce Optimizer
Webinar: Take Control of Your Org with Salesforce OptimizerWebinar: Take Control of Your Org with Salesforce Optimizer
Webinar: Take Control of Your Org with Salesforce Optimizer
 

Viewers also liked

Using Apex for REST Integration
Using Apex for REST IntegrationUsing Apex for REST Integration
Using Apex for REST Integration
Salesforce Developers
 
Apex Flex Queue: Batch Apex Liberated
Apex Flex Queue: Batch Apex LiberatedApex Flex Queue: Batch Apex Liberated
Apex Flex Queue: Batch Apex Liberated
CarolEnLaNube
 
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
 
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 Authentication
Salesforce 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 I
Salesforce 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 Components
Salesforce 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 2015
Samuel 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 2
Salesforce Developers
 
Diving Into Heroku Private Spaces
Diving Into Heroku Private SpacesDiving Into Heroku Private Spaces
Diving Into Heroku Private Spaces
Salesforce Developers
 
Best Practices for Lightning Apps
Best Practices for Lightning AppsBest Practices for Lightning Apps
Best Practices for Lightning Apps
Mark 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-ins
Salesforce 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 3
Mark 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 2
Salesforce Developers
 
Developing Office Add-Ins
Developing Office Add-InsDeveloping Office Add-Ins
Developing Office Add-Ins
Peter 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 Field
Salesforce Developers
 
Salesforce Apex Ten Commandments
Salesforce Apex Ten CommandmentsSalesforce Apex Ten Commandments
Salesforce Apex Ten Commandments
NetStronghold
 
Office Add-in development
Office Add-in developmentOffice Add-in development
Office Add-in development
Vjekoslav Ratkajec
 
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
Salesforce Developers
 

Viewers also liked (20)

Using Apex for REST Integration
Using Apex for REST IntegrationUsing Apex for REST Integration
Using Apex for REST Integration
 
Apex Flex Queue: Batch Apex Liberated
Apex Flex Queue: Batch Apex LiberatedApex Flex Queue: Batch Apex Liberated
Apex Flex Queue: Batch Apex Liberated
 
Dive Deep into Apex: Advanced Apex!
Dive Deep into Apex: Advanced Apex! Dive Deep into Apex: Advanced Apex!
Dive Deep into Apex: Advanced Apex!
 
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
 
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
 

Similar to 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 Capture
John 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 data
Salesforce Developers
 
Force.com Friday : Intro to Apex
Force.com Friday : Intro to Apex Force.com Friday : Intro to Apex
Force.com Friday : Intro to Apex
Salesforce 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 Cloud
Salesforce 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 Cloud
Salesforce Developers
 
Lightning Components: The Future
Lightning Components: The FutureLightning Components: The Future
Lightning Components: The Future
Salesforce 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.com
Salesforce Developers
 
Introduction to Apex Triggers
Introduction to Apex TriggersIntroduction to Apex Triggers
Introduction to Apex Triggers
Salesforce 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 Service
Peter 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 Development
Salesforce Developers
 
S1 and Visualforce Publisher Actions
S1 and Visualforce Publisher ActionsS1 and Visualforce Publisher Actions
S1 and Visualforce Publisher Actions
Peter Chittum
 
Salesforce platform session 2
 Salesforce platform session 2 Salesforce platform session 2
Salesforce platform session 2
Salesforce - Sweden, Denmark, Norway
 
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
JackGuo20
 
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
Salesforce Developers
 
Visualforce Hack for Junction Objects
Visualforce Hack for Junction ObjectsVisualforce Hack for Junction Objects
Visualforce Hack for Junction Objects
Ritesh 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.com
Salesforce Developers
 
Lightning components performance best practices
Lightning components performance best practicesLightning components performance best practices
Lightning components performance best practices
Salesforce Developers
 
Mastering Force.com: Advanced Visualforce
Mastering Force.com: Advanced VisualforceMastering Force.com: Advanced Visualforce
Mastering Force.com: Advanced Visualforce
Salesforce Developers
 
Intro to Apex Programmers
Intro to Apex ProgrammersIntro to Apex Programmers
Intro to Apex Programmers
Salesforce Developers
 

Similar to 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
 
Introduction to Apex Triggers
Introduction to Apex TriggersIntroduction to Apex Triggers
Introduction to Apex Triggers
 
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
 

More from 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
Salesforce 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 Components
Salesforce Developers
 
TrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsTrailheaDX India : Developer Highlights
TrailheaDX India : Developer Highlights
Salesforce 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 India
Salesforce 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 Development
Salesforce 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 Components
Salesforce 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 Components
Salesforce Developers
 
TrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsTrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer Highlights
Salesforce Developers
 
Live coding with LWC
Live coding with LWCLive coding with LWC
Live coding with LWC
Salesforce 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 Testing
Salesforce 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 Interoperability
Salesforce 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 Introduction
Salesforce 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 Salesforce
Salesforce 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 Capture
Salesforce Developers
 
Modern Development with Salesforce DX
Modern Development with Salesforce DXModern Development with Salesforce DX
Modern Development with Salesforce DX
Salesforce Developers
 
Get Into Lightning Flow Development
Get Into Lightning Flow DevelopmentGet Into Lightning Flow Development
Get Into Lightning Flow Development
Salesforce 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 Connect
Salesforce Developers
 
Introduction to MuleSoft
Introduction to MuleSoftIntroduction to MuleSoft
Introduction to MuleSoft
Salesforce Developers
 
Modern App Dev: Modular Development Strategies
Modern App Dev: Modular Development StrategiesModern App Dev: Modular Development Strategies
Modern App Dev: Modular Development Strategies
Salesforce Developers
 
Dreamforce Developer Recap
Dreamforce Developer RecapDreamforce Developer Recap
Dreamforce Developer Recap
Salesforce Developers
 

More from Salesforce Developers (20)

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
 
Dreamforce Developer Recap
Dreamforce Developer RecapDreamforce Developer Recap
Dreamforce Developer Recap
 

Recently uploaded

Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 

Recently uploaded (20)

Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 

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