SlideShare a Scribd company logo
1 of 21
Download to read offline
Advanced Flow Techniques with
Apex and Visualforce
​ Damien Phillippi
​ Software Developer
​ dphillippi@soliantconsulting.com
​ damienphillippi@gmail.com
​ 
•  What are Visual Workflows and when should I use it?
•  How to combine with code.
•  Code Samples
Overview
What is Visual
Workflow?
Software Developer, Soliant Consulting
Visual Flows
Triggered by User operation
Visual and interactive
Can effect or be effected by multiple objects
Drag and drop interface
Headless Flows can trigger events as well
Restricted by governor limits
Workflows
Triggered by events
Behind the scenes
Executes on specific objects
Create Static processes
What Makes Visual Workflows different?
In short, you generally want to use Visual WorkFlows when you have a
requirement similar to traditional workflows but it requires some sort of User
interaction.
For those not yet familiar with Visual Workflow:
https://developer.salesforce.com/trailhead/
business_process_automation/flow
•  Create a survey that can change frequently over time
•  Create a streamlined Case creation process for your org
•  Quickly create a set of related children for a record
•  Create a set of questions to follow along for a call center to give
standardized scripts for the User
•  Replace some Apex Utility Triggers with Headless Flows
•  https://developer.salesforce.com/trailhead/
business_process_automation/process_whichtool
Visual Workflow Use Cases
Breakdown Point
Flows tend to break down when you need to get more dynamic past the
User interaction piece.
In my presentation, I will be showing you 2 such examples.
1)  You want to run a SOSL or dynamic query rather than a static query on
an object.
2)  You might want to dynamically route your User or do different
operations depending on earlier actions in your flow.
Code with Visual Workflows
Enhance your Flow with code
Adding code helps strengthen Flows
•  Dynamic query filters
•  SOSL queries
•  Dynamic routing
Our First goal
Create a way to search the database for matches in both Leads and
Contacts.
Create a global class with the @InvocableMethod in it
Put a Simple Flow in a Visualforce Page that uses the
Invocable class
that was just created.
DF_Presentation.flow
DFPresentation.page
Query Demo
Add Error Handling
What happens when more than a single record is returned?
DF_Presentation.flow updated
Error Handling Demo
Dynamic Record Routing
Do we want to do something different if a Lead is found vs a Contact? Maybe we
decide that any Leads coming through this route should immediately be
converted and Contacts should be taken to their view page.
This looks like it should work…
Unfortunately, this doesn’t work. The reason is that it fetches
redirectUser as a property/variable. The method would need to be
called getRedirectUser, but when it actually gets called it wouldn’t
know about the flow variables yet by that point.
Adjustments to the controller
Updated VF page to work around the System
Routing Demo
Why not just use code?
•  Any changes to functionality require adjustments to unit tests and
deployments through Sandboxes
•  Configurable by an Admin
Closing
In this 25 min, we showed you an example of some of the things you can
do when you combine code/Visual Workflow.
•  Invoke code from Visual Workflows
•  Error handling.
•  Dynamic record routing
•  Alternate code with Flows:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/
apexcode/apex_process_plugin_using.htm
•  Code can be found at: http://tinyurl.com/q92s6y9
•  Questions?
Over the past ten years, our team
has helped shape our clients’
futures as well as served to simply
make their business lives easier.
Our role extends well beyond
being experts in creating custom
software – we consider ourselves
your trusted business partner.
IMPLEMENTATION
As process consultants, we assist adoption by
focusing on how your team works day-to-day.
APEX & VISUALFORCE
Our versatile, experienced team has a deep
understanding of Salesforce’s native languages.
APPEXCHANGE DEVELOPMENT
We develop AppExchange solutions and navigate
the Salesforce security review process.
SYSTEMS INTEGRATION
Salesforce can seamlessly integrate with your
existing business applications and IT
infrastructure.

More Related Content

What's hot

Salesforce.com API Series: Service Cloud Console Deep Dive
Salesforce.com API Series: Service Cloud Console Deep DiveSalesforce.com API Series: Service Cloud Console Deep Dive
Salesforce.com API Series: Service Cloud Console Deep DiveSalesforce Developers
 
Practical Headless Flow Examples
Practical Headless Flow ExamplesPractical Headless Flow Examples
Practical Headless Flow ExamplesSalesforce Admins
 
A Pocket Guide to Process Builder, Flows, and Triggers
A Pocket Guide to Process Builder, Flows, and TriggersA Pocket Guide to Process Builder, Flows, and Triggers
A Pocket Guide to Process Builder, Flows, and TriggersSalesforce Developers
 
Salesforce API: Salesforce Console Deep Dive
Salesforce API: Salesforce Console Deep DiveSalesforce API: Salesforce Console Deep Dive
Salesforce API: Salesforce Console Deep DiveSalesforce Developers
 
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
 
Code live with Brian Kwong - Visualforce to Lwc
Code live with Brian Kwong - Visualforce to LwcCode live with Brian Kwong - Visualforce to Lwc
Code live with Brian Kwong - Visualforce to LwcJackGuo20
 
ISV Lightning Webinar Series - Part 1 (December 1, 2015)
ISV Lightning Webinar Series - Part 1 (December 1, 2015)ISV Lightning Webinar Series - Part 1 (December 1, 2015)
ISV Lightning Webinar Series - Part 1 (December 1, 2015)Salesforce Partners
 
Planning Your Migration to the Lightning Experience
Planning Your Migration to the Lightning ExperiencePlanning Your Migration to the Lightning Experience
Planning Your Migration to the Lightning ExperienceShell Black
 
AppExchange Tech Enablement June 2017
AppExchange Tech Enablement June 2017AppExchange Tech Enablement June 2017
AppExchange Tech Enablement June 2017Salesforce Partners
 
Lightning Design System and Components for Visualforce Developers
Lightning Design System and Components for Visualforce DevelopersLightning Design System and Components for Visualforce Developers
Lightning Design System and Components for Visualforce DevelopersSalesforce Developers
 
ISV Monthly Tech Enablement (May 18, 2017)
ISV Monthly Tech Enablement (May 18, 2017)ISV Monthly Tech Enablement (May 18, 2017)
ISV Monthly Tech Enablement (May 18, 2017)Salesforce Partners
 
Migrating Visualforce Pages to Lightning
Migrating Visualforce Pages to LightningMigrating Visualforce Pages to Lightning
Migrating Visualforce Pages to LightningSalesforce Developers
 
Webinar Coding for Salesforce Admins
Webinar Coding for Salesforce AdminsWebinar Coding for Salesforce Admins
Webinar Coding for Salesforce AdminsSalesforce Admins
 
Build Smarter Apps with Einstein Object Detection
Build Smarter Apps with Einstein Object DetectionBuild Smarter Apps with Einstein Object Detection
Build Smarter Apps with Einstein Object DetectionSalesforce Developers
 
Salesforce University - Guide to Certification Paths
Salesforce University - Guide to Certification PathsSalesforce University - Guide to Certification Paths
Salesforce University - Guide to Certification PathsSalesforce Partners
 
Salesforce Lightning component framework from 0 to app
Salesforce Lightning component framework from 0 to appSalesforce Lightning component framework from 0 to app
Salesforce Lightning component framework from 0 to appRoy Gilad
 
Getting Ready for Ligtning Process Builder
Getting Ready for Ligtning Process BuilderGetting Ready for Ligtning Process Builder
Getting Ready for Ligtning Process BuilderFred Cadena
 
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
 
Snap-in Service to Web and Mobile Apps
Snap-in Service to Web and Mobile AppsSnap-in Service to Web and Mobile Apps
Snap-in Service to Web and Mobile AppsSalesforce Developers
 

What's hot (20)

Salesforce.com API Series: Service Cloud Console Deep Dive
Salesforce.com API Series: Service Cloud Console Deep DiveSalesforce.com API Series: Service Cloud Console Deep Dive
Salesforce.com API Series: Service Cloud Console Deep Dive
 
Practical Headless Flow Examples
Practical Headless Flow ExamplesPractical Headless Flow Examples
Practical Headless Flow Examples
 
A Pocket Guide to Process Builder, Flows, and Triggers
A Pocket Guide to Process Builder, Flows, and TriggersA Pocket Guide to Process Builder, Flows, and Triggers
A Pocket Guide to Process Builder, Flows, and Triggers
 
Salesforce API: Salesforce Console Deep Dive
Salesforce API: Salesforce Console Deep DiveSalesforce API: Salesforce Console Deep Dive
Salesforce API: Salesforce Console Deep Dive
 
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
 
Code live with Brian Kwong - Visualforce to Lwc
Code live with Brian Kwong - Visualforce to LwcCode live with Brian Kwong - Visualforce to Lwc
Code live with Brian Kwong - Visualforce to Lwc
 
ISV Lightning Webinar Series - Part 1 (December 1, 2015)
ISV Lightning Webinar Series - Part 1 (December 1, 2015)ISV Lightning Webinar Series - Part 1 (December 1, 2015)
ISV Lightning Webinar Series - Part 1 (December 1, 2015)
 
Planning Your Migration to the Lightning Experience
Planning Your Migration to the Lightning ExperiencePlanning Your Migration to the Lightning Experience
Planning Your Migration to the Lightning Experience
 
AppExchange Tech Enablement June 2017
AppExchange Tech Enablement June 2017AppExchange Tech Enablement June 2017
AppExchange Tech Enablement June 2017
 
Lightning Design System and Components for Visualforce Developers
Lightning Design System and Components for Visualforce DevelopersLightning Design System and Components for Visualforce Developers
Lightning Design System and Components for Visualforce Developers
 
ISV Monthly Tech Enablement (May 18, 2017)
ISV Monthly Tech Enablement (May 18, 2017)ISV Monthly Tech Enablement (May 18, 2017)
ISV Monthly Tech Enablement (May 18, 2017)
 
Migrating Visualforce Pages to Lightning
Migrating Visualforce Pages to LightningMigrating Visualforce Pages to Lightning
Migrating Visualforce Pages to Lightning
 
Write bulletproof trigger code
Write bulletproof trigger codeWrite bulletproof trigger code
Write bulletproof trigger code
 
Webinar Coding for Salesforce Admins
Webinar Coding for Salesforce AdminsWebinar Coding for Salesforce Admins
Webinar Coding for Salesforce Admins
 
Build Smarter Apps with Einstein Object Detection
Build Smarter Apps with Einstein Object DetectionBuild Smarter Apps with Einstein Object Detection
Build Smarter Apps with Einstein Object Detection
 
Salesforce University - Guide to Certification Paths
Salesforce University - Guide to Certification PathsSalesforce University - Guide to Certification Paths
Salesforce University - Guide to Certification Paths
 
Salesforce Lightning component framework from 0 to app
Salesforce Lightning component framework from 0 to appSalesforce Lightning component framework from 0 to app
Salesforce Lightning component framework from 0 to app
 
Getting Ready for Ligtning Process Builder
Getting Ready for Ligtning Process BuilderGetting Ready for Ligtning Process Builder
Getting Ready for Ligtning Process Builder
 
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
 
Snap-in Service to Web and Mobile Apps
Snap-in Service to Web and Mobile AppsSnap-in Service to Web and Mobile Apps
Snap-in Service to Web and Mobile Apps
 

Similar to Advanced Flow Techniques with Apex and Visualforce

Hands-on Workshop: Intermediate Development with Heroku and Force.com
Hands-on Workshop: Intermediate Development with Heroku and Force.comHands-on Workshop: Intermediate Development with Heroku and Force.com
Hands-on Workshop: Intermediate Development with Heroku and Force.comSalesforce Developers
 
TrailblazerDX Motihari.pptx
TrailblazerDX Motihari.pptxTrailblazerDX Motihari.pptx
TrailblazerDX Motihari.pptxOm Prakash
 
Elevate Tel Aviv
Elevate Tel AvivElevate Tel Aviv
Elevate Tel Avivsready
 
Home management WebApp presentation
Home management WebApp presentationHome management WebApp presentation
Home management WebApp presentationbhavesh singh
 
Enterprise Devops Presentation @ Magentys Seminar London May 15 2014
Enterprise Devops Presentation @ Magentys Seminar London May 15 2014Enterprise Devops Presentation @ Magentys Seminar London May 15 2014
Enterprise Devops Presentation @ Magentys Seminar London May 15 2014Jwooldridge
 
Developing the unknown
Developing the unknownDeveloping the unknown
Developing the unknownpaul22blue
 
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
2008 - TechDays PT: Modeling and Composition for Software today and tomorrowDaniel Fisher
 
Define and Manage Requirements with IBM Rational Requirements Composer
Define and Manage Requirements with IBM Rational Requirements ComposerDefine and Manage Requirements with IBM Rational Requirements Composer
Define and Manage Requirements with IBM Rational Requirements ComposerAlan Kan
 
Deep Dive: MVC Controller Architecture
Deep Dive: MVC Controller ArchitectureDeep Dive: MVC Controller Architecture
Deep Dive: MVC Controller ArchitectureChris Eargle
 
Application Lifecycle Management with TFS
Application Lifecycle Management with TFSApplication Lifecycle Management with TFS
Application Lifecycle Management with TFSMehdi Khalili
 
Microsoft DevOps Solution - DevOps
Microsoft DevOps Solution - DevOps  Microsoft DevOps Solution - DevOps
Microsoft DevOps Solution - DevOps Chetan Gordhan
 
ALM with TFS: From the Drawing Board to the Cloud
ALM with TFS: From the Drawing Board to the CloudALM with TFS: From the Drawing Board to the Cloud
ALM with TFS: From the Drawing Board to the CloudJeremy Likness
 
Suisse Romande SF DG - Lightning workshop
Suisse Romande SF DG - Lightning workshopSuisse Romande SF DG - Lightning workshop
Suisse Romande SF DG - Lightning workshopGnanasekaran Thoppae
 
Portal Deployment Best Practices | IBM Portal Excellence Conference 2009
Portal Deployment Best Practices | IBM Portal Excellence Conference 2009Portal Deployment Best Practices | IBM Portal Excellence Conference 2009
Portal Deployment Best Practices | IBM Portal Excellence Conference 2009Perficient, Inc.
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialThomas Daly
 
Non-Developer Options in SharePoint 2013 - Fest Chicago 2014
Non-Developer Options in SharePoint 2013 - Fest Chicago 2014Non-Developer Options in SharePoint 2013 - Fest Chicago 2014
Non-Developer Options in SharePoint 2013 - Fest Chicago 2014Asif Rehmani
 
Agility and Control from AWS [FutureStack16]
Agility and Control from AWS [FutureStack16]Agility and Control from AWS [FutureStack16]
Agility and Control from AWS [FutureStack16]New Relic
 
India GRUC Agility Presentation 2015-6-30
India GRUC Agility Presentation 2015-6-30India GRUC Agility Presentation 2015-6-30
India GRUC Agility Presentation 2015-6-30Roger Snook
 
Go Faster with Process Builder
Go Faster with Process BuilderGo Faster with Process Builder
Go Faster with Process Builderandyinthecloud
 
Critical Capabilities to Shifting Left the Right Way
Critical Capabilities to Shifting Left the Right WayCritical Capabilities to Shifting Left the Right Way
Critical Capabilities to Shifting Left the Right WaySmartBear
 

Similar to Advanced Flow Techniques with Apex and Visualforce (20)

Hands-on Workshop: Intermediate Development with Heroku and Force.com
Hands-on Workshop: Intermediate Development with Heroku and Force.comHands-on Workshop: Intermediate Development with Heroku and Force.com
Hands-on Workshop: Intermediate Development with Heroku and Force.com
 
TrailblazerDX Motihari.pptx
TrailblazerDX Motihari.pptxTrailblazerDX Motihari.pptx
TrailblazerDX Motihari.pptx
 
Elevate Tel Aviv
Elevate Tel AvivElevate Tel Aviv
Elevate Tel Aviv
 
Home management WebApp presentation
Home management WebApp presentationHome management WebApp presentation
Home management WebApp presentation
 
Enterprise Devops Presentation @ Magentys Seminar London May 15 2014
Enterprise Devops Presentation @ Magentys Seminar London May 15 2014Enterprise Devops Presentation @ Magentys Seminar London May 15 2014
Enterprise Devops Presentation @ Magentys Seminar London May 15 2014
 
Developing the unknown
Developing the unknownDeveloping the unknown
Developing the unknown
 
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
 
Define and Manage Requirements with IBM Rational Requirements Composer
Define and Manage Requirements with IBM Rational Requirements ComposerDefine and Manage Requirements with IBM Rational Requirements Composer
Define and Manage Requirements with IBM Rational Requirements Composer
 
Deep Dive: MVC Controller Architecture
Deep Dive: MVC Controller ArchitectureDeep Dive: MVC Controller Architecture
Deep Dive: MVC Controller Architecture
 
Application Lifecycle Management with TFS
Application Lifecycle Management with TFSApplication Lifecycle Management with TFS
Application Lifecycle Management with TFS
 
Microsoft DevOps Solution - DevOps
Microsoft DevOps Solution - DevOps  Microsoft DevOps Solution - DevOps
Microsoft DevOps Solution - DevOps
 
ALM with TFS: From the Drawing Board to the Cloud
ALM with TFS: From the Drawing Board to the CloudALM with TFS: From the Drawing Board to the Cloud
ALM with TFS: From the Drawing Board to the Cloud
 
Suisse Romande SF DG - Lightning workshop
Suisse Romande SF DG - Lightning workshopSuisse Romande SF DG - Lightning workshop
Suisse Romande SF DG - Lightning workshop
 
Portal Deployment Best Practices | IBM Portal Excellence Conference 2009
Portal Deployment Best Practices | IBM Portal Excellence Conference 2009Portal Deployment Best Practices | IBM Portal Excellence Conference 2009
Portal Deployment Best Practices | IBM Portal Excellence Conference 2009
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - Material
 
Non-Developer Options in SharePoint 2013 - Fest Chicago 2014
Non-Developer Options in SharePoint 2013 - Fest Chicago 2014Non-Developer Options in SharePoint 2013 - Fest Chicago 2014
Non-Developer Options in SharePoint 2013 - Fest Chicago 2014
 
Agility and Control from AWS [FutureStack16]
Agility and Control from AWS [FutureStack16]Agility and Control from AWS [FutureStack16]
Agility and Control from AWS [FutureStack16]
 
India GRUC Agility Presentation 2015-6-30
India GRUC Agility Presentation 2015-6-30India GRUC Agility Presentation 2015-6-30
India GRUC Agility Presentation 2015-6-30
 
Go Faster with Process Builder
Go Faster with Process BuilderGo Faster with Process Builder
Go Faster with Process Builder
 
Critical Capabilities to Shifting Left the Right Way
Critical Capabilities to Shifting Left the Right WayCritical Capabilities to Shifting Left the Right Way
Critical Capabilities to Shifting Left the Right Way
 

More from Salesforce Developers

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

More from Salesforce Developers (20)

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

Recently uploaded

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Recently uploaded (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

Advanced Flow Techniques with Apex and Visualforce

  • 1. Advanced Flow Techniques with Apex and Visualforce ​ Damien Phillippi ​ Software Developer ​ dphillippi@soliantconsulting.com ​ damienphillippi@gmail.com ​ 
  • 2. •  What are Visual Workflows and when should I use it? •  How to combine with code. •  Code Samples Overview
  • 3. What is Visual Workflow? Software Developer, Soliant Consulting
  • 4. Visual Flows Triggered by User operation Visual and interactive Can effect or be effected by multiple objects Drag and drop interface Headless Flows can trigger events as well Restricted by governor limits Workflows Triggered by events Behind the scenes Executes on specific objects Create Static processes What Makes Visual Workflows different? In short, you generally want to use Visual WorkFlows when you have a requirement similar to traditional workflows but it requires some sort of User interaction. For those not yet familiar with Visual Workflow: https://developer.salesforce.com/trailhead/ business_process_automation/flow
  • 5. •  Create a survey that can change frequently over time •  Create a streamlined Case creation process for your org •  Quickly create a set of related children for a record •  Create a set of questions to follow along for a call center to give standardized scripts for the User •  Replace some Apex Utility Triggers with Headless Flows •  https://developer.salesforce.com/trailhead/ business_process_automation/process_whichtool Visual Workflow Use Cases
  • 6. Breakdown Point Flows tend to break down when you need to get more dynamic past the User interaction piece. In my presentation, I will be showing you 2 such examples. 1)  You want to run a SOSL or dynamic query rather than a static query on an object. 2)  You might want to dynamically route your User or do different operations depending on earlier actions in your flow.
  • 7. Code with Visual Workflows Enhance your Flow with code
  • 8. Adding code helps strengthen Flows •  Dynamic query filters •  SOSL queries •  Dynamic routing Our First goal Create a way to search the database for matches in both Leads and Contacts.
  • 9. Create a global class with the @InvocableMethod in it
  • 10. Put a Simple Flow in a Visualforce Page that uses the Invocable class that was just created. DF_Presentation.flow DFPresentation.page
  • 12. Add Error Handling What happens when more than a single record is returned? DF_Presentation.flow updated
  • 14. Dynamic Record Routing Do we want to do something different if a Lead is found vs a Contact? Maybe we decide that any Leads coming through this route should immediately be converted and Contacts should be taken to their view page.
  • 15. This looks like it should work… Unfortunately, this doesn’t work. The reason is that it fetches redirectUser as a property/variable. The method would need to be called getRedirectUser, but when it actually gets called it wouldn’t know about the flow variables yet by that point.
  • 16. Adjustments to the controller
  • 17. Updated VF page to work around the System
  • 19. Why not just use code? •  Any changes to functionality require adjustments to unit tests and deployments through Sandboxes •  Configurable by an Admin
  • 20. Closing In this 25 min, we showed you an example of some of the things you can do when you combine code/Visual Workflow. •  Invoke code from Visual Workflows •  Error handling. •  Dynamic record routing •  Alternate code with Flows: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/ apexcode/apex_process_plugin_using.htm •  Code can be found at: http://tinyurl.com/q92s6y9 •  Questions?
  • 21. Over the past ten years, our team has helped shape our clients’ futures as well as served to simply make their business lives easier. Our role extends well beyond being experts in creating custom software – we consider ourselves your trusted business partner. IMPLEMENTATION As process consultants, we assist adoption by focusing on how your team works day-to-day. APEX & VISUALFORCE Our versatile, experienced team has a deep understanding of Salesforce’s native languages. APPEXCHANGE DEVELOPMENT We develop AppExchange solutions and navigate the Salesforce security review process. SYSTEMS INTEGRATION Salesforce can seamlessly integrate with your existing business applications and IT infrastructure.